From: Arnaud Charlet Date: Mon, 29 Aug 2011 08:26:40 +0000 (+0200) Subject: [multiple changes] X-Git-Tag: releases/gcc-4.7.0~4227 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=7cc83cd8a5c38ed353c5f54cea9888727a77d14e;p=thirdparty%2Fgcc.git [multiple changes] 2011-08-29 Steve Baird * exp_ch4.adb (Expand_N_Op_Expon): Suppress N_Op_Expon node expansion for CodePeer and ALFA modes. 2011-08-29 Ed Schonberg * 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 --- diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index a2c03681b6c6..9dc41919b662 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,14 @@ +2011-08-29 Steve Baird + + * exp_ch4.adb (Expand_N_Op_Expon): Suppress N_Op_Expon node expansion + for CodePeer and ALFA modes. + +2011-08-29 Ed Schonberg + + * 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 * sem_ch13.adb (Alignment_Check_For_Esize_Change): Rename to... diff --git a/gcc/ada/exp_ch4.adb b/gcc/ada/exp_ch4.adb index b2984b791d1e..230e76e9e67c 100644 --- a/gcc/ada/exp_ch4.adb +++ b/gcc/ada/exp_ch4.adb @@ -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) diff --git a/gcc/ada/sem_type.adb b/gcc/ada/sem_type.adb index d11767b48593..c4d42a305ef8 100644 --- a/gcc/ada/sem_type.adb +++ b/gcc/ada/sem_type.adb @@ -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) :=