mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-06-13 00:18:18 +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/tb0620.pp svneol=native#text/pascal
|
||||||
tests/tbs/tb0621.pp svneol=native#text/plain
|
tests/tbs/tb0621.pp svneol=native#text/plain
|
||||||
tests/tbs/tb0622.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/tb205.pp svneol=native#text/plain
|
||||||
tests/tbs/tb610.pp svneol=native#text/pascal
|
tests/tbs/tb610.pp svneol=native#text/pascal
|
||||||
tests/tbs/tb613.pp svneol=native#text/plain
|
tests/tbs/tb613.pp svneol=native#text/plain
|
||||||
|
@ -1562,7 +1562,6 @@ implementation
|
|||||||
|
|
||||||
const
|
const
|
||||||
SingleTypeOptionsInTypeBlock:array[Boolean] of TSingleTypeOptions = ([],[stoIsForwardDef]);
|
SingleTypeOptionsInTypeBlock:array[Boolean] of TSingleTypeOptions = ([],[stoIsForwardDef]);
|
||||||
SingleTypeOptionsIsDelphi:array[Boolean] of TSingleTypeOptions = ([],[stoAllowSpecialization]);
|
|
||||||
var
|
var
|
||||||
p : tnode;
|
p : tnode;
|
||||||
hdef : tdef;
|
hdef : tdef;
|
||||||
@ -1695,8 +1694,7 @@ implementation
|
|||||||
begin
|
begin
|
||||||
consume(_CARET);
|
consume(_CARET);
|
||||||
single_type(tt2,
|
single_type(tt2,
|
||||||
SingleTypeOptionsInTypeBlock[block_type=bt_type]+
|
SingleTypeOptionsInTypeBlock[block_type=bt_type]+[stoAllowSpecialization]
|
||||||
SingleTypeOptionsIsDelphi[m_delphi in current_settings.modeswitches]
|
|
||||||
);
|
);
|
||||||
{ in case of e.g. var or const sections we need to especially
|
{ in case of e.g. var or const sections we need to especially
|
||||||
check that we don't use a generic dummy symbol }
|
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;
|
program tgeneric87;
|
||||||
|
|
||||||
{$mode objfpc}
|
{$mode objfpc}
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
{ %FAIL }
|
|
||||||
|
|
||||||
program tgeneric88;
|
program tgeneric88;
|
||||||
|
|
||||||
{$mode objfpc}
|
{$mode objfpc}
|
||||||
|
Loading…
Reference in New Issue
Block a user