Delphi mode fails compiling on proc type parameter.
Original Reporter info from Mantis: parcel
-
Reporter name: Do-wan Kim
Original Reporter info from Mantis: parcel
- Reporter name: Do-wan Kim
Description:
Under 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 reproduce:
program 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.
Mantis conversion info:
- Mantis ID: 38355
- Build: 48154
- Version: 3.3.1