Преглед изворни кода

* when using overloaded functions in Delphi mode without the "overload"
directive, state that "overload" is missing rather than that
overloading is disabled (mantis #10081)

git-svn-id: trunk@12723 -

Jonas Maebe пре 16 година
родитељ
комит
549f1ecc1b
3 измењених фајлова са 22 додато и 1 уклоњено
  1. 1 0
      .gitattributes
  2. 4 1
      compiler/pdecsub.pas
  3. 17 0
      tests/webtbf/tw10081.pp

+ 1 - 0
.gitattributes

@@ -8220,6 +8220,7 @@ tests/webtbf/tw0890a.pp svneol=native#text/plain
 tests/webtbf/tw0893.pp svneol=native#text/plain
 tests/webtbf/tw0896.pp svneol=native#text/plain
 tests/webtbf/tw0896a.pp svneol=native#text/plain
+tests/webtbf/tw10081.pp svneol=native#text/plain
 tests/webtbf/tw10425a.pp svneol=native#text/plain
 tests/webtbf/tw10457.pp svneol=native#text/plain
 tests/webtbf/tw10833a.pp svneol=native#text/plain

+ 4 - 1
compiler/pdecsub.pas

@@ -2756,7 +2756,10 @@ const
                begin
                  if not(fwpd.forwarddef) then
                   begin
-                    MessagePos(currpd.fileinfo,parser_e_procedure_overloading_is_off);
+                    if (m_tp7 in current_settings.modeswitches) then
+                      MessagePos(currpd.fileinfo,parser_e_procedure_overloading_is_off)
+                    else
+                      MessagePos1(currpd.fileinfo,parser_e_no_overload_for_all_procs,currpd.procsym.realname);
                     break;
                   end;
                end;

+ 17 - 0
tests/webtbf/tw10081.pp

@@ -0,0 +1,17 @@
+{ %fail }
+{$mode delphi}
+
+{ manual verification: make sure it complains about a missing overload
+  directive rather than saying that overloading is disabled
+}
+
+procedure test(a: longint);
+begin
+end;
+
+procedure test(s: string);
+begin
+end;
+
+begin
+end.