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.
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;