diff options
author | Piotr Trojanek <trojanek@adacore.com> | 2023-03-02 15:09:24 +0100 |
---|---|---|
committer | Marc Poulhiès <poulhies@adacore.com> | 2023-05-25 09:44:15 +0200 |
commit | 5bf5aa1bfdb6c090d9d24dc6835aba0005f68fca (patch) | |
tree | c9517a553bc809ccb916b300e8913225c4411ff1 /gcc/ada | |
parent | fd694822ca6eda8b08fea10fcabdb0ad508a963e (diff) | |
download | gcc-5bf5aa1bfdb6c090d9d24dc6835aba0005f68fca.zip gcc-5bf5aa1bfdb6c090d9d24dc6835aba0005f68fca.tar.gz gcc-5bf5aa1bfdb6c090d9d24dc6835aba0005f68fca.tar.bz2 |
ada: Accept aliased parameters in Exceptional_Cases
Aliased parameters, just like parameters by-reference types, can safely
appear in consequences of Exceptional_Cases aspect.
gcc/ada/
* sem_res.adb (Resolve_Entity_Name): Allow aliased parameters; tune
error message.
Diffstat (limited to 'gcc/ada')
-rw-r--r-- | gcc/ada/sem_res.adb | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/gcc/ada/sem_res.adb b/gcc/ada/sem_res.adb index 4e49a0a..1722868 100644 --- a/gcc/ada/sem_res.adb +++ b/gcc/ada/sem_res.adb @@ -8087,6 +8087,7 @@ package body Sem_Res is and then Within_Exceptional_Cases_Consequence (N) and then not Is_Attribute_Old (Parent (N)) and then not Is_By_Reference_Type (Etype (E)) + and then not Is_Aliased (E) then if Ekind (E) = E_Out_Parameter then Error_Msg_N @@ -8098,7 +8099,7 @@ package body Sem_Res is "in consequence of Exceptional_Cases", N); end if; Error_Msg_N - ("\only parameters of by-reference types are allowed", N); + ("\only parameters passed by reference are allowed", N); end if; -- Check for possible elaboration issues with respect to reads of |