]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
[multiple changes]
authorArnaud Charlet <charlet@gcc.gnu.org>
Mon, 29 Aug 2011 08:26:40 +0000 (10:26 +0200)
committerArnaud Charlet <charlet@gcc.gnu.org>
Mon, 29 Aug 2011 08:26:40 +0000 (10:26 +0200)
2011-08-29  Steve Baird  <baird@adacore.com>

* exp_ch4.adb (Expand_N_Op_Expon): Suppress N_Op_Expon node expansion
for CodePeer and ALFA modes.

2011-08-29  Ed Schonberg  <schonberg@adacore.com>

* sem_type.adb (Collect_Interps): Within an instance, collect a homonym
that comes from an enclosing scope if it is not the renaming of an
actual, to handle properly a spurious ambiguity in an instance.

From-SVN: r178158

gcc/ada/ChangeLog
gcc/ada/exp_ch4.adb
gcc/ada/sem_type.adb

index a2c03681b6c651c0b5b1fad6f40f79503794adbf..9dc41919b662b081c591e31335d072a5c6fb0b44 100644 (file)
@@ -1,3 +1,14 @@
+2011-08-29  Steve Baird  <baird@adacore.com>
+
+       * exp_ch4.adb (Expand_N_Op_Expon): Suppress N_Op_Expon node expansion
+       for CodePeer and ALFA modes.
+
+2011-08-29  Ed Schonberg  <schonberg@adacore.com>
+
+       * sem_type.adb (Collect_Interps): Within an instance, collect a homonym
+       that comes from an enclosing scope if it is not the renaming of an
+       actual, to handle properly a spurious ambiguity in an instance.
+
 2011-08-29  Eric Botcazou  <ebotcazou@adacore.com>
 
        * sem_ch13.adb (Alignment_Check_For_Esize_Change): Rename to...
index b2984b791d1e14128e4352d5e189ec9f03936d58..230e76e9e67c571f510fa786a1c659e4b1c01992 100644 (file)
@@ -6200,6 +6200,11 @@ package body Exp_Ch4 is
       --  shifts etc. We also do this transformation if the result type is
       --  different from the base type.
 
+      if CodePeer_Mode or ALFA_Mode then
+         --  CodePeer and GNATprove want to see the unexpanded N_Op_Expon node
+         return;
+      end if;
+
       if Is_Private_Type (Etype (Base))
            or else
          Is_Private_Type (Typ)
index d11767b485930f7feadb42aa95eb7fe7be0cab68..c4d42a305ef87f403caff1c6a04ca3a7b4f7ef7a 100644 (file)
@@ -621,10 +621,15 @@ package body Sem_Type is
 
                      --  A homograph in the same scope can occur within an
                      --  instantiation, the resulting ambiguity has to be
-                     --  resolved later.
+                     --  resolved later. The homographs may both be local
+                     --  functions or actuals, or may be declared at different
+                     --  levels within the instance. The renaming of an actual
+                     --  within the instance must not be included.
 
-                     if Scope (H) = Scope (Ent)
+                     if (Scope (H) = Scope (Ent)
+                           or else Scope (H) = Scope (Scope (Ent)))
                         and then In_Instance
+                        and then H /= Renamed_Entity (Ent)
                         and then not Is_Inherited_Operation (H)
                      then
                         All_Interp.Table (All_Interp.Last) :=