diff options
author | Arnaud Charlet <charlet@gcc.gnu.org> | 2016-05-02 12:30:23 +0200 |
---|---|---|
committer | Arnaud Charlet <charlet@gcc.gnu.org> | 2016-05-02 12:30:23 +0200 |
commit | 89d3b1a13386e9fc4070c54faaf3d29eb96db20d (patch) | |
tree | 271a6c4ee60c778e8e7943ad16864e5140479d17 /gcc/ada/sem_ch12.adb | |
parent | ca90b9623d969a09ff5c54fca968d9cf65160049 (diff) | |
download | gcc-89d3b1a13386e9fc4070c54faaf3d29eb96db20d.zip gcc-89d3b1a13386e9fc4070c54faaf3d29eb96db20d.tar.gz gcc-89d3b1a13386e9fc4070c54faaf3d29eb96db20d.tar.bz2 |
[multiple changes]
2016-05-02 Javier Miranda <miranda@adacore.com>
* exp_util.ads, exp_util.adb (Force_Evaluation): Adding new formal.
(Remove_Side_Effects): Adding a new formal.
* exp_ch6.adb (Expand_Simple_Function_Return): Generating the
call to the _Postconditions procedure ensure that side-effects
are unconditionally removed.
2016-05-02 Ed Schonberg <schonberg@adacore.com>
* sem_ch12.adb (Check_Formal_Package_Instance, Check_Mismatch):
Use original node to determine whether the declaration is for
a formal type declaration, to take into account that formwl
private types are rewritten as private extension declarations
to simplify semantic analysis.
From-SVN: r235742
Diffstat (limited to 'gcc/ada/sem_ch12.adb')
-rw-r--r-- | gcc/ada/sem_ch12.adb | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/gcc/ada/sem_ch12.adb b/gcc/ada/sem_ch12.adb index 04b7fb4..0d8446d 100644 --- a/gcc/ada/sem_ch12.adb +++ b/gcc/ada/sem_ch12.adb @@ -5759,7 +5759,11 @@ package body Sem_Ch12 is -------------------- procedure Check_Mismatch (B : Boolean) is - Kind : constant Node_Kind := Nkind (Parent (E2)); + -- a Formal_Type_Declaration for a derived private type is rewritten + -- as a private extension decl. (see Analyze_Formal_Derived_Type), + -- which is why we examine the original node. + + Kind : constant Node_Kind := Nkind (Original_Node (Parent (E2))); begin if Kind = N_Formal_Type_Declaration then @@ -5923,7 +5927,10 @@ 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_In (Original_Node (Parent (E2)), + N_Formal_Object_Declaration, N_Formal_Type_Declaration) + then goto Next_E; -- Ditto for defaulted formal subprograms. |