sem_ch6.adb: sem_ch6.adb (Set_Actual_Subtypes): If the type has a dynamic predicate...
authorEd Schonberg <schonberg@adacore.com>
Mon, 27 Jan 2014 16:55:30 +0000 (16:55 +0000)
committerArnaud Charlet <charlet@gcc.gnu.org>
Mon, 27 Jan 2014 16:55:30 +0000 (17:55 +0100)
2014-01-27  Ed Schonberg  <schonberg@adacore.com>

* sem_ch6.adb: sem_ch6.adb (Set_Actual_Subtypes): If the type
has a dynamic predicate, generate freeze node for Actual_Subtype
at once, because the declaration of the corresponding predicate
function will make reference to it.

From-SVN: r207145

gcc/ada/ChangeLog
gcc/ada/sem_ch6.adb

index 0873ba4..a57ac28 100644 (file)
@@ -1,3 +1,10 @@
+2014-01-27  Ed Schonberg  <schonberg@adacore.com>
+
+       * sem_ch6.adb: sem_ch6.adb (Set_Actual_Subtypes): If the type
+       has a dynamic predicate, generate freeze node for Actual_Subtype
+       at once, because the declaration of the corresponding predicate
+       function will make reference to it.
+
 2014-01-27  Tristan Gingold  <gingold@adacore.com>
 
        * exp_ch7.adb, exp_ch9.adb: Adjust comments.
index eea7ea5..715ca24 100644 (file)
@@ -11491,6 +11491,13 @@ package body Sem_Ch6 is
             if Present (First_Stmt) then
                Insert_List_Before_And_Analyze (First_Stmt,
                  Freeze_Entity (Defining_Identifier (Decl), N));
+
+            --  Ditto if the type has a dynamic predicate, because the
+            --  generated function will mention the actual subtype.
+
+            elsif Has_Dynamic_Predicate_Aspect (T) then
+               Insert_List_Before_And_Analyze (Decl,
+                 Freeze_Entity (Defining_Identifier (Decl), N));
             end if;
 
             if Nkind (N) = N_Accept_Statement