Browse Source

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

Jonas Maebe 13 years ago
parent
commit
9412d4abd2
4 changed files with 37 additions and 0 deletions
  1. 2 0
      .gitattributes
  2. 5 0
      compiler/ncal.pas
  3. 15 0
      tests/webtbs/tw15966.pp
  4. 15 0
      tests/webtbs/uw15966.pp

+ 2 - 0
.gitattributes

@@ -12305,6 +12305,7 @@ tests/webtbs/tw15843.pp svneol=native#text/plain
 tests/webtbs/tw15909.pp svneol=native#text/plain
 tests/webtbs/tw15909.pp svneol=native#text/plain
 tests/webtbs/tw1592.pp svneol=native#text/plain
 tests/webtbs/tw1592.pp svneol=native#text/plain
 tests/webtbs/tw15930.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/tw16004.pp svneol=native#text/plain
 tests/webtbs/tw16018.pp svneol=native#text/plain
 tests/webtbs/tw16018.pp svneol=native#text/plain
 tests/webtbs/tw16034.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/uw14958.pp svneol=native#text/plain
 tests/webtbs/uw15591.pp svneol=native#text/pascal
 tests/webtbs/uw15591.pp svneol=native#text/pascal
 tests/webtbs/uw15909.pp svneol=native#text/plain
 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/uw17220.pp svneol=native#text/plain
 tests/webtbs/uw17220a.pp svneol=native#text/plain
 tests/webtbs/uw17220a.pp svneol=native#text/plain
 tests/webtbs/uw17493.pp svneol=native#text/plain
 tests/webtbs/uw17493.pp svneol=native#text/plain

+ 5 - 0
compiler/ncal.pas

@@ -2967,6 +2967,11 @@ implementation
           if (procdefinition.typ = procdef) then
           if (procdefinition.typ = procdef) then
             check_hints(tprocdef(procdefinition).procsym,tprocdef(procdefinition).symoptions,tprocdef(procdefinition).deprecatedmsg);
             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 }
           { add needed default parameters }
           if assigned(procdefinition) and
           if assigned(procdefinition) and
              (paralength<procdefinition.maxparacount) then
              (paralength<procdefinition.maxparacount) then

+ 15 - 0
tests/webtbs/tw15966.pp

@@ -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 - 0
tests/webtbs/uw15966.pp

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