Created on 2025-11-18.00:00:00 last changed 7 days ago
Proposed resolution (approved by CWG 2025-12-05):
Change in 15.2 [cpp.cond] paragraph 8 as follows:
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 (5.10 [lex.token]).
(From submission #813.)
Consider:
#define F(X) X #if __has_include(F(<#.h>)) #endif
This is ill-formed per 15.2 [cpp.cond] paragraph 8, even though the # preprocessing token will eventually be used to form a header-name and thus will not be converted into a token per 15.2 [cpp.cond] paragraph 11. The latter is governed by 5.5 [lex.pptoken] paragraph 2.
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2025-12-05 21:43:30 | admin | set | status: open -> tentatively ready |
| 2025-11-18 21:59:36 | admin | set | messages: + msg8394 |
| 2025-11-18 00:00:00 | admin | create | |