diff options
author | charlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4> | 2014-02-04 14:28:24 +0000 |
---|---|---|
committer | charlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4> | 2014-02-04 14:28:24 +0000 |
commit | 9a48fc561d3a0e664db9c8954087920a02d06439 (patch) | |
tree | f84c9361ab2c0d9df53e390ceb083f8f202fde01 /gcc/ada/sem_ch13.adb | |
parent | 8c784c07560bd8f4578be9a20e28dc6c559c611d (diff) | |
download | gcc-9a48fc561d3a0e664db9c8954087920a02d06439.tar.gz |
2014-02-04 Robert Dewar <dewar@adacore.com>
* sinfo.ads: Further comments on N_Expression_With_Actions node.
2014-02-04 Hristian Kirtchev <kirtchev@adacore.com>
* sem_prag.adb (Analyze_Refined_Depends_In_Decl_Part): Remove global
variables Out_Items and Ref_Global. Remove local constant
Body_Id along with dummy variables D1, D2, D3, D4, D5, D6, D7
and D8. Remove the useless collection of global items as this
was a leftover from an earlier version of the routine. Move
several routines out to avoid deep nesting and indentation.
(Inputs_Match): Add formal parameter Dep_Clause. Rename formal
parameter Do_Checks to Post_Errors. Update the comment on usage.
(Is_Matching_Input): Renamed to Input_Match. Add formal parameters
Ref_Inputs and Do_Checks. Rename formal parameter Do_Checks
to Post_Errors. Update the comment on usage. Account for the
case where a self referential state may have a null input_list.
(Is_Self_Referential): New routine.
2014-02-04 Ed Schonberg <schonberg@adacore.com>
* sem_ch13.adb (Analyze_Attribute_Definition_Clause): If the
entity renames an expression, as in the case of an object of
an unconstrained type initialized by a function call, defer the
rewriting of the expression to the expander.
* exp_ch13.adb (Expand_N_Attribute_Definition_Clause, case
'Alignment): If the entity renames an expression, introduce
temporary to capture value, and rewrite original declaration to
use temporary.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@207467 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/sem_ch13.adb')
-rw-r--r-- | gcc/ada/sem_ch13.adb | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/gcc/ada/sem_ch13.adb b/gcc/ada/sem_ch13.adb index 6540bbf0400..10fc6da31a7 100644 --- a/gcc/ada/sem_ch13.adb +++ b/gcc/ada/sem_ch13.adb @@ -3526,13 +3526,23 @@ package body Sem_Ch13 is -- expander. The easiest general way to handle this is to create a -- copy of the attribute definition clause for this object. - else + elsif Is_Entity_Name (Renamed_Object (Ent)) then Insert_Action (N, Make_Attribute_Definition_Clause (Loc, Name => New_Occurrence_Of (Entity (Renamed_Object (Ent)), Loc), Chars => Chars (N), Expression => Duplicate_Subexpr (Expression (N)))); + + -- If the renamed object is not an entity, it must be a dereference + -- of an unconstrained function call, and we must introduce a new + -- declaration to capture the expression. This is needed in the case + -- of 'Alignment, where the original declaration must be rewritten. + + else + pragma Assert + (Nkind (Renamed_Object (Ent)) = N_Explicit_Dereference); + null; end if; -- If no underlying entity, use entity itself, applies to some |