]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
ada: Fix fallout of latest change
authorEric Botcazou <ebotcazou@adacore.com>
Tue, 25 Mar 2025 23:37:22 +0000 (00:37 +0100)
committerMarc Poulhiès <dkm@gcc.gnu.org>
Tue, 10 Jun 2025 07:32:07 +0000 (09:32 +0200)
Freeze_Static_Object needs to deal with the objects that have been created
by Insert_Conditional_Object_Declaration.

gcc/ada/ChangeLog:

* freeze.adb (Freeze_Static_Object): Do not issue any error message
for compiler-generated entities.

gcc/ada/freeze.adb

index 076d4eead6b969c793d7737089d58565ed3155f4..35f14d64ad3b96088be5457909aa04e6a9c4562d 100644 (file)
@@ -10233,11 +10233,17 @@ package body Freeze is
          --  issue an error message saying that this object cannot be imported
          --  or exported. If it has an address clause it is an overlay in the
          --  current partition and the static requirement is not relevant.
-         --  Do not issue any error message when ignoring rep clauses.
+         --  Do not issue any error message when ignoring rep clauses or for
+         --  compiler-generated entities.
 
          if Ignore_Rep_Clauses then
             null;
 
+         elsif not Comes_From_Source (E) then
+            pragma
+              Assert (Nkind (Parent (Declaration_Node (E))) in N_Case_Statement
+                                                             | N_If_Statement);
+
          elsif Is_Imported (E) then
             if No (Address_Clause (E)) then
                Error_Msg_N