* add a reference to the procsym corresponding to the chosen overloaded

procdef, so that the unit containing it is marked as "used" (mantis #15966)

    Even better would be if the unit containing the originally found procsym
    were not also marked as used, but that would require a significant
    rewrite (all symbols found using symboltable helpers are automatically
    marked by those routines)

git-svn-id: trunk@21501 -
This commit is contained in:
Jonas Maebe 2012-06-06 18:46:01 +00:00
parent df99ef17b6
commit 9412d4abd2
4 changed files with 37 additions and 0 deletions

2
.gitattributes vendored
View File

@ -12305,6 +12305,7 @@ tests/webtbs/tw15843.pp svneol=native#text/plain
tests/webtbs/tw15909.pp svneol=native#text/plain
tests/webtbs/tw1592.pp svneol=native#text/plain
tests/webtbs/tw15930.pp svneol=native#text/plain
tests/webtbs/tw15966.pp svneol=native#text/plain
tests/webtbs/tw16004.pp svneol=native#text/plain
tests/webtbs/tw16018.pp svneol=native#text/plain
tests/webtbs/tw16034.pp svneol=native#text/plain
@ -13408,6 +13409,7 @@ tests/webtbs/uw14124.pp svneol=native#text/plain
tests/webtbs/uw14958.pp svneol=native#text/plain
tests/webtbs/uw15591.pp svneol=native#text/pascal
tests/webtbs/uw15909.pp svneol=native#text/plain
tests/webtbs/uw15966.pp svneol=native#text/plain
tests/webtbs/uw17220.pp svneol=native#text/plain
tests/webtbs/uw17220a.pp svneol=native#text/plain
tests/webtbs/uw17493.pp svneol=native#text/plain

View File

@ -2967,6 +2967,11 @@ implementation
if (procdefinition.typ = procdef) then
check_hints(tprocdef(procdefinition).procsym,tprocdef(procdefinition).symoptions,tprocdef(procdefinition).deprecatedmsg);
{ add reference to corresponding procsym; may not be the one
originally found/passed to the constructor because of overloads }
if procdefinition.typ = procdef then
addsymref(tprocdef(procdefinition).procsym);
{ add needed default parameters }
if assigned(procdefinition) and
(paralength<procdefinition.maxparacount) then

15
tests/webtbs/tw15966.pp Normal file
View File

@ -0,0 +1,15 @@
{ %norun }
{ %opt=-vh -Seh }
program tw15966;
uses
uw15966;
procedure test(c: char); public; overload;
begin
writeln(c);
end;
begin
test(0);
end.

15
tests/webtbs/uw15966.pp Normal file
View File

@ -0,0 +1,15 @@
unit uw15966;
interface
procedure test(a: longint); overload;
implementation
procedure test(a: longint);
begin
writeln(a);
end;
end.