diff options
author | Ed Schonberg <schonberg@adacore.com> | 2011-08-02 15:17:00 +0000 |
---|---|---|
committer | Arnaud Charlet <charlet@gcc.gnu.org> | 2011-08-02 17:17:00 +0200 |
commit | 6ff6152d5046cab8da2873eb3a95bd85b7074194 (patch) | |
tree | 284c7b6bf8b1bd4eb4254d6f70b9600f3e895f8b /gcc | |
parent | 975c689678295f3c614f55a84a62c49bdd866a6a (diff) | |
download | gcc-6ff6152d5046cab8da2873eb3a95bd85b7074194.zip gcc-6ff6152d5046cab8da2873eb3a95bd85b7074194.tar.gz gcc-6ff6152d5046cab8da2873eb3a95bd85b7074194.tar.bz2 |
sem_aggr.adb (Resolve_Array_Aggregate): when copying the expression in an association...
2011-08-02 Ed Schonberg <schonberg@adacore.com>
* sem_aggr.adb (Resolve_Array_Aggregate): when copying the expression
in an association, set parent field of copy before partial analysis.
* sem_res.adb (Resolve_Slice): create reference to itype only when
expansion is enabled.
From-SVN: r177178
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ada/ChangeLog | 7 | ||||
-rw-r--r-- | gcc/ada/sem_aggr.adb | 5 | ||||
-rw-r--r-- | gcc/ada/sem_res.adb | 5 |
3 files changed, 15 insertions, 2 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index 8777494..1d855df 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,10 @@ +2011-08-02 Ed Schonberg <schonberg@adacore.com> + + * sem_aggr.adb (Resolve_Array_Aggregate): when copying the expression + in an association, set parent field of copy before partial analysis. + * sem_res.adb (Resolve_Slice): create reference to itype only when + expansion is enabled. + 2011-08-02 Yannick Moy <moy@adacore.com> * einfo.adb, einfo.ads (Body_Is_In_ALFA, Set_Body_Is_In_ALFA): get/set diff --git a/gcc/ada/sem_aggr.adb b/gcc/ada/sem_aggr.adb index e704586..59374c2 100644 --- a/gcc/ada/sem_aggr.adb +++ b/gcc/ada/sem_aggr.adb @@ -1974,6 +1974,11 @@ package body Sem_Aggr is begin Expander_Mode_Save_And_Set (False); Full_Analysis := False; + + -- Analyze the expression, making sure it is properly + -- attached to the tree before we do the analysis. + + Set_Parent (Expr, Parent (Expression (Assoc))); Analyze (Expr); -- If the expression is a literal, propagate this info diff --git a/gcc/ada/sem_res.adb b/gcc/ada/sem_res.adb index 6ff32af..84f0327 100644 --- a/gcc/ada/sem_res.adb +++ b/gcc/ada/sem_res.adb @@ -9817,9 +9817,10 @@ package body Sem_Res is -- so that the itype is frozen at the proper place in the tree (i.e. at -- the point where actions for the slice are analyzed). Note that this -- is different from freezing the itype immediately, which might be - -- premature (e.g. if the slice is within a transient scope). + -- premature (e.g. if the slice is within a transient scope). This needs + -- to be done only if expansion is enabled. - else + elsif Expander_Active then Ensure_Defined (Typ => Slice_Subtype, N => N); end if; end Set_Slice_Subtype; |