@@ -6477,7 +6477,16 @@ package body Sem_Prag is
-- Set True if category of assertions referenced by Name enabled
begin
- GNAT_Pragma;
+ -- This could be a rewritten pragma Assert. If it is the case
+ -- then don't check restrictions, because they are different for
+ -- pragma Assert and were already checked.
+
+ if Nkind (Original_Node (N)) /= N_Pragma
+ or else Pragma_Name (Original_Node (N)) /= Name_Assert
+ then
+ GNAT_Pragma;
+ end if;
+
Check_At_Least_N_Arguments (2);
Check_At_Most_N_Arguments (3);
Check_Optional_Identifier (Arg1, Name_Name);
new file mode 100644
@@ -0,0 +1,10 @@
+-- {dg-do compile}
+-- {dg-options -gnat05}
+pragma Restrictions (No_Implementation_Pragmas);
+
+procedure Pragma_Assert is
+ X : Integer;
+begin
+ X := 1;
+ pragma Assert (X = 1);
+end Pragma_Assert;