* 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:
Jonas Maebe 2012-11-27 16:40:51 +00:00
parent d53b5371bb
commit a1923f02f8
3 changed files with 43 additions and 4 deletions

1
.gitattributes vendored
View File

@ -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

View File

@ -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
View 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.