mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-30 11:20:23 +02:00
compiler: reset section type to regular fields section after the "public", "protected", ... and other section visibility keywords
git-svn-id: trunk@16302 -
This commit is contained in:
parent
71aa7eaabd
commit
f5751d81db
1
.gitattributes
vendored
1
.gitattributes
vendored
@ -9158,6 +9158,7 @@ tests/test/tclass1.pp svneol=native#text/plain
|
|||||||
tests/test/tclass10.pp svneol=native#text/pascal
|
tests/test/tclass10.pp svneol=native#text/pascal
|
||||||
tests/test/tclass10a.pp svneol=native#text/pascal
|
tests/test/tclass10a.pp svneol=native#text/pascal
|
||||||
tests/test/tclass10b.pp svneol=native#text/pascal
|
tests/test/tclass10b.pp svneol=native#text/pascal
|
||||||
|
tests/test/tclass10c.pp svneol=native#text/pascal
|
||||||
tests/test/tclass11a.pp svneol=native#text/pascal
|
tests/test/tclass11a.pp svneol=native#text/pascal
|
||||||
tests/test/tclass11b.pp svneol=native#text/pascal
|
tests/test/tclass11b.pp svneol=native#text/pascal
|
||||||
tests/test/tclass12a.pp svneol=native#text/pascal
|
tests/test/tclass12a.pp svneol=native#text/pascal
|
||||||
|
@ -650,6 +650,8 @@ implementation
|
|||||||
current_objectdef.symtable.currentvisibility:=vis_private;
|
current_objectdef.symtable.currentvisibility:=vis_private;
|
||||||
include(current_objectdef.objectoptions,oo_has_private);
|
include(current_objectdef.objectoptions,oo_has_private);
|
||||||
fields_allowed:=true;
|
fields_allowed:=true;
|
||||||
|
is_classdef:=false;
|
||||||
|
classfields:=false;
|
||||||
object_member_blocktype:=bt_general;
|
object_member_blocktype:=bt_general;
|
||||||
end;
|
end;
|
||||||
_PROTECTED :
|
_PROTECTED :
|
||||||
@ -661,6 +663,8 @@ implementation
|
|||||||
current_objectdef.symtable.currentvisibility:=vis_protected;
|
current_objectdef.symtable.currentvisibility:=vis_protected;
|
||||||
include(current_objectdef.objectoptions,oo_has_protected);
|
include(current_objectdef.objectoptions,oo_has_protected);
|
||||||
fields_allowed:=true;
|
fields_allowed:=true;
|
||||||
|
is_classdef:=false;
|
||||||
|
classfields:=false;
|
||||||
object_member_blocktype:=bt_general;
|
object_member_blocktype:=bt_general;
|
||||||
end;
|
end;
|
||||||
_PUBLIC :
|
_PUBLIC :
|
||||||
@ -671,6 +675,8 @@ implementation
|
|||||||
consume(_PUBLIC);
|
consume(_PUBLIC);
|
||||||
current_objectdef.symtable.currentvisibility:=vis_public;
|
current_objectdef.symtable.currentvisibility:=vis_public;
|
||||||
fields_allowed:=true;
|
fields_allowed:=true;
|
||||||
|
is_classdef:=false;
|
||||||
|
classfields:=false;
|
||||||
object_member_blocktype:=bt_general;
|
object_member_blocktype:=bt_general;
|
||||||
end;
|
end;
|
||||||
_PUBLISHED :
|
_PUBLISHED :
|
||||||
@ -687,6 +693,8 @@ implementation
|
|||||||
consume(_PUBLISHED);
|
consume(_PUBLISHED);
|
||||||
current_objectdef.symtable.currentvisibility:=vis_published;
|
current_objectdef.symtable.currentvisibility:=vis_published;
|
||||||
fields_allowed:=true;
|
fields_allowed:=true;
|
||||||
|
is_classdef:=false;
|
||||||
|
classfields:=false;
|
||||||
object_member_blocktype:=bt_general;
|
object_member_blocktype:=bt_general;
|
||||||
end;
|
end;
|
||||||
_STRICT :
|
_STRICT :
|
||||||
@ -717,6 +725,8 @@ implementation
|
|||||||
else
|
else
|
||||||
message(parser_e_protected_or_private_expected);
|
message(parser_e_protected_or_private_expected);
|
||||||
fields_allowed:=true;
|
fields_allowed:=true;
|
||||||
|
is_classdef:=false;
|
||||||
|
classfields:=false;
|
||||||
object_member_blocktype:=bt_general;
|
object_member_blocktype:=bt_general;
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
|
21
tests/test/tclass10c.pp
Normal file
21
tests/test/tclass10c.pp
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
program tclass10c;
|
||||||
|
{$ifdef fpc}
|
||||||
|
{$mode delphi}
|
||||||
|
{$endif}
|
||||||
|
|
||||||
|
// check that "protected" or any other section resets the section type to accept regular fields
|
||||||
|
|
||||||
|
type
|
||||||
|
Tfoo=class
|
||||||
|
private
|
||||||
|
class var
|
||||||
|
f1: Integer;
|
||||||
|
protected
|
||||||
|
f2: Integer;
|
||||||
|
public
|
||||||
|
class property pf1: Integer read f1;
|
||||||
|
property pf2: Integer read f2;
|
||||||
|
end;
|
||||||
|
|
||||||
|
begin
|
||||||
|
end.
|
Loading…
Reference in New Issue
Block a user