mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-25 12:49:41 +02:00
* ensure that a procvar (especially a "REFERENCE TO") begins either with FUNCTION or PROCEDURE
+ added test
This commit is contained in:
parent
7909f00c83
commit
c1ecfc323a
@ -1584,7 +1584,10 @@ implementation
|
||||
olddef:=nil;
|
||||
|
||||
is_func:=(token=_FUNCTION);
|
||||
consume(token);
|
||||
if token in [_FUNCTION,_PROCEDURE] then
|
||||
consume(token)
|
||||
else
|
||||
consume(_FUNCTION);
|
||||
pd:=cprocvardef.create(normal_function_level,doregister);
|
||||
|
||||
if assigned(sym) then
|
||||
|
14
tests/tbf/tb0297.pp
Normal file
14
tests/tbf/tb0297.pp
Normal file
@ -0,0 +1,14 @@
|
||||
{ %FAIL }
|
||||
|
||||
program tb0297;
|
||||
|
||||
{$mode objfpc}
|
||||
{$modeswitch functionreferences}
|
||||
|
||||
type
|
||||
TTestProc = procedure;
|
||||
TTestProcRef = reference to TTestProc;
|
||||
|
||||
begin
|
||||
|
||||
end.
|
Loading…
Reference in New Issue
Block a user