View Issue Details

IDProjectCategoryView StatusLast Update
0038355FPCCompilerpublic2021-01-14 06:56
ReporterDo-wan Kim Assigned To 
PrioritynormalSeverityminorReproducibilityalways
Status newResolutionopen 
Product Version3.3.1 
Summary0038355: Delphi mode fails compiling on proc type parameter.
DescriptionUnder delphi mode, FPC trunk fails checking proc parameter on some 'Assigned' function with '-O2' switch.
It doesn't happens with '-O1' switch or 'objfpc' mode.
Steps To Reproduceprogram test_assigned;

{$mode delphi}

{$R *.res}

type
  TProcOBJ = procedure of object;
  TProcTest = procedure(a, b, c:Integer);

function testfunc(const p1:TProcOBJ; p2, p3:TProcTest):integer;
begin
  Result:=0;
  if not Assigned(p1) or
     Assigned(p2) or // works
     (not Assigned(p2) and not Assigned(p3)) // fails
     then
       exit;
end;

begin
  testfunc(nil,nil,nil);
end.
              
TagsNo tags attached.
Fixed in Revision
FPCOldBugId
FPCTarget
Attached Files

Activities

There are no notes attached to this issue.

Issue History

Date Modified Username Field Change
2021-01-14 06:56 Do-wan Kim New Issue