]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
[multiple changes]
authorArnaud Charlet <charlet@gcc.gnu.org>
Thu, 11 Apr 2013 10:22:08 +0000 (12:22 +0200)
committerArnaud Charlet <charlet@gcc.gnu.org>
Thu, 11 Apr 2013 10:22:08 +0000 (12:22 +0200)
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

gcc/ada/ChangeLog
gcc/ada/exp_ch4.adb
gcc/ada/sem_prag.adb

index 0ed467beb5e0079655e770c3c19b4fe6f869de1b..3a4a43a21787f6422abc91831dc210ec2c055281 100644 (file)
@@ -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.
index 7fcad755bf9c1be3085eb13d6a55c0bda05bb837..6a392e5de046e63deb2cac0edb75574e8cef5852 100644 (file)
@@ -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,
index 8381837a050798130f3659ed195db57ab2bbe314..132dd0ce2f719c88556b6428db5650c677d35299 100644 (file)
@@ -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",