From fd3fa68fbb878ec9bf5224069105fc09e8fe439d Mon Sep 17 00:00:00 2001 From: Arnaud Charlet Date: Fri, 5 Jul 2013 11:43:13 +0200 Subject: [PATCH] [multiple changes] 2013-07-05 Ed Schonberg * sem_ch12.adb (Check_Formal_Package_Instance): Handle properly a formal subprogram that was defaulted in the formal package. 2013-07-05 Thomas Quinot * par_sco.adb (Traverse_Declarations_Or_Statements): Ignore N_Implicit_Label_Declaration nodes. From-SVN: r200694 --- gcc/ada/ChangeLog | 10 ++++++++++ gcc/ada/par_sco.adb | 8 +++++++- gcc/ada/sem_ch12.adb | 10 +++++++++- 3 files changed, 26 insertions(+), 2 deletions(-) diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index 7bf4666f39fe..bc4780dac0ea 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,13 @@ +2013-07-05 Ed Schonberg + + * sem_ch12.adb (Check_Formal_Package_Instance): Handle properly + a formal subprogram that was defaulted in the formal package. + +2013-07-05 Thomas Quinot + + * par_sco.adb (Traverse_Declarations_Or_Statements): Ignore + N_Implicit_Label_Declaration nodes. + 2013-07-05 Robert Dewar * a-cfhase.adb, sem_prag.adb, a-cfhama.adb: Minor reformatting. diff --git a/gcc/ada/par_sco.adb b/gcc/ada/par_sco.adb index 29c2daa89e14..2b8824cdf0bc 100644 --- a/gcc/ada/par_sco.adb +++ b/gcc/ada/par_sco.adb @@ -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; diff --git a/gcc/ada/sem_ch12.adb b/gcc/ada/sem_ch12.adb index 5713dd4dbd1a..ed243ce9930c 100644 --- a/gcc/ada/sem_ch12.adb +++ b/gcc/ada/sem_ch12.adb @@ -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 -- 2.47.2