From 0700922ea57258870047f210c3569b5deed1bf82 Mon Sep 17 00:00:00 2001 From: Ghjuvan Lacambre Date: Fri, 30 Apr 2021 10:11:25 +0200 Subject: [PATCH] [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. --- gcc/ada/sem_ch6.adb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 -- 2.47.2