[Ada] AI12-0194: Language-defined aspects and entry bodies

Message ID 20200727080552.GA36339@adacore.com
State New
Headers show
Series
  • [Ada] AI12-0194: Language-defined aspects and entry bodies
Related show

Commit Message

Pierre-Marie de Rodat July 27, 2020, 8:05 a.m.
AI12-0194 specifies that language-defined aspects aren't permitted
on entry bodies, which is already effectively enforced by GNAT,
however the error message given when Max_Entry_Queue_Length is applied
to an entry body is potentially confusing, because it says that the
aspect "must apply to a protected entry", and we improve that by
revising it to say "must apply to a protected entry declaration".

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

gcc/ada/

	* sem_prag.adb (Analyze_Pragma, Pragma_Max_Entry_Queue_Length):
	Refine error message to indicate that the pragma must apply to
	an entry declaration, not just an entry.

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
@@ -19452,7 +19452,8 @@  package body Sem_Prag is
             --  Otherwise the pragma is associated with an illegal construct
 
             else
-               Error_Pragma ("pragma % must apply to a protected entry");
+               Error_Pragma
+                 ("pragma % must apply to a protected entry declaration");
                return;
             end if;