mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-22 04:09:19 +02:00
* only resolve a dummy symbol if it is a type symbol (thus truly a dummy symbol)
+ added tests git-svn-id: trunk@44172 -
This commit is contained in:
parent
20698bb36f
commit
c4f3f7f453
2
.gitattributes
vendored
2
.gitattributes
vendored
@ -13097,6 +13097,8 @@ tests/tbs/tb0665.pp svneol=native#text/pascal
|
|||||||
tests/tbs/tb0666a.pp svneol=native#text/pascal
|
tests/tbs/tb0666a.pp svneol=native#text/pascal
|
||||||
tests/tbs/tb0666b.pp svneol=native#text/pascal
|
tests/tbs/tb0666b.pp svneol=native#text/pascal
|
||||||
tests/tbs/tb0667.pp svneol=native#text/pascal
|
tests/tbs/tb0667.pp svneol=native#text/pascal
|
||||||
|
tests/tbs/tb0668a.pp svneol=native#text/pascal
|
||||||
|
tests/tbs/tb0668b.pp svneol=native#text/pascal
|
||||||
tests/tbs/ub0060.pp svneol=native#text/plain
|
tests/tbs/ub0060.pp svneol=native#text/plain
|
||||||
tests/tbs/ub0069.pp svneol=native#text/plain
|
tests/tbs/ub0069.pp svneol=native#text/plain
|
||||||
tests/tbs/ub0119.pp svneol=native#text/plain
|
tests/tbs/ub0119.pp svneol=native#text/plain
|
||||||
|
@ -3011,11 +3011,11 @@ implementation
|
|||||||
wasgenericdummy:=false;
|
wasgenericdummy:=false;
|
||||||
if assigned(srsym) and
|
if assigned(srsym) and
|
||||||
(sp_generic_dummy in srsym.symoptions) and
|
(sp_generic_dummy in srsym.symoptions) and
|
||||||
|
(srsym.typ=typesym) and
|
||||||
(
|
(
|
||||||
(
|
(
|
||||||
(m_delphi in current_settings.modeswitches) and
|
(m_delphi in current_settings.modeswitches) and
|
||||||
not (token in [_LT, _LSHARPBRACKET]) and
|
not (token in [_LT, _LSHARPBRACKET]) and
|
||||||
(srsym.typ=typesym) and
|
|
||||||
(ttypesym(srsym).typedef.typ=undefineddef)
|
(ttypesym(srsym).typedef.typ=undefineddef)
|
||||||
)
|
)
|
||||||
or
|
or
|
||||||
|
20
tests/tbs/tb0668a.pp
Normal file
20
tests/tbs/tb0668a.pp
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
{ %NORUN }
|
||||||
|
|
||||||
|
program tb0668a;
|
||||||
|
|
||||||
|
{$mode objfpc}
|
||||||
|
|
||||||
|
procedure FreeAndNil(var Obj);
|
||||||
|
begin
|
||||||
|
end;
|
||||||
|
|
||||||
|
generic procedure FreeAndNil<T: class>(var Obj: T);
|
||||||
|
begin
|
||||||
|
end;
|
||||||
|
|
||||||
|
var
|
||||||
|
t: TObject;
|
||||||
|
begin
|
||||||
|
FreeAndNil(t);
|
||||||
|
specialize FreeAndNil<TObject>(t);
|
||||||
|
end.
|
20
tests/tbs/tb0668b.pp
Normal file
20
tests/tbs/tb0668b.pp
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
{ %NORUN }
|
||||||
|
|
||||||
|
program tb0668b;
|
||||||
|
|
||||||
|
{$mode objfpc}
|
||||||
|
|
||||||
|
generic procedure FreeAndNil<T: class>(var Obj: T);
|
||||||
|
begin
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure FreeAndNil(var Obj);
|
||||||
|
begin
|
||||||
|
end;
|
||||||
|
|
||||||
|
var
|
||||||
|
t: TObject;
|
||||||
|
begin
|
||||||
|
FreeAndNil(t);
|
||||||
|
specialize FreeAndNil<TObject>(t);
|
||||||
|
end.
|
Loading…
Reference in New Issue
Block a user