diff mbox series

[Ada] Remove redundant marking of illegal pragma with error posted

Message ID 20220519141619.GA3723455@adacore.com
State New
Headers show
Series [Ada] Remove redundant marking of illegal pragma with error posted | expand

Commit Message

Pierre-Marie de Rodat May 19, 2022, 2:16 p.m. UTC
We flag illegal pragma Elaborate with a call to Error_Msg on the pragma
argument, which in turn calls Set_Error_Posted on the enclosing
statement, i.e. on the pragma itself. The explicit call to
Set_Error_Posted on the pragma itself was redundant.

Cleanup related to handling of illegal code when detecting uninitialized
scalar objects.

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

gcc/ada/

	* sem_prag.adb (Analyze_Pragma): Remove redundant call to
	Set_Error_Posted.
diff mbox series

Patch

diff --git a/gcc/ada/sem_prag.adb b/gcc/ada/sem_prag.adb
--- a/gcc/ada/sem_prag.adb
+++ b/gcc/ada/sem_prag.adb
@@ -16008,7 +16008,6 @@  package body Sem_Prag is
                end loop Innr;
 
                if Citem = N then
-                  Set_Error_Posted (N);
                   Error_Pragma_Arg
                     ("argument of pragma% is not withed unit", Arg);
                end if;