C++ Logo


Advanced search

Re: [wg14/wg21 liaison] How to handle conflicting 'unreachable' definitions

From: Jonathan Wakely <cxx_at_[hidden]>
Date: Thu, 4 Apr 2024 17:22:54 +0100
On Thu, 4 Apr 2024 at 17:18, Aaron Ballman via Liaison <
liaison_at_[hidden]> wrote:

> On Thu, Apr 4, 2024 at 12:03 PM Jens Maurer <jens.maurer_at_[hidden]> wrote:
> > Then go forward with whatever you feel you want to do.
> > Personally, I'd expect C++, when it's rebased on C, to say that
> > "unreachable" is never a macro even after #include <stddef.h>,
> > because it jeopardizes the spelling "std::unreachable()", which
> > is the "natural" C++ spelling of the facility.
> Thanks Jens! If this is the direction WG21 is likely to go, that gives
> me the information I need. And the extra background (from you and
> others) helps me navigate the broader situation.
I guarantee it's the direction WG21 will go in. We already forbid masking
macros for atoi etc. so we're not going to want to keep a macro for
unreachable that completely breaks our existing std::unreachable.

We have plenty of precedent, as we already say that alignas, bool and true
and false are not macros, despite them being macros in C17 (I know that the
situation has changed in C23).

Received on 2024-04-04 16:24:16