]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
[Ada] Return when not working for procedures
authorJustin Squirek <squirek@adacore.com>
Fri, 7 May 2021 16:26:09 +0000 (12:26 -0400)
committerPierre-Marie de Rodat <derodat@adacore.com>
Tue, 6 Jul 2021 14:46:54 +0000 (14:46 +0000)
gcc/ada/

* par-ch6.adb (Get_Return_Kind): Properly handle the case of a
"return when" statement in the procedure case.

gcc/ada/par-ch6.adb

index 45a421420cbbe3102ea2dbcbb8ffd4907d0cf17a..23371756bafff7185e6e6e9ac4c27bf89418cc4e 100644 (file)
@@ -1903,6 +1903,11 @@ package body Ch6 is
             end if;
 
             Restore_Scan_State (Scan_State); -- to identifier
+
+         elsif Token = Tok_When then
+            Error_Msg_GNAT_Extension ("return when statement");
+
+            Result := Return_When;
          end if;
 
          return Result;