These aspects are still not fully implemented, so no test yet

Tested on x86_64-pc-linux-gnu, committed on trunk

2011-08-02  Robert Dewar  <de...@adacore.com>

        * sem_ch13.adb (Analyze_Aspect_Specification): Fix slocs on generated
        pragmas (affects aspects [Component_]Default_Value
        (Check_Aspect_At_Freeze_Point): For Component_Default_Value, use
        component type for the resolution

Index: sem_ch13.adb
===================================================================
--- sem_ch13.adb        (revision 177110)
+++ sem_ch13.adb        (working copy)
@@ -993,7 +993,7 @@
                   Aitem :=
                     Make_Pragma (Loc,
                       Pragma_Argument_Associations => New_List (
-                        New_Occurrence_Of (E, Eloc),
+                        New_Occurrence_Of (E, Loc),
                         Relocate_Node (Expr)),
                       Pragma_Identifier            =>
                         Make_Identifier (Sloc (Id), Chars (Id)));
@@ -1016,7 +1016,7 @@
                   Aitem :=
                     Make_Pragma (Loc,
                       Pragma_Argument_Associations => New_List (
-                        New_Occurrence_Of (E, Eloc),
+                        New_Occurrence_Of (E, Loc),
                         Relocate_Node (Expr)),
                       Pragma_Identifier            =>
                         Make_Identifier (Sloc (Id), Chars (Id)));
@@ -1038,7 +1038,7 @@
                     Make_Pragma (Loc,
                       Pragma_Argument_Associations => New_List (
                         Relocate_Node (Expr),
-                        New_Occurrence_Of (E, Eloc)),
+                        New_Occurrence_Of (E, Loc)),
                       Pragma_Identifier            =>
                         Make_Identifier (Sloc (Id), Chars (Id)),
                       Class_Present                => Class_Present (Aspect));
@@ -5239,13 +5239,16 @@
          when Boolean_Aspects =>
             raise Program_Error;
 
-         --  Default_Value and Default_Component_Value are resolved with
-         --  the entity, which is the type in question.
+         --  Default_Value is resolved with the type entity in question
 
-         when Aspect_Default_Component_Value |
-              Aspect_Default_Value           =>
+         when Aspect_Default_Value =>
             T := Entity (ASN);
 
+         --  Default_Component_Value is resolved with the component type
+
+         when Aspect_Default_Component_Value =>
+            T := Component_Type (Entity (ASN));
+
          --  Aspects corresponding to attribute definition clauses
 
          when Aspect_Address =>

Reply via email to