mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-22 08:09:29 +02:00

* A second attempt to remove unconditional pi_needs_implicit_finally from constructors, should hopefully be correct this time due to the changes described above. + Test (a copy of tctr1.pp with additional {$implicitexceptions off} directive) git-svn-id: trunk@19955 -
31 lines
484 B
ObjectPascal
31 lines
484 B
ObjectPascal
{$mode objfpc}{$h+}
|
|
// Differs from tctr1.pp in the following directive:
|
|
{$implicitexceptions off}
|
|
|
|
type
|
|
tobj=class(TObject)
|
|
ffield:boolean;
|
|
constructor Create;
|
|
procedure AfterConstruction;override;
|
|
end;
|
|
|
|
{ Exit statement in constructor must not jump over AfterConstruction! }
|
|
constructor tobj.Create;
|
|
begin
|
|
exit;
|
|
end;
|
|
|
|
procedure tobj.AfterConstruction;
|
|
begin
|
|
ffield:=true;
|
|
end;
|
|
|
|
|
|
var
|
|
o: tobj;
|
|
begin
|
|
o:=tobj.create;
|
|
if not o.ffield then
|
|
Halt(1);
|
|
end.
|