diff --git a/.gitattributes b/.gitattributes index 7f936fc87a..75915f0dfd 100644 --- a/.gitattributes +++ b/.gitattributes @@ -17841,6 +17841,7 @@ tests/webtbs/tw35982.pp svneol=native#text/pascal tests/webtbs/tw36013.pp svneol=native#text/pascal tests/webtbs/tw3612.pp svneol=native#text/plain tests/webtbs/tw36156.pp svneol=native#text/plain +tests/webtbs/tw36157.pp svneol=native#text/plain tests/webtbs/tw3617.pp svneol=native#text/plain tests/webtbs/tw3619.pp svneol=native#text/plain tests/webtbs/tw3621.pp svneol=native#text/plain diff --git a/compiler/ngtcon.pas b/compiler/ngtcon.pas index 521f62445e..b0fcd57110 100644 --- a/compiler/ngtcon.pas +++ b/compiler/ngtcon.pas @@ -1250,6 +1250,7 @@ function get_next_varsym(def: tabstractrecorddef; const SymList:TFPHashObjectLis end { packed array constant } else if is_packed_array(def) and + (def.elementdef.typ in [orddef,enumdef]) and ((def.elepackedbitsize mod 8 <> 0) or not ispowerof2(def.elepackedbitsize div 8,i)) then begin diff --git a/tests/webtbs/tw36157.pp b/tests/webtbs/tw36157.pp new file mode 100644 index 0000000000..3e8dc78ded --- /dev/null +++ b/tests/webtbs/tw36157.pp @@ -0,0 +1,17 @@ +program WatchesValuePrg; + +type + TEnum = (EnVal1, EnVal2, EnVal3, EnVal4); + TSet = set of TEnum; + TBitPackSetArray2 = bitpacked array [0..1, 0..2] of TSet; +const + gcBitPackSetArray2 : TBitPackSetArray2 = (([EnVal3, EnVal1], [], [EnVal3]), ([],[EnVal1,EnVal2],[EnVal1])); + +begin + if gcBitPackSetArray2[0,0]<>[EnVal3, EnVal1] then + halt(1); + if gcBitPackSetArray2[0,2]<>[EnVal3] then + halt(2); + if gcBitPackSetArray2[1,1]<>[EnVal1,EnVal2] then + halt(3); +end.