public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r13-1472] [Ada] Add RM reference to check for functions without a return statement
@ 2022-07-05  8:29 Pierre-Marie de Rodat
  0 siblings, 0 replies; only message in thread
From: Pierre-Marie de Rodat @ 2022-07-05  8:29 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:70bb3298c2b4eaec19490ada47dbc3d7307002af

commit r13-1472-g70bb3298c2b4eaec19490ada47dbc3d7307002af
Author: Piotr Trojanek <trojanek@adacore.com>
Date:   Thu Jun 2 15:16:44 2022 +0200

    [Ada] Add RM reference to check for functions without a return statement
    
    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.

Diff:
---
 gcc/ada/sem_ch6.adb | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/gcc/ada/sem_ch6.adb b/gcc/ada/sem_ch6.adb
index 5a4ba7a9290..05db793a155 100644
--- a/gcc/ada/sem_ch6.adb
+++ b/gcc/ada/sem_ch6.adb
@@ -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);


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-07-05  8:29 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-05  8:29 [gcc r13-1472] [Ada] Add RM reference to check for functions without a return statement Pierre-Marie de Rodat

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).