From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 3C1FE3858D39; Tue, 28 Mar 2023 21:52:05 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 3C1FE3858D39 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1680040325; bh=+Aqqf6K6vXiltuxsSYFCoIk4R3gfcqghKALsBpbfG40=; h=From:To:Subject:Date:From; b=RoMplH4qgWNIGTlu/8B3RgAwnvAVPsFm5IEt6TGuumR5aW/o1q44a7UGv93yd1Zhz GK7tIDGBgw9R6u0Fi88ZhV4nyYEVCqS+si6531fDUSiO7/II7J69zx3iRe7PKYh/p7 /cQ+SGNSMTs2QqibuwKBrJ9XYFsavH/eag6symQo= From: "enricomaria.dean6elis at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/109323] New: No error when neither of return_value or return_void is defined Date: Tue, 28 Mar 2023 21:52:04 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Version: 12.2.1 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: enricomaria.dean6elis at gmail dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: 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: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone Message-ID: 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 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D109323 Bug ID: 109323 Summary: No error when neither of return_value or return_void is defined Product: gcc Version: 12.2.1 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: enricomaria.dean6elis at gmail dot com Target Milestone: --- Repro: 1. take the example here -> https://en.cppreference.com/w/cpp/language/coroutines 2. remove the 3 `if (cond) co_return;` from `fibonacci_sequence` 3. remove `return_void` from `promise_type` 4. compile Alternatively: https://godbolt.org/z/v3xd3b7TE, where both GCC and Clang erroneously accept the code, whereas MSVC correcly rejects it. (http://eel.is/c++draft/dcl.fct.def.coroutine#6) I'm aware of https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D95517, but that= makes no reference to the fact that not declaring any of the two functions is erroneous.=