From d8d7e809d6c6ce977e188f99e104097b5ece31d8 Mon Sep 17 00:00:00 2001 From: Arnaud Charlet Date: Thu, 20 Nov 2014 15:24:21 +0100 Subject: [multiple changes] 2014-11-20 Bob Duff * debug.adb: Minor comment fix. 2014-11-20 Arnaud Charlet * a-ciorma.adb: Minor update: move pragma Annotate up. * a-cfdlli.adb: Skip codepeer analysis on this body. 2014-11-20 Robert Dewar * sem_prag.adb (Analyze_Pragma, case No_Elaboration_Code_All): Allow use of this pragma with generic unit (package or subprogram). * gnat_rm.texi: Clarify that pragma No_Elaboration_Code_All can be applied to generics. 2014-11-20 Ed Schonberg * sem_aggr.adb (Valid_Limited_Ancestor): Ancestor part of extension aggregate can itself be an extension aggregate, as well as a call that is rewritten as a reference. 2014-11-20 Eric Botcazou * inline.adb (Add_Inlined_Subprogram): Insert all programs generated as a body or whose declaration was provided along with the body. 2014-11-20 Javier Miranda * sem.adb (Semantics): Disable expansion if we are compiling a separate unit under configurable runtime. By default separate units are compiled with expansion disabled but under configurable runtime we enable the expansion to get error messages about missing entities. From-SVN: r217855 --- gcc/ada/sem_aggr.adb | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'gcc/ada/sem_aggr.adb') diff --git a/gcc/ada/sem_aggr.adb b/gcc/ada/sem_aggr.adb index 654f413..82d6ce0 100644 --- a/gcc/ada/sem_aggr.adb +++ b/gcc/ada/sem_aggr.adb @@ -2663,12 +2663,19 @@ package body Sem_Aggr is function Valid_Limited_Ancestor (Anc : Node_Id) return Boolean is begin - if Is_Entity_Name (Anc) - and then Is_Type (Entity (Anc)) + if Is_Entity_Name (Anc) and then Is_Type (Entity (Anc)) then + return True; + + -- The ancestor must be a call or an aggregate, but a call may + -- have been expanded into a temporary, so check original node. + + elsif Nkind_In (Anc, N_Aggregate, + N_Extension_Aggregate, + N_Function_Call) then return True; - elsif Nkind_In (Anc, N_Aggregate, N_Function_Call) then + elsif Nkind (Original_Node (Anc)) = N_Function_Call then return True; elsif Nkind (Anc) = N_Attribute_Reference -- cgit v1.1