mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-10 13:18:51 +02:00

nadd.pas, taddnode: + add new constructor "create_internal" which adds "nf_internal" to the node's "flags" * pass_typecheck_internal: allow pointer comparisons other than "=" and "<>" for nodes which have "nf_internal" set psub.pas, generate_bodyentry_block: * create the addnode using "create_internal" instead of "create" to allow the pointer comparison + added test git-svn-id: trunk@25069 -
48 lines
685 B
ObjectPascal
48 lines
685 B
ObjectPascal
{ %NORUN }
|
|
|
|
program tw24651;
|
|
|
|
//{$mode delphi}{$H+}
|
|
{$modeswitch class}
|
|
{$A+}
|
|
{$B-}
|
|
{$I+}
|
|
{$X-}
|
|
|
|
uses
|
|
Classes
|
|
{ you can add units after this };
|
|
|
|
type
|
|
o_Class1 = class
|
|
fString1 : string ;
|
|
constructor Create ;
|
|
end ;
|
|
|
|
o_Class2 = class (o_Class1)
|
|
fString2 : string ;
|
|
constructor Create (aStr : string) ;
|
|
end ;
|
|
|
|
constructor o_Class1.Create ;
|
|
//var t_o : pointer ;
|
|
begin
|
|
{t_o := }inherited Create ;
|
|
fString1 := 'test value'
|
|
end ;
|
|
|
|
constructor o_Class2.Create (aStr : string) ;
|
|
//var c_1 : pointer;
|
|
begin
|
|
{c_1 := }inherited Create ;
|
|
fstring2 := aStr
|
|
end ;
|
|
|
|
var
|
|
C2 : o_Class2 ;
|
|
|
|
begin
|
|
C2 := o_Class2.Create ('test param') ;
|
|
WriteLn (C2.fString1)
|
|
end.
|