From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id D1D6B384B0C0; Sun, 26 Apr 2020 07:29:40 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D1D6B384B0C0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1587886180; bh=Y+aLnAg+a7HRnxKCZR0HjEDRVxMuWuscC1Xs8t/cvko=; h=From:To:Subject:Date:In-Reply-To:References:From; b=pk1/ujWjF5Iz9lsAb4qvTRHkTt+LPGjQU4xRfrCe4fEaAmcREpluA81Xfa1l7Zaiu fg/tJwZBLZ6A1fDTMeqway65WaIPhhpb2ecygtBfH01gY8QOqKBCZSF6oMOgLW+i0P Sq+Ngj3Rp2jqkK4bAFTG9VQi/3fd0bioDzI3U5I0= From: "redi at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/94768] Wreturn-type should be error, not warning Date: Sun, 26 Apr 2020 07:29:40 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Version: 10.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: redi at gcc dot gnu.org X-Bugzilla-Status: RESOLVED X-Bugzilla-Resolution: INVALID X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: resolution bug_status Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Apr 2020 07:29:40 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D94768 Jonathan Wakely changed: What |Removed |Added ---------------------------------------------------------------------------- Resolution|--- |INVALID Status|UNCONFIRMED |RESOLVED --- Comment #1 from Jonathan Wakely --- (In reply to David Binderman from comment #0) > IMHO, for a C++ function returning non-void, a complete absence of any > return statement in the function really should produce an error. This is a valid C++ program and it would be non-conforming to reject it. The compiler can't even assume the program has undefined behaviour, because g(i= nt) could throw an exception, or do something that terminates, or simply never return (e.g. go into an infinite loops with side effects like I/O).=