diff options
author | Eric Botcazou <ebotcazou@adacore.com> | 2024-11-13 09:42:01 +0100 |
---|---|---|
committer | Marc Poulhiès <dkm@gcc.gnu.org> | 2024-11-26 10:49:36 +0100 |
commit | e14ec5681e780626f59ef7b37d0648c2d6992a14 (patch) | |
tree | 802c0c11ba5e6a78e49979f331eaf470c9ca3b54 /gcc/fortran/trans-expr.cc | |
parent | 38b977cc077d055be9730b6476043d666864c832 (diff) | |
download | gcc-e14ec5681e780626f59ef7b37d0648c2d6992a14.zip gcc-e14ec5681e780626f59ef7b37d0648c2d6992a14.tar.gz gcc-e14ec5681e780626f59ef7b37d0648c2d6992a14.tar.bz2 |
ada: Minor adjustments to error message for RM B.1(24)
The RM B.1(24) sub-clause says that imported entities cannot be initialized
and it is checked in three contexts, aspect Import, pragma Import and pragma
Import_Object, with slightly different error messages. Moreover, for the
aspect, the error is given twice because that of the pragma is also given.
In addition, if the initialization expression is an aggregate that is not
static, the error is given only for the aspect and not for the two pragmas.
This change aligns the error messages on that of pragma Import and plugs the
aforementioned loophole for the two pragmas.
gcc/ada/ChangeLog:
* sem_ch13.adb (Analyze_Aspect_Export_Import): Add explicit mention
of the declaration in the error message for the Import.
* sem_prag.adb (Process_Extended_Import_Export_Object_Pragma): Also
test Has_Init_Expression on the declaration node for Import_Object
and use the same wording as that of Import.
(Process_Import_Or_Interface): Also test Has_Init_Expression on the
declaration node for Import.
Diffstat (limited to 'gcc/fortran/trans-expr.cc')
0 files changed, 0 insertions, 0 deletions