diff options
author | Eric Botcazou <ebotcazou@adacore.com> | 2024-07-15 22:29:06 +0200 |
---|---|---|
committer | Marc Poulhiès <dkm@gcc.gnu.org> | 2024-08-02 09:08:09 +0200 |
commit | 5f3902ed1d9c7686fa7bad1e24f0c2b40fd35efe (patch) | |
tree | cb32bd2aac9921fc822f5836b50474bcefab87fa | |
parent | 54acd24d5f82766e7ad43a41519b00369ae46863 (diff) | |
download | gcc-5f3902ed1d9c7686fa7bad1e24f0c2b40fd35efe.zip gcc-5f3902ed1d9c7686fa7bad1e24f0c2b40fd35efe.tar.gz gcc-5f3902ed1d9c7686fa7bad1e24f0c2b40fd35efe.tar.bz2 |
ada: Plug loophole in handling of No_Raise pragma
Unlike the aspect, the pragma needs to be propagated explicitly from a
generic subprogram to its instances.
gcc/ada/
* sem_ch12.adb (Analyze_Subprogram_Instantiation): Propagate the
No_Raise flag like the No_Return flag.
-rw-r--r-- | gcc/ada/sem_ch12.adb | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/gcc/ada/sem_ch12.adb b/gcc/ada/sem_ch12.adb index 6b98343..25821cb 100644 --- a/gcc/ada/sem_ch12.adb +++ b/gcc/ada/sem_ch12.adb @@ -6069,9 +6069,16 @@ package body Sem_Ch12 is Set_Has_Pragma_No_Inline (Anon_Id, Has_Pragma_No_Inline (Gen_Unit)); - -- Propagate No_Return if pragma applied to generic unit. This must - -- be done explicitly because pragma does not appear in generic - -- declaration (unlike the aspect case). + -- Propagate No_Raise if pragma applied to generic unit. This must + -- be done explicitly because the pragma does not appear in generic + -- declarations (unlike the aspect). + + if No_Raise (Gen_Unit) then + Set_No_Raise (Act_Decl_Id); + Set_No_Raise (Anon_Id); + end if; + + -- Likewise for No_Return if No_Return (Gen_Unit) then Set_No_Return (Act_Decl_Id); |