This exposes __builtin_unreachable as the expansion for the unreachable macro in C2x. I added this definition under __need_STDDEF_H_misc on the assumption there is no need for a separate need macro to control adding this.
jyknight efriedma erichkeane
- Group Reviewers
- rGa9797d7d2d78: [C2x] Implement the `unreachable` macro for WG14 N2826
Is this REALLY required to be a macro by standard? Is it so they don't have to steal the word/can do #undef? This is going to result in a worse diagnostic here any time we diagnose on this line.
Yes, it's required to be a macro by the C standard. According to my personal notes:
This led us up to a preference poll, does WG14 prefer the syntax variant over the macro variant in N2826? 3/12/5 (no consensus). Does WG14 prefer to put the macro into <stddef.h> as in N2826 in C23? 11/2/7 (consensus). Does WG14 want to adopt the unreachable feature Change 5 & 6 with stddef.h in place of HEADER.h into C23? 13/2/6 (consensus).
I don't think the diagnostic behavior here will be any different than for offsetof (defined a few lines below), right?
offsetof is what made me ask this question :D I guess we do the whole 'macro-like' escape in other places, but everything here is already crap, so I guess this is no different.