mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-06-26 15:18:29 +02:00
* handle records in iso mode properly if no tag-field is given
git-svn-id: trunk@29259 -
This commit is contained in:
parent
7897c81c77
commit
dd967eb136
1
.gitattributes
vendored
1
.gitattributes
vendored
@ -11801,6 +11801,7 @@ tests/test/tisoread.pp svneol=native#text/pascal
|
|||||||
tests/test/tisorec1.pp svneol=native#text/pascal
|
tests/test/tisorec1.pp svneol=native#text/pascal
|
||||||
tests/test/tisorec2.pp svneol=native#text/pascal
|
tests/test/tisorec2.pp svneol=native#text/pascal
|
||||||
tests/test/tisorec3.pp svneol=native#text/pascal
|
tests/test/tisorec3.pp svneol=native#text/pascal
|
||||||
|
tests/test/tisorec4.pp svneol=native#text/pascal
|
||||||
tests/test/tlea1.pp svneol=native#text/plain
|
tests/test/tlea1.pp svneol=native#text/plain
|
||||||
tests/test/tlea2.pp svneol=native#text/plain
|
tests/test/tlea2.pp svneol=native#text/plain
|
||||||
tests/test/tlib1a.pp svneol=native#text/plain
|
tests/test/tlib1a.pp svneol=native#text/plain
|
||||||
|
@ -376,11 +376,13 @@ implementation
|
|||||||
end;
|
end;
|
||||||
if found then
|
if found then
|
||||||
begin
|
begin
|
||||||
{ setup variant selector }
|
{ if no tag-field is given, do not create an assignment statement for it }
|
||||||
addstatement(newstatement,cassignmentnode.create(
|
if assigned(variantselectsymbol) then
|
||||||
csubscriptnode.create(variantselectsymbol,
|
{ setup variant selector }
|
||||||
cderefnode.create(ctemprefnode.create(temp))),
|
addstatement(newstatement,cassignmentnode.create(
|
||||||
p2));
|
csubscriptnode.create(variantselectsymbol,
|
||||||
|
cderefnode.create(ctemprefnode.create(temp))),
|
||||||
|
p2));
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
Message(parser_e_illegal_expression);
|
Message(parser_e_illegal_expression);
|
||||||
|
23
tests/test/tisorec4.pp
Normal file
23
tests/test/tisorec4.pp
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
{$mode iso}
|
||||||
|
type
|
||||||
|
tr = record
|
||||||
|
l : longint;
|
||||||
|
case integer of
|
||||||
|
1 : (s : array[0..255] of char);
|
||||||
|
2 : (n : integer);
|
||||||
|
3 : (w : word; case j : integer of
|
||||||
|
1 : (t : array[0..255] of char);
|
||||||
|
2 : (a : integer);
|
||||||
|
);
|
||||||
|
end;
|
||||||
|
pr = ^tr;
|
||||||
|
|
||||||
|
var
|
||||||
|
r : pr;
|
||||||
|
begin
|
||||||
|
new(r,3,2);
|
||||||
|
if r^.j<>2 then
|
||||||
|
halt(1);
|
||||||
|
dispose(r);
|
||||||
|
writeln('ok');
|
||||||
|
end.
|
Loading…
Reference in New Issue
Block a user