summaryrefslogtreecommitdiff
path: root/gcc/ada/exp_aggr.adb
diff options
context:
space:
mode:
authorcharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2016-04-20 10:10:32 +0000
committercharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2016-04-20 10:10:32 +0000
commit58e133a606c547ae2a65b3173968c0155124992c (patch)
tree918e410cb893da0e81e3563fff774beb29062ae6 /gcc/ada/exp_aggr.adb
parent0cc3cb0813aa3e5baae6dd76522d6cd1c9b77ac1 (diff)
downloadgcc-58e133a606c547ae2a65b3173968c0155124992c.tar.gz
2016-04-20 Ed Schonberg <schonberg@adacore.com>
* sem_ch13.adb (Rep_Item_Too_Late): Better error message for an illegal aspect that freezes the entity to which it applies. 2016-04-20 Bob Duff <duff@adacore.com> * a-stwibo.ads, a-stzbou.ads ("="): Add overriding keyword before function to avoid crash when compiler is called with -gnatyO (check overriding indicators). 2016-04-20 Ed Schonberg <schonberg@adacore.com> * sem_prag.adb (Analyze_Pragma, case Check_Policy): If this is a configuration pragma and it uses the ARG syntax, insert the rewritten pragma after the current one rather than using Insert_Actions. 2016-04-20 Arnaud Charlet <charlet@adacore.com> * exp_aggr.adb (Backend_Processing_Possible): Add handling of C back-end. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@235253 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/exp_aggr.adb')
-rw-r--r--gcc/ada/exp_aggr.adb13
1 files changed, 13 insertions, 0 deletions
diff --git a/gcc/ada/exp_aggr.adb b/gcc/ada/exp_aggr.adb
index 94f8e0745ec..bd757cd1040 100644
--- a/gcc/ada/exp_aggr.adb
+++ b/gcc/ada/exp_aggr.adb
@@ -545,6 +545,8 @@ package body Exp_Aggr is
-- 10. No controlled actions need to be generated for components
+ -- 11. When generating C code, N must be part of a N_Object_Declaration
+
function Backend_Processing_Possible (N : Node_Id) return Boolean is
Typ : constant Entity_Id := Etype (N);
-- Typ is the correct constrained array subtype of the aggregate
@@ -569,6 +571,17 @@ package body Exp_Aggr is
return False;
end if;
+ -- Checks 11: (part of an object declaration)
+
+ if Generate_C_Code
+ and then Nkind (Parent (N)) /= N_Object_Declaration
+ and then
+ (Nkind (Parent (N)) /= N_Qualified_Expression
+ or else Nkind (Parent (Parent (N))) /= N_Object_Declaration)
+ then
+ return False;
+ end if;
+
-- Checks on components
-- Recurse to check subaggregates, which may appear in qualified