diff options
author | Arnaud Charlet <charlet@gcc.gnu.org> | 2013-04-11 12:22:08 +0200 |
---|---|---|
committer | Arnaud Charlet <charlet@gcc.gnu.org> | 2013-04-11 12:22:08 +0200 |
commit | 294f5d825fc452692fda912a5ede6945c91f8ecd (patch) | |
tree | c0e6b0e3069277d1b2f862c1b38cf59c86e53a34 /gcc | |
parent | 533369aac04c1abe91f846bff95a6f17633d97ac (diff) | |
download | gcc-294f5d825fc452692fda912a5ede6945c91f8ecd.zip gcc-294f5d825fc452692fda912a5ede6945c91f8ecd.tar.gz gcc-294f5d825fc452692fda912a5ede6945c91f8ecd.tar.bz2 |
[multiple changes]
2013-04-11 Hristian Kirtchev <kirtchev@adacore.com>
* exp_ch4.adb (Process_Transient_Object): Use
an unchecked conversion when associating a transient controlled
object with its "hook".
2013-04-11 Ed Schonberg <schonberg@adacore.com>
* sem_prag.adb (Analyze_Pragma, case
Preelaborable_Initialization): The pragma is legal if it comes
from an aspect on the private view of the type, even though its
analysis point takes place later at the freeze point.
From-SVN: r197760
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ada/ChangeLog | 13 | ||||
-rw-r--r-- | gcc/ada/exp_ch4.adb | 5 | ||||
-rw-r--r-- | gcc/ada/sem_prag.adb | 20 |
3 files changed, 32 insertions, 6 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index 0ed467b..3a4a43a 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,16 @@ +2013-04-11 Hristian Kirtchev <kirtchev@adacore.com> + + * exp_ch4.adb (Process_Transient_Object): Use + an unchecked conversion when associating a transient controlled + object with its "hook". + +2013-04-11 Ed Schonberg <schonberg@adacore.com> + + * sem_prag.adb (Analyze_Pragma, case + Preelaborable_Initialization): The pragma is legal if it comes + from an aspect on the private view of the type, even though its + analysis point takes place later at the freeze point. + 2013-04-11 Robert Dewar <dewar@adacore.com> * sem_ch6.adb: Minor reformatting. diff --git a/gcc/ada/exp_ch4.adb b/gcc/ada/exp_ch4.adb index 7fcad75..6a392e5 100644 --- a/gcc/ada/exp_ch4.adb +++ b/gcc/ada/exp_ch4.adb @@ -5246,7 +5246,10 @@ package body Exp_Ch4 is -- Step 3: Hook the transient object to the temporary if Is_Access_Type (Obj_Typ) then - Expr := Convert_To (Ptr_Id, New_Reference_To (Obj_Id, Loc)); + + -- Why is this an unchecked conversion ??? + Expr := + Unchecked_Convert_To (Ptr_Id, New_Reference_To (Obj_Id, Loc)); else Expr := Make_Attribute_Reference (Loc, diff --git a/gcc/ada/sem_prag.adb b/gcc/ada/sem_prag.adb index 8381837..132dd0c 100644 --- a/gcc/ada/sem_prag.adb +++ b/gcc/ada/sem_prag.adb @@ -13423,12 +13423,22 @@ package body Sem_Prag is Check_First_Subtype (Arg1); Ent := Entity (Get_Pragma_Arg (Arg1)); - if not (Is_Private_Type (Ent) - or else - Is_Protected_Type (Ent) - or else - (Is_Generic_Type (Ent) and then Is_Derived_Type (Ent))) + -- The pragma may come from an aspect on a private declaration, + -- even if the freeze point at which this is analyzed in the + -- private part after the full view. + + if Has_Private_Declaration (Ent) + and then From_Aspect_Specification (N) + then + null; + + elsif Is_Private_Type (Ent) + or else Is_Protected_Type (Ent) + or else (Is_Generic_Type (Ent) and then Is_Derived_Type (Ent)) then + null; + + else Error_Pragma_Arg ("pragma % can only be applied to private, formal derived or " & "protected type", |