https://gcc.gnu.org/g:ea770aa878d68e7da43f47c84078c9a5327cc4d9

commit r17-868-gea770aa878d68e7da43f47c84078c9a5327cc4d9
Author: Marc Poulhiès <[email protected]>
Date:   Tue Feb 24 10:03:52 2026 +0100

    ada: Fix VAST check on aspect consistency
    
    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.

Diff:
---
 gcc/ada/vast.adb | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/gcc/ada/vast.adb b/gcc/ada/vast.adb
index 31356a991e03..cd6257ab60ce 100644
--- a/gcc/ada/vast.adb
+++ b/gcc/ada/vast.adb
@@ -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);

Reply via email to