sem_ch3.adb (Analyze_Declarations): Correct comments
authorJustin Squirek <squirek@adacore.com>
Mon, 23 Jan 2017 11:31:25 +0000 (11:31 +0000)
committerArnaud Charlet <charlet@gcc.gnu.org>
Mon, 23 Jan 2017 11:31:25 +0000 (12:31 +0100)
2017-01-23  Justin Squirek  <squirek@adacore.com>

* sem_ch3.adb (Analyze_Declarations): Correct comments
* freeze.adb (Find_Constant): Add detection of deferred constants
so they are not incorrectly flagged as premature.

From-SVN: r244785

gcc/ada/ChangeLog
gcc/ada/freeze.adb
gcc/ada/sem_ch3.adb

index 8a676d8..c279bce 100644 (file)
@@ -1,3 +1,9 @@
+2017-01-23  Justin Squirek  <squirek@adacore.com>
+
+       * sem_ch3.adb (Analyze_Declarations): Correct comments
+       * freeze.adb (Find_Constant): Add detection of deferred constants
+       so they are not incorrectly flagged as premature.
+
 2017-01-23  Ed Schonberg  <schonberg@adacore.com>
 
        * scans.ads: New token At_Sign. Remove '@' from list of illegal
index c1dbd33..c8eef9c 100644 (file)
@@ -1356,6 +1356,7 @@ package body Freeze is
                                                          N_Object_Declaration
            and then not Is_Imported (Entity (Nod))
            and then not Has_Completion (Entity (Nod))
+           and then not Is_Frozen (Entity (Nod))
          then
             Error_Msg_NE
               ("premature use of& in call or instance", N, Entity (Nod));
index 9cc64b3..fb42f6a 100644 (file)
@@ -2637,7 +2637,7 @@ package body Sem_Ch3 is
             --  Check for an edge case that may cause premature freezing of a
             --  private type.
 
-            --  If there is an array type which uses a private type from an
+            --  If there is an type which depends on a private type from an
             --  enclosing package that is in the same scope as a non-completing
             --  expression function then we cannot freeze here.