Browse Source

* don't report name differences after implicit renames

git-svn-id: trunk@2021 -
peter 19 years ago
parent
commit
ad0f93da39
3 changed files with 20 additions and 14 deletions
  1. 17 13
      compiler/pdecsub.pas
  2. 2 1
      compiler/symconst.pas
  3. 1 0
      compiler/symtable.pas

+ 17 - 13
compiler/pdecsub.pas

@@ -938,7 +938,7 @@ implementation
                          single_type(pd.rettype,false);
                          pd.test_if_fpu_result;
                          dec(testcurobject);
-                         
+
                          if (target_info.system in [system_m68k_amiga]) then
                           begin
                            if (idtoken=_LOCATION) then
@@ -958,10 +958,10 @@ implementation
                              if po_explicitparaloc in pd.procoptions then
                               { assign default locationstr, if none specified }
                               { and we've arguments with explicit paraloc }
-                              locationstr:='D0'; 
-                            end;    
+                              locationstr:='D0';
+                            end;
                           end;
-                          
+
                        end
                       else
                        begin
@@ -2451,15 +2451,19 @@ const
                         if not assigned(ad) or not assigned(fd) then
                          break;
                         { retrieve names, remove reg for register parameters }
-                        s1:=ad.name;
-                        s2:=fd.name;
-                        { compare names }
-                        if (s1<>s2) then
-                         begin
-                           MessagePos3(pd.fileinfo,parser_e_header_different_var_names,
-                                       aprocsym.name,s1,s2);
-                           break;
-                         end;
+                        if not(sp_implicitrename in ad.symoptions) and
+                           not(sp_implicitrename in fd.symoptions) then
+                          begin
+                            s1:=ad.name;
+                            s2:=fd.name;
+                            { compare names }
+                            if (s1<>s2) then
+                             begin
+                               MessagePos3(pd.fileinfo,parser_e_header_different_var_names,
+                                           aprocsym.name,s1,s2);
+                               break;
+                             end;
+                          end;
                         ad:=tsym(ad.indexnext);
                         fd:=tsym(fd.indexnext);
                       until false;

+ 2 - 1
compiler/symconst.pas

@@ -140,7 +140,8 @@ type
     sp_has_overloaded,
     sp_internal,  { internal symbol, not reported as unused }
     sp_strictprivate,
-    sp_strictprotected
+    sp_strictprotected,
+    sp_implicitrename
   );
   tsymoptions=set of tsymoption;
 

+ 1 - 0
compiler/symtable.pas

@@ -1596,6 +1596,7 @@ implementation
           begin
             inc(dupnr);
             dupsym.name:='dup'+tostr(dupnr)+dupsym.name;
+            include(tsym(dupsym).symoptions,sp_implicitrename);
           end;
       end;