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.

Tested on x86_64-pc-linux-gnu, committed on master.

---
 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 31356a991e0..cd6257ab60c 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);
-- 
2.53.0

Reply via email to