* fixed wrong "assigned but not used" note for class and interface

(the latter via a type cast) variables from which only fields are
    read

git-svn-id: trunk@4181 -
This commit is contained in:
Jonas Maebe 2006-07-14 17:06:31 +00:00
parent 0d0766a595
commit 30ee3416e8
3 changed files with 28 additions and 1 deletions

1
.gitattributes vendored
View File

@ -5762,6 +5762,7 @@ tests/tbs/tb0497c.pp -text
tests/tbs/tb0498.pp svneol=native#text/plain
tests/tbs/tb0499.pp svneol=native#text/plain
tests/tbs/tb0500.pp svneol=native#text/plain
tests/tbs/tb0501.pp svneol=native#text/plain
tests/tbs/ub0060.pp svneol=native#text/plain
tests/tbs/ub0069.pp svneol=native#text/plain
tests/tbs/ub0119.pp svneol=native#text/plain

View File

@ -790,7 +790,11 @@ implementation
p:=tunarynode(p).left;
end;
subscriptn :
p:=tunarynode(p).left;
begin
if is_class_or_interface(tunarynode(p).left.resulttype.def) then
newstate := vs_read;
p:=tunarynode(p).left;
end;
vecn:
begin
set_varstate(tbinarynode(p).right,vs_read,[vsf_must_be_valid]);

22
tests/tbs/tb0501.pp Normal file
View File

@ -0,0 +1,22 @@
{ %OPT=-Sen }
{$mode objfpc}
type
tc = class
procedure t;
private
fleft: tc;
end;
procedure tc.t;
var
oldroot: tc;
begin
fleft := nil;
oldroot := nil;
oldroot.fleft := nil;
end;
begin
end.