]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
2014-01-29 Ed Schonberg <schonberg@adacore.com>
authorcharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 29 Jan 2014 15:26:18 +0000 (15:26 +0000)
committercharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 29 Jan 2014 15:26:18 +0000 (15:26 +0000)
* 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

gcc/ada/ChangeLog
gcc/ada/checks.adb
gcc/ada/sem_ch7.adb

index c6e15738146fbc7b7f8bfb2877ef098d83280be4..f79ca89b1298dd753b514f8c182d4c456c7888a3 100644 (file)
@@ -1,3 +1,10 @@
+2014-01-29  Ed Schonberg  <schonberg@adacore.com>
+
+       * 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  <gingold@adacore.com>
 
        * exp_ch9.adb (Build_Protected_Entry): Do not call
index 826c09bf11f42e92dd5d63fbdf2df01fc9ddcc4a..872c18a5859b2d7ceee04e63e6c6fa69ad64cb56 100644 (file)
@@ -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
index 4b6a6e424820d3e6e2271e65be2cf1cc1c0e189b..d0d80ba2b21258a89e5368aa0a9fb1026004c4df 100644 (file)
@@ -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;