Fix for Mantis .

ngenutil.pas, AddToStructsInit:
  * don't add class constructors/destructors to the init table if they belong to a generic type

+ test

git-svn-id: trunk@25234 -
This commit is contained in:
svenbarth 2013-08-11 11:20:12 +00:00
parent 83e843fe2a
commit ff3bb9322a
3 changed files with 19 additions and 0 deletions

1
.gitattributes vendored
View File

@ -13474,6 +13474,7 @@ tests/webtbs/tw2473.pp svneol=native#text/plain
tests/webtbs/tw2480.pp svneol=native#text/plain
tests/webtbs/tw2481.pp svneol=native#text/plain
tests/webtbs/tw2483.pp svneol=native#text/plain
tests/webtbs/tw24848.pp svneol=native#text/pascal
tests/webtbs/tw2492.pp svneol=native#text/plain
tests/webtbs/tw2494.pp svneol=native#text/plain
tests/webtbs/tw2503.pp svneol=native#text/plain

View File

@ -545,6 +545,7 @@ implementation
StructList: TFPList absolute arg;
begin
if (tdef(p).typ in [objectdef,recorddef]) and
not (df_generic in tdef(p).defoptions) and
([oo_has_class_constructor,oo_has_class_destructor] * tabstractrecorddef(p).objectoptions <> []) then
StructList.Add(p);
end;

17
tests/webtbs/tw24848.pp Normal file
View File

@ -0,0 +1,17 @@
{ %NORUN }
program project18;
{$mode delphi}
type
TFoo<T> = class
class constructor Create;
end;
class constructor TFoo<T>.Create;
begin
end;
begin
end. // Error: Undefined symbol: P$PROJECT18$_$TFOO$1_$__$$_create