[COMMITTED] ada: Fix error message for Aggregate aspect

Message ID 20230525080611.1957303-1-poulhies@adacore.com
State Unresolved
Headers
Series [COMMITTED] ada: Fix error message for Aggregate aspect |

Checks

Context Check Description
snail/gcc-patch-check warning Git am fail log

Commit Message

Marc Poulhiès May 25, 2023, 8:06 a.m. UTC
  The error message was wrongly using % instead of & in the format string,
causing the displayed message to refer to incorrect names in some cases.

gcc/ada/

	* sem_ch13.adb (Check_Aspect_At_Freeze_Point): fix format string,
	use existing local Ident.

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

---
 gcc/ada/sem_ch13.adb | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
  

Patch

diff --git a/gcc/ada/sem_ch13.adb b/gcc/ada/sem_ch13.adb
index 6f9fe738ddd..593e6f8c169 100644
--- a/gcc/ada/sem_ch13.adb
+++ b/gcc/ada/sem_ch13.adb
@@ -11224,8 +11224,8 @@  package body Sem_Ch13 is
          when Aspect_Aggregate =>
             if Is_Array_Type (Entity (ASN)) then
                Error_Msg_N
-                 ("aspect% can only be applied to non-array type",
-                  Identifier (ASN));
+                 ("aspect& can only be applied to non-array type",
+                  Ident);
             end if;
             Resolve_Aspect_Aggregate (Entity (ASN), Expression (ASN));
             return;