mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-14 16:19:35 +02:00
* since we already allow inline specializations in mode ObjFPC due to generic functions it's only consequential to also allow specializations after pointers (they are already allowed in mode Delphi).
+ added tests * tgeneric87.pp and tgeneric88.pp are no longer considered as tests that should fail git-svn-id: trunk@35078 -
This commit is contained in:
parent
db976a3a3e
commit
70817baf98
2
.gitattributes
vendored
2
.gitattributes
vendored
@ -11051,6 +11051,8 @@ tests/tbs/tb0619.pp svneol=native#text/pascal
|
||||
tests/tbs/tb0620.pp svneol=native#text/pascal
|
||||
tests/tbs/tb0621.pp svneol=native#text/plain
|
||||
tests/tbs/tb0622.pp svneol=native#text/plain
|
||||
tests/tbs/tb0623.pp svneol=native#text/pascal
|
||||
tests/tbs/tb0624.pp svneol=native#text/pascal
|
||||
tests/tbs/tb205.pp svneol=native#text/plain
|
||||
tests/tbs/tb610.pp svneol=native#text/pascal
|
||||
tests/tbs/tb613.pp svneol=native#text/plain
|
||||
|
@ -1562,7 +1562,6 @@ implementation
|
||||
|
||||
const
|
||||
SingleTypeOptionsInTypeBlock:array[Boolean] of TSingleTypeOptions = ([],[stoIsForwardDef]);
|
||||
SingleTypeOptionsIsDelphi:array[Boolean] of TSingleTypeOptions = ([],[stoAllowSpecialization]);
|
||||
var
|
||||
p : tnode;
|
||||
hdef : tdef;
|
||||
@ -1695,8 +1694,7 @@ implementation
|
||||
begin
|
||||
consume(_CARET);
|
||||
single_type(tt2,
|
||||
SingleTypeOptionsInTypeBlock[block_type=bt_type]+
|
||||
SingleTypeOptionsIsDelphi[m_delphi in current_settings.modeswitches]
|
||||
SingleTypeOptionsInTypeBlock[block_type=bt_type]+[stoAllowSpecialization]
|
||||
);
|
||||
{ in case of e.g. var or const sections we need to especially
|
||||
check that we don't use a generic dummy symbol }
|
||||
|
28
tests/tbs/tb0623.pp
Normal file
28
tests/tbs/tb0623.pp
Normal file
@ -0,0 +1,28 @@
|
||||
{ %NORUN }
|
||||
|
||||
program tb0623;
|
||||
|
||||
{$mode objfpc}
|
||||
{$modeswitch advancedrecords}
|
||||
|
||||
type
|
||||
generic TTest<T> = record
|
||||
public type
|
||||
PSelf = ^specialize TTest<T>;
|
||||
public
|
||||
Next: PSelf;
|
||||
end;
|
||||
|
||||
generic TTest2<T> = record
|
||||
Next: ^specialize TTest2<T>;
|
||||
end;
|
||||
|
||||
TTestLongInt = specialize TTest<LongInt>;
|
||||
TTestString = specialize TTest<String>;
|
||||
|
||||
TTest2LongInt = specialize TTest2<LongInt>;
|
||||
TTest2String = specialize TTest2<String>;
|
||||
|
||||
begin
|
||||
|
||||
end.
|
27
tests/tbs/tb0624.pp
Normal file
27
tests/tbs/tb0624.pp
Normal file
@ -0,0 +1,27 @@
|
||||
{ %NORUN }
|
||||
|
||||
program tb0624;
|
||||
|
||||
{$mode delphi}
|
||||
|
||||
type
|
||||
TTest<T> = record
|
||||
public type
|
||||
PSelf = ^TTest<T>;
|
||||
public
|
||||
Next: PSelf;
|
||||
end;
|
||||
|
||||
TTest2<T> = record
|
||||
Next: ^TTest<T>;
|
||||
end;
|
||||
|
||||
TTestLongInt = TTest<LongInt>;
|
||||
TTestString = TTest<String>;
|
||||
|
||||
TTest2LongInt = TTest2<LongInt>;
|
||||
TTest2String = TTest2<String>;
|
||||
|
||||
begin
|
||||
|
||||
end.
|
@ -1,5 +1,3 @@
|
||||
{ %FAIL }
|
||||
|
||||
program tgeneric87;
|
||||
|
||||
{$mode objfpc}
|
||||
|
@ -1,5 +1,3 @@
|
||||
{ %FAIL }
|
||||
|
||||
program tgeneric88;
|
||||
|
||||
{$mode objfpc}
|
||||
|
Loading…
Reference in New Issue
Block a user