mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-10 03:49:04 +02:00
compiler: clear vd_class option if it was added by _STATIC token (issue #0020119)
git-svn-id: trunk@19001 -
This commit is contained in:
parent
389c033a29
commit
7e88628b02
1
.gitattributes
vendored
1
.gitattributes
vendored
@ -11767,6 +11767,7 @@ tests/webtbs/tw20035b.pp svneol=native#text/pascal
|
||||
tests/webtbs/tw2004.pp svneol=native#text/plain
|
||||
tests/webtbs/tw20093.pp svneol=native#text/pascal
|
||||
tests/webtbs/tw20093a.pp svneol=native#text/pascal
|
||||
tests/webtbs/tw20119.pp -text svneol=native#test/pascal
|
||||
tests/webtbs/tw2028.pp svneol=native#text/plain
|
||||
tests/webtbs/tw2030.pp svneol=native#text/plain
|
||||
tests/webtbs/tw2031.pp svneol=native#text/plain
|
||||
|
@ -1500,7 +1500,8 @@ implementation
|
||||
uniondef : trecorddef;
|
||||
hintsymoptions : tsymoptions;
|
||||
deprecatedmsg : pshortstring;
|
||||
semicoloneaten: boolean;
|
||||
semicoloneaten,
|
||||
removeclassoption: boolean;
|
||||
{$if defined(powerpc) or defined(powerpc64)}
|
||||
tempdef: tdef;
|
||||
is_first_type: boolean;
|
||||
@ -1519,7 +1520,8 @@ implementation
|
||||
consume(_ID);
|
||||
{ read vars }
|
||||
sc:=TFPObjectList.create(false);
|
||||
recstlist:=TFPObjectList.create(false);;
|
||||
recstlist:=TFPObjectList.create(false);
|
||||
removeclassoption:=false;
|
||||
while (token=_ID) and
|
||||
not(((vd_object in options) or
|
||||
((vd_record in options) and (m_advanced_records in current_settings.modeswitches))) and
|
||||
@ -1654,7 +1656,8 @@ implementation
|
||||
if not (vd_class in options) and try_to_consume(_STATIC) then
|
||||
begin
|
||||
consume(_SEMICOLON);
|
||||
include(options, vd_class);
|
||||
include(options,vd_class);
|
||||
removeclassoption:=true;
|
||||
end;
|
||||
end;
|
||||
if vd_class in options then
|
||||
@ -1675,6 +1678,11 @@ implementation
|
||||
sl.addsym(sl_load,hstaticvs);
|
||||
recst.insert(tabsolutevarsym.create_ref('$'+static_name,hdef,sl));
|
||||
end;
|
||||
if removeclassoption then
|
||||
begin
|
||||
exclude(options,vd_class);
|
||||
removeclassoption:=false;
|
||||
end;
|
||||
end;
|
||||
if (visibility=vis_published) and
|
||||
not(is_class(hdef)) then
|
||||
|
12
tests/webtbs/tw20119.pp
Normal file
12
tests/webtbs/tw20119.pp
Normal file
@ -0,0 +1,12 @@
|
||||
{%norun}
|
||||
program tw20119;
|
||||
{$mode objfpc}
|
||||
type
|
||||
T = class
|
||||
private
|
||||
F1: Integer; static;
|
||||
F2: Integer; static;
|
||||
end;
|
||||
begin
|
||||
end.
|
||||
|
Loading…
Reference in New Issue
Block a user