]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
[multiple changes]
authorArnaud Charlet <charlet@gcc.gnu.org>
Fri, 5 Jul 2013 09:43:13 +0000 (11:43 +0200)
committerArnaud Charlet <charlet@gcc.gnu.org>
Fri, 5 Jul 2013 09:43:13 +0000 (11:43 +0200)
2013-07-05  Ed Schonberg  <schonberg@adacore.com>

* sem_ch12.adb (Check_Formal_Package_Instance): Handle properly
a formal subprogram that was defaulted in the formal package.

2013-07-05  Thomas Quinot  <quinot@adacore.com>

* par_sco.adb (Traverse_Declarations_Or_Statements): Ignore
N_Implicit_Label_Declaration nodes.

From-SVN: r200694

gcc/ada/ChangeLog
gcc/ada/par_sco.adb
gcc/ada/sem_ch12.adb

index 7bf4666f39fed72007136e93a95bf194c1e7814c..bc4780dac0ea03d5197105aa1c9de290f8df93ff 100644 (file)
@@ -1,3 +1,13 @@
+2013-07-05  Ed Schonberg  <schonberg@adacore.com>
+
+       * sem_ch12.adb (Check_Formal_Package_Instance): Handle properly
+       a formal subprogram that was defaulted in the formal package.
+
+2013-07-05  Thomas Quinot  <quinot@adacore.com>
+
+       * par_sco.adb (Traverse_Declarations_Or_Statements): Ignore
+       N_Implicit_Label_Declaration nodes.
+
 2013-07-05  Robert Dewar  <dewar@adacore.com>
 
        * a-cfhase.adb, sem_prag.adb, a-cfhama.adb: Minor reformatting.
index 29c2daa89e144597d65a29a1fb440549508f26d9..2b8824cdf0bc2a6b49bb0c2292094b19325c66c3 100644 (file)
@@ -2095,7 +2095,13 @@ package body Par_SCO is
       if Is_Non_Empty_List (L) then
          N := First (L);
          while Present (N) loop
-            Traverse_One (N);
+
+            --  Note: For separate bodies, we see the tree after Par.Labl has
+            --  introduced implicit labels, so we need to ignore those nodes.
+
+            if Nkind (N) /= N_Implicit_Label_Declaration then
+               Traverse_One (N);
+            end if;
             Next (N);
          end loop;
 
index 5713dd4dbd1a7e1fc03abc975242f9e1e26ca918..ed243ce9930c5bfcf7dd9f8c432bd1eb7a2d32cf 100644 (file)
@@ -5220,7 +5220,15 @@ package body Sem_Ch12 is
          --  If the formal entity comes from a formal declaration, it was
          --  defaulted in the formal package, and no check is needed on it.
 
-         elsif Nkind (Parent (E2)) =  N_Formal_Object_Declaration then
+         elsif Nkind (Parent (E2)) = N_Formal_Object_Declaration then
+            goto Next_E;
+
+         --  Ditto for defaulted formal subprograms.
+
+         elsif Is_Overloadable (E1)
+           and then Nkind (Unit_Declaration_Node (E2))
+             in N_Formal_Subprogram_Declaration
+         then
             goto Next_E;
 
          elsif Is_Type (E1) then