When a Pre/Post aspect is conflicting with Static aspect, the error
message now says 'aspect "Pre"' or 'aspect "Post"' and not just "this
aspect".

Tested on x86_64-pc-linux-gnu, committed on trunk

gcc/ada/

        * sem_ch13.adb (Analyze_Aspect_Static): Use aspect name in the
        error message.
diff --git a/gcc/ada/sem_ch13.adb b/gcc/ada/sem_ch13.adb
--- a/gcc/ada/sem_ch13.adb
+++ b/gcc/ada/sem_ch13.adb
@@ -2594,8 +2594,9 @@ package body Sem_Ch13 is
 
                   for Asp in Pre_Post_Aspects loop
                      if Has_Aspect (E, Asp) then
+                        Error_Msg_Name_1 := Aspect_Names (Asp);
                         Error_Msg_N
-                          ("this aspect is not allowed for a static "
+                          ("aspect % is not allowed for a static "
                            & "expression function",
                            Find_Aspect (E, Asp));
 


Reply via email to