diff options
author | Eric Botcazou <ebotcazou@adacore.com> | 2024-07-01 10:25:07 +0200 |
---|---|---|
committer | Marc Poulhiès <dkm@gcc.gnu.org> | 2024-08-01 17:14:36 +0200 |
commit | ba95ced3ac03a0034c5a178343f298849cfe3a10 (patch) | |
tree | 5bd7f32e6f60e20725f33f30279b0a23ea4643a5 /gcc/ada/sem_ch6.adb | |
parent | 86bdacb184046b556cbd34522e6f0aa3df368f2d (diff) | |
download | gcc-ba95ced3ac03a0034c5a178343f298849cfe3a10.zip gcc-ba95ced3ac03a0034c5a178343f298849cfe3a10.tar.gz gcc-ba95ced3ac03a0034c5a178343f298849cfe3a10.tar.bz2 |
ada: Define No_Return flag only for subprograms
...instead of defining it for all entities.
gcc/ada/
* einfo.ads (No_Return): Change description and adjust
accordingly.
* gen_il-gen-gen_entities.adb (Entity_Kind): Remove No_Return.
(Subprogram_Kind): Add No_Return.
(Generic_Subprogram_Kind): Likewise.
* sem_ch6.adb (Analyze_Return_Statement): Adjust No_Return test.
Diffstat (limited to 'gcc/ada/sem_ch6.adb')
-rw-r--r-- | gcc/ada/sem_ch6.adb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/gcc/ada/sem_ch6.adb b/gcc/ada/sem_ch6.adb index 852055a..0988fad 100644 --- a/gcc/ada/sem_ch6.adb +++ b/gcc/ada/sem_ch6.adb @@ -1937,8 +1937,8 @@ package body Sem_Ch6 is -- Check that pragma No_Return is obeyed. Don't complain about the -- implicitly-generated return that is placed at the end. - if No_Return (Scope_Id) - and then Kind in E_Procedure | E_Generic_Procedure + if Kind in E_Procedure | E_Generic_Procedure + and then No_Return (Scope_Id) and then Comes_From_Source (N) then Error_Msg_N |