Codetools: Fix FindDeclaration tool to not finds inaccessible private/protected fields. Issue #22464, patch from Anton

git-svn-id: trunk@40909 -
This commit is contained in:
juha 2013-04-28 15:20:16 +00:00
parent 3cad2a3828
commit 727f6ddd62

View File

@ -8746,8 +8746,7 @@ begin
Params.FoundProc^.ExprInputList.Count) then
begin
// the new proc fits better
Params.ChangeFoundProc(FoundContext,ParamCompatibility,
CurCompatibilityList);
Params.ChangeFoundProc(FoundContext,ParamCompatibility,CurCompatibilityList);
CurCompatibilityList:=nil; // set to nil, so that it will not be freed
end;
end;
@ -8758,6 +8757,14 @@ begin
FreeMem(CurCompatibilityList);
end;
end;
end else
if (FoundContext.Node.Desc=ctnVarDefinition) then begin
if not (fdfIgnoreClassVisibility in Params.Flags)
and (FoundContext.Tool<>Params.IdentifierTool)
and (GetClassVisibility(FoundContext.Node)=ctnClassPrivate) then
Result:=ifrProceedSearch
else
Result:=ifrSuccess;
end else begin
Result:=ifrSuccess;
end;