[Bug c++/109867] -Wswitch-default reports missing default in coroutine

arsen at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Tue Jul 16 19:18:11 GMT 2024


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

Arsen Arsenović <arsen at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
                 CC|                            |arsen at gcc dot gnu.org
     Ever confirmed|0                           |1
   Last reconfirmed|                            |2024-07-16

--- Comment #2 from Arsen Arsenović <arsen at gcc dot gnu.org> ---
this corresponds to the four switches emitted for the coroutine implementation
after morphing these fns into coroutine functions.  the other cases are
unreachable except by corruption of the frame, perhaps we should emit calls to
either __builtin_unreachable or (IMO, better) some diagnostic hook (perhaps the
best of both worlds by emitting a call to a UBsan hook or somesuch).

anyway, the diagnostic is unactionable by the user and hence bad anyway


More information about the Gcc-bugs mailing list