]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
[Ada] Add RM reference to check for functions without a return statement
authorPiotr Trojanek <trojanek@adacore.com>
Thu, 2 Jun 2022 13:16:44 +0000 (15:16 +0200)
committerPierre-Marie de Rodat <derodat@adacore.com>
Tue, 5 Jul 2022 08:28:17 +0000 (08:28 +0000)
Add comment to explain why we have an error and not just a warning.

gcc/ada/

* sem_ch6.adb (Check_Missing_Return): Add reference to an RM rule.

gcc/ada/sem_ch6.adb

index 5a4ba7a9290966ce56dc49671299b3fe63d9babe..05db793a155e5beb5411d32bba2859ea3c55cf4c 100644 (file)
@@ -3568,6 +3568,10 @@ package body Sem_Ch6 is
                Id := Body_Id;
             end if;
 
+            --  A function body shall contain at least one return statement
+            --  that applies to the function body, unless the function contains
+            --  code_statements; RM 6.5(5).
+
             if Return_Present (Id) then
                Check_Returns (HSS, 'F', Missing_Ret);