mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-18 19:49:12 +02:00
* when checking whether the current class definition finalises an existing
forward-declared class, only search the current symtable rather than the entire symtable stack (to prevent finding types in e.g. nested types) git-svn-id: trunk@17128 -
This commit is contained in:
parent
c439d0107d
commit
ac283bb237
1
.gitattributes
vendored
1
.gitattributes
vendored
@ -9531,6 +9531,7 @@ tests/test/tclass12c.pp svneol=native#text/pascal
|
|||||||
tests/test/tclass12d.pp svneol=native#text/plain
|
tests/test/tclass12d.pp svneol=native#text/plain
|
||||||
tests/test/tclass13.pp svneol=native#text/pascal
|
tests/test/tclass13.pp svneol=native#text/pascal
|
||||||
tests/test/tclass13a.pp svneol=native#text/plain
|
tests/test/tclass13a.pp svneol=native#text/plain
|
||||||
|
tests/test/tclass13b.pp svneol=native#text/plain
|
||||||
tests/test/tclass14a.pp svneol=native#text/pascal
|
tests/test/tclass14a.pp svneol=native#text/pascal
|
||||||
tests/test/tclass14b.pp svneol=native#text/pascal
|
tests/test/tclass14b.pp svneol=native#text/pascal
|
||||||
tests/test/tclass2.pp svneol=native#text/plain
|
tests/test/tclass2.pp svneol=native#text/plain
|
||||||
|
@ -397,7 +397,6 @@ implementation
|
|||||||
typename,orgtypename : TIDString;
|
typename,orgtypename : TIDString;
|
||||||
newtype : ttypesym;
|
newtype : ttypesym;
|
||||||
sym : tsym;
|
sym : tsym;
|
||||||
srsymtable : TSymtable;
|
|
||||||
hdef : tdef;
|
hdef : tdef;
|
||||||
defpos,storetokenpos : tfileposinfo;
|
defpos,storetokenpos : tfileposinfo;
|
||||||
old_block_type : tblock_type;
|
old_block_type : tblock_type;
|
||||||
@ -462,8 +461,10 @@ implementation
|
|||||||
current_scanner.startrecordtokens(generictokenbuf);
|
current_scanner.startrecordtokens(generictokenbuf);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{ is the type already defined? }
|
{ is the type already defined? -- must be in the current symtable,
|
||||||
searchsym(typename,sym,srsymtable);
|
not in a nested symtable or one higher up the stack -> don't
|
||||||
|
use searchsym & frinds! }
|
||||||
|
sym:=tsym(symtablestack.top.find(typename));
|
||||||
newtype:=nil;
|
newtype:=nil;
|
||||||
{ found a symbol with this name? }
|
{ found a symbol with this name? }
|
||||||
if assigned(sym) then
|
if assigned(sym) then
|
||||||
|
23
tests/test/tclass13b.pp
Normal file
23
tests/test/tclass13b.pp
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
{ %norun }
|
||||||
|
|
||||||
|
{$mode delphi}
|
||||||
|
|
||||||
|
type
|
||||||
|
tc = class
|
||||||
|
type
|
||||||
|
tforward = class;
|
||||||
|
|
||||||
|
tnested = class
|
||||||
|
type
|
||||||
|
tforward = class;
|
||||||
|
|
||||||
|
tforward = class
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
tforward = class
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
begin
|
||||||
|
end.
|
Loading…
Reference in New Issue
Block a user