From: Viljar Indus <[email protected]>

gcc/ada/ChangeLog:

        * restrict.adb (Check_Restriction_No_Specification_Of_Aspect): add
        Diagnostic_Id for error message.
        (Check_Restriction_No_Use_Of_Attribute): Likewise.
        (Check_Restriction_No_Use_Of_Pragma): Likewise.

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

---
 gcc/ada/restrict.adb | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/gcc/ada/restrict.adb b/gcc/ada/restrict.adb
index d5525d7a374..c66d81817bc 100644
--- a/gcc/ada/restrict.adb
+++ b/gcc/ada/restrict.adb
@@ -651,7 +651,8 @@ package body Restrict is
          Error_Msg_Warn := No_Specification_Of_Aspect_Warning (A_Id);
          Error_Msg_N
            ("<*<violation of restriction `No_Specification_Of_Aspect '='> &`#",
-            Id);
+            Id,
+            Rest_To_Diag_Mappping (No_Specification_Of_Aspect));
       end if;
    end Check_Restriction_No_Specification_Of_Aspect;
 
@@ -697,7 +698,9 @@ package body Restrict is
          Error_Msg_Name_1 := Attr_Nam;
          Error_Msg_Warn   := No_Use_Of_Attribute_Warning (Attr_Id);
          Error_Msg_N
-           ("<*<violation of restriction `No_Use_Of_Attribute '='> %` #", N);
+           ("<*<violation of restriction `No_Use_Of_Attribute '='> %` #",
+            N,
+            Rest_To_Diag_Mappping (Rident.No_Use_Of_Attribute));
       end if;
    end Check_Restriction_No_Use_Of_Attribute;
 
@@ -826,7 +829,9 @@ package body Restrict is
       if Error_Msg_Sloc /= No_Location then
          Error_Msg_Warn := No_Use_Of_Pragma_Warning (P_Id);
          Error_Msg_N
-           ("<*<violation of restriction `No_Use_Of_Pragma '='> &` #", Id);
+           ("<*<violation of restriction `No_Use_Of_Pragma '='> &` #",
+            Id,
+            Rest_To_Diag_Mappping (Rident.No_Use_Of_Pragma));
       end if;
    end Check_Restriction_No_Use_Of_Pragma;
 
-- 
2.53.0

Reply via email to