diff options
author | Ghjuvan Lacambre <lacambre@adacore.com> | 2020-08-14 11:34:06 +0200 |
---|---|---|
committer | Pierre-Marie de Rodat <derodat@adacore.com> | 2020-10-22 08:11:20 -0400 |
commit | 1019e23137b0e05c0cae1959ded69cba9466f3b5 (patch) | |
tree | b566a2e0647e7a47f455d79c442b84a003be0269 /gcc/ada | |
parent | 8be08b9b67df52d90280f3b1314dc038943ffa3f (diff) | |
download | gcc-1019e23137b0e05c0cae1959ded69cba9466f3b5.zip gcc-1019e23137b0e05c0cae1959ded69cba9466f3b5.tar.gz gcc-1019e23137b0e05c0cae1959ded69cba9466f3b5.tar.bz2 |
[Ada] Fix error message for import aspect
gcc/ada/
* sem_prag.adb (Process_Convention,
Process_Import_Or_Interface): Fix error message.
Diffstat (limited to 'gcc/ada')
-rw-r--r-- | gcc/ada/sem_prag.adb | 24 |
1 files changed, 18 insertions, 6 deletions
diff --git a/gcc/ada/sem_prag.adb b/gcc/ada/sem_prag.adb index ba86723..4c7131a 100644 --- a/gcc/ada/sem_prag.adb +++ b/gcc/ada/sem_prag.adb @@ -8270,8 +8270,13 @@ package body Sem_Prag is -- Accept Intrinsic Export on types if Relaxed_RM_Semantics if not (Is_Type (E) and then Relaxed_RM_Semantics) then - Error_Pragma_Arg - ("second argument of pragma% must be a subprogram", Arg2); + if From_Aspect_Specification (N) then + Error_Pragma_Arg + ("entity for aspect% must be a subprogram", Arg2); + else + Error_Pragma_Arg + ("second argument of pragma% must be a subprogram", Arg2); + end if; end if; -- Special checks for C_Variadic_n @@ -9543,10 +9548,17 @@ package body Sem_Prag is Process_Import_Predefined_Type; else - Error_Pragma_Arg - ("second argument of pragma% must be object, subprogram " - & "or incomplete type", - Arg2); + if From_Aspect_Specification (N) then + Error_Pragma_Arg + ("entity for aspect% must be object, subprogram " + & "or incomplete type", + Arg2); + else + Error_Pragma_Arg + ("second argument of pragma% must be object, subprogram " + & "or incomplete type", + Arg2); + end if; end if; -- If this pragma applies to a compilation unit, then the unit, which |