]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
ada: Fix VAST check on aspect consistency
authorMarc Poulhiès <poulhies@adacore.com>
Tue, 24 Feb 2026 09:03:52 +0000 (10:03 +0100)
committerMarc Poulhiès <dkm@gcc.gnu.org>
Thu, 28 May 2026 08:52:47 +0000 (10:52 +0200)
Currently, N_Attribute_Definition_Clause nodes don't have a
Corresponding_Aspect field. As hinted by a comment, it's something we
would like to do in the future, but adding the check was premature.

gcc/ada/ChangeLog:

* vast.adb (Do_Node_Pass_2): Adjust check for aspect consistency.

gcc/ada/vast.adb

index 31356a991e03926ef94706241dc888447f801614..cd6257ab60ce240c84248f26516c97bd60982d4d 100644 (file)
@@ -632,8 +632,7 @@ package body VAST is
 
       if Nkind (N) in N_Aspect_Specification then
          if Present (Aspect_Rep_Item (N)) then
-            Assert (Nkind (Aspect_Rep_Item (N)) in
-                      N_Pragma | N_Attribute_Definition_Clause,
+            Assert (Nkind (Aspect_Rep_Item (N)) = N_Pragma,
                     Check_Corresponding_Aspect);
             Assert (From_Aspect_Specification (Aspect_Rep_Item (N)),
                     Check_Corresponding_Aspect);
@@ -642,7 +641,7 @@ package body VAST is
          end if;
       end if;
 
-      if Nkind (N) in N_Pragma | N_Attribute_Definition_Clause then
+      if Nkind (N) = N_Pragma then
          Assert
            (From_Aspect_Specification (N) = Present (Corresponding_Aspect (N)),
             Check_Corresponding_Aspect);