From: charlet Date: Wed, 29 Jan 2014 15:26:18 +0000 (+0000) Subject: 2014-01-29 Ed Schonberg X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=28d5d68f82021e25f4f1b896c23ddf4f7eea2558;p=thirdparty%2Fgcc.git 2014-01-29 Ed Schonberg * checks.adb: minor clarification. * sem_ch7.adb (Declare_Inherited_Private_Subprograms): Limit search for primitive operations to the entities that immediately follow the type declaration. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@207248 138bc75d-0d04-0410-961f-82ee72b054a4 --- diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index c6e15738146f..f79ca89b1298 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,10 @@ +2014-01-29 Ed Schonberg + + * checks.adb: minor clarification. + * sem_ch7.adb (Declare_Inherited_Private_Subprograms): Limit + search for primitive operations to the entities that immediately + follow the type declaration. + 2014-01-29 Tristan Gingold * exp_ch9.adb (Build_Protected_Entry): Do not call diff --git a/gcc/ada/checks.adb b/gcc/ada/checks.adb index 826c09bf11f4..872c18a5859b 100644 --- a/gcc/ada/checks.adb +++ b/gcc/ada/checks.adb @@ -6694,8 +6694,9 @@ package body Checks is if (not Inside_Init_Proc or else SPARK_Mode = On) - -- Do not emit the warning within a conditional expression - -- Why not ??? + -- Do not emit the warning within a conditional expression, + -- where the expression might not be evaluated, and the warning + -- appear as extraneous noise. and then not Within_Case_Or_If_Expression (N) then diff --git a/gcc/ada/sem_ch7.adb b/gcc/ada/sem_ch7.adb index 4b6a6e424820..d0d80ba2b212 100644 --- a/gcc/ada/sem_ch7.adb +++ b/gcc/ada/sem_ch7.adb @@ -1812,6 +1812,15 @@ package body Sem_Ch7 is end if; Next_Entity (Prim_Op); + + -- Derived operations appear immediately after the type + -- declaration (or the following subtype indication for + -- a derived scalar type). Further declarations cannot + -- include inherited operations of the type. + + if Present (Prim_Op) then + exit when Ekind (Prim_Op) not in Overloadable_Kind; + end if; end loop; end if; end if;