mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-11-03 13:49:44 +01:00
* always mark symbols referenced by properties as "used"; in case the
property is private, the "used" tracking of the property itself will
indicate whether the symbol is actually used (mantis #22155)
git-svn-id: trunk@23070 -
This commit is contained in:
parent
d53b5371bb
commit
a1923f02f8
1
.gitattributes
vendored
1
.gitattributes
vendored
@ -12940,6 +12940,7 @@ tests/webtbs/tw2210.pp svneol=native#text/plain
|
||||
tests/webtbs/tw22133.pp svneol=native#text/plain
|
||||
tests/webtbs/tw2214.pp svneol=native#text/plain
|
||||
tests/webtbs/tw22154.pp svneol=native#text/pascal
|
||||
tests/webtbs/tw22155.pp svneol=native#text/plain
|
||||
tests/webtbs/tw22160a1.pp svneol=native#text/pascal
|
||||
tests/webtbs/tw22160b1.pp svneol=native#text/pascal
|
||||
tests/webtbs/tw2220.pp svneol=native#text/plain
|
||||
|
||||
@ -103,15 +103,13 @@ implementation
|
||||
case sym.typ of
|
||||
fieldvarsym :
|
||||
begin
|
||||
if (symtablestack.top.currentvisibility<>vis_private) then
|
||||
addsymref(sym);
|
||||
addsymref(sym);
|
||||
pl.addsym(sl_load,sym);
|
||||
def:=tfieldvarsym(sym).vardef;
|
||||
end;
|
||||
procsym :
|
||||
begin
|
||||
if (symtablestack.top.currentvisibility<>vis_private) then
|
||||
addsymref(sym);
|
||||
addsymref(sym);
|
||||
pl.addsym(sl_call,sym);
|
||||
end;
|
||||
else
|
||||
|
||||
40
tests/webtbs/tw22155.pp
Normal file
40
tests/webtbs/tw22155.pp
Normal file
@ -0,0 +1,40 @@
|
||||
{ %opt=-vn -Sen }
|
||||
|
||||
{$MODE DELPHI}
|
||||
{.$DEFINE ALT_MODE}
|
||||
|
||||
type
|
||||
TWrapper = class
|
||||
strict private
|
||||
type
|
||||
TInternals = record
|
||||
class procedure Z; static;
|
||||
end;
|
||||
class var
|
||||
FInternals: TInternals;
|
||||
private
|
||||
class property Internals: TInternals read FInternals;
|
||||
public
|
||||
procedure Z;
|
||||
end;
|
||||
|
||||
class procedure TWrapper.TInternals.Z;
|
||||
begin
|
||||
end;
|
||||
|
||||
procedure TWrapper.Z;
|
||||
begin
|
||||
{$IFNDEF ALT_MODE}
|
||||
Internals.Z; { Class variable FInternals “unused” }
|
||||
{$ELSE}
|
||||
FInternals.Z; { Class property Internals “unused” }
|
||||
{$ENDIF}
|
||||
end;
|
||||
|
||||
|
||||
begin
|
||||
with TWrapper.Create do begin
|
||||
Z;
|
||||
Free;
|
||||
end;
|
||||
end.
|
||||
Loading…
Reference in New Issue
Block a user