public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/109323] New: No error when neither of return_value or return_void is defined
@ 2023-03-28 21:52 enricomaria.dean6elis at gmail dot com
  2023-03-28 21:56 ` [Bug c++/109323] " pinskia at gcc dot gnu.org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: enricomaria.dean6elis at gmail dot com @ 2023-03-28 21:52 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109323

            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=95517, but that makes
no reference to the fact that not declaring any of the two functions is
erroneous.

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2024-04-13  2:05 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-28 21:52 [Bug c++/109323] New: No error when neither of return_value or return_void is defined enricomaria.dean6elis at gmail dot com
2023-03-28 21:56 ` [Bug c++/109323] " pinskia at gcc dot gnu.org
2023-03-30 17:49 ` enricomaria.dean6elis at gmail dot com
2023-03-30 18:11 ` enricomaria.dean6elis at gmail dot com
2023-03-30 23:07 ` enricomaria.dean6elis at gmail dot com
2023-03-30 23:07 ` enricomaria.dean6elis at gmail dot com
2024-04-13  2:05 ` pinskia at gcc dot gnu.org

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).