]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
ada: Detect only conflict with synomyms of max queue length
authorJose Ruiz <ruiz@adacore.com>
Thu, 7 Mar 2024 18:16:18 +0000 (19:16 +0100)
committerMarc Poulhiès <poulhies@adacore.com>
Mon, 20 May 2024 07:47:03 +0000 (09:47 +0200)
Use of duplicated representation aspect is detected elsewhere
so we do not try to detect them here to avoid repetition of
messages.

gcc/ada/

* sem_prag.adb (Analyze_Pragma): Exclude detection of duplicates
because they are detected elsewhere.

gcc/ada/sem_prag.adb

index 0e2ce9de4b53f5c85b93bbc572a020276e8052f5..a895fd2053ac2681f772022e28f5339953ba1edf 100644 (file)
@@ -20388,15 +20388,23 @@ package body Sem_Prag is
                  ("pragma % must apply to a protected entry declaration");
             end if;
 
-            --  Check for duplicates
+            --  Check for conflicting use of synonyms. Note that we exclude
+            --  the detection of duplicates here because they are detected
+            --  elsewhere.
 
-            if Has_Rep_Pragma (Entry_Id, Name_Max_Entry_Queue_Length)
+            if (Has_Rep_Pragma (Entry_Id, Name_Max_Entry_Queue_Length)
+                  and then
+                Prag_Id /= Pragma_Max_Entry_Queue_Length)
                  or else
-               Has_Rep_Pragma (Entry_Id, Name_Max_Entry_Queue_Depth)
+               (Has_Rep_Pragma (Entry_Id, Name_Max_Entry_Queue_Depth)
+                  and then
+                Prag_Id /= Pragma_Max_Entry_Queue_Depth)
                  or else
-               Has_Rep_Pragma (Entry_Id, Name_Max_Queue_Length)
+               (Has_Rep_Pragma (Entry_Id, Name_Max_Queue_Length)
+                  and then
+                Prag_Id /= Pragma_Max_Queue_Length)
             then
-               Error_Msg_N ("??duplicate Max_Entry_Queue_Length pragma", N);
+               Error_Msg_N ("??maximum entry queue length already set", N);
             end if;
 
             --  Mark the pragma as Ghost if the related subprogram is also