* count references to class fields/messages from outside that class'

own methods (mantis #8090)

git-svn-id: trunk@5870 -
This commit is contained in:
Jonas Maebe 2007-01-10 17:50:24 +00:00
parent 6f66f75f69
commit 45e9633f97
3 changed files with 51 additions and 0 deletions

1
.gitattributes vendored
View File

@ -7949,6 +7949,7 @@ tests/webtbs/tw7975a.pp svneol=native#text/plain
tests/webtbs/tw8018.pp svneol=native#text/plain
tests/webtbs/tw8028.pp svneol=native#text/plain
tests/webtbs/tw8049.pp svneol=native#text/plain
tests/webtbs/tw8090.pp svneol=native#text/plain
tests/webtbs/ub1873.pp svneol=native#text/plain
tests/webtbs/ub1883.pp svneol=native#text/plain
tests/webtbs/uw0555.pp svneol=native#text/plain

View File

@ -1630,6 +1630,7 @@ implementation
if assigned(srsym) and
tsym(srsym).is_visible_for_object(contextclassh,currentclassh) then
begin
addsymref(srsym);
result:=true;
exit;
end;
@ -1661,6 +1662,7 @@ implementation
srdef:=def;
srsym:=tprocdef(def).procsym;
srsymtable:=classh.symtable;
addsymref(srsym);
result:=true;
exit;
end;
@ -1692,6 +1694,7 @@ implementation
begin
srsym:=tprocdef(def).procsym;
srsymtable:=classh.symtable;
addsymref(srsym);
result:=true;
exit;
end;

47
tests/webtbs/tw8090.pp Normal file
View File

@ -0,0 +1,47 @@
{ %opt=-Sen }
program notusedbug;
{$mode objfpc}{$H+}
uses
Classes, SysUtils
{ add your units here };
type
TA = class
private
FC: integer;
end;
{ TB }
TB = class
private FA: TA;
public
constructor Create;
destructor Destroy; override;
end;
{ TB }
constructor TB.Create;
begin
FA := TA.Create;
FA.FC := 4;
writeln(FA.FC);
end;
destructor TB.Destroy;
begin
FA.Free;
inherited Destroy;
end;
var
b: TB;
begin
b := TB.Create;
b.Free;
end.