From: Ghjuvan Lacambre Date: Fri, 30 Apr 2021 08:11:25 +0000 (+0200) Subject: [Ada] Fix missing error messages when returning limited type X-Git-Tag: basepoints/gcc-13~6285 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0700922ea57258870047f210c3569b5deed1bf82;p=thirdparty%2Fgcc.git [Ada] Fix missing error messages when returning limited type gcc/ada/ * sem_ch6.adb (Check_Limited_Return): Replace Comes_From_Source with Comes_From_Extended_Return_Statement. --- diff --git a/gcc/ada/sem_ch6.adb b/gcc/ada/sem_ch6.adb index ffab332f82d5..3697abaa23bd 100644 --- a/gcc/ada/sem_ch6.adb +++ b/gcc/ada/sem_ch6.adb @@ -7008,7 +7008,8 @@ package body Sem_Ch6 is elsif Is_Limited_Type (R_Type) and then not Is_Interface (R_Type) - and then Comes_From_Source (N) + and then not (Nkind (N) = N_Simple_Return_Statement + and then Comes_From_Extended_Return_Statement (N)) and then not In_Instance_Body and then not OK_For_Limited_Init_In_05 (R_Type, Expr) then