On Thu, 28 Apr 2022 at 18:52, Jens Maurer wrote:
I see some more UB in [cpp] which wasn't covered by those NB comments.
[cpp.cond] p7 says "The identifiers __has_include and __has_cpp_attribute shall not appear in any context not mentioned in this subclause."
IIUC failing to meet that requirement produces UB, even though it doesn't say the words "undefined behaviour".
And similarly for p8, which says "Each preprocessing token that remains (in the list of preprocessing tokens that will become the controlling
expression) after all macro replacements have occurred shall be in the lexical form of a token".
Are these covered by any of the new issues?
The reason I started looking at this is that I was asked about this case:
#if 0
Can't be tokenized.
#endif