Created on 2026-08-14.00:00:00 last changed yesterday
Proposed resolution (approved by CWG 2026-09-01):
Change in 15.7.1 [cpp.replace.general] paragraph 14 as follows:
... If thereare sequences of preprocessing tokensis whitespace containing at least one new-line character immediately followed by a directive-introducing token (15.1 [cpp.pre]) within the list of argumentsthat would otherwise act as preprocessing directives,[Footnote: A conditionally-supported-directive is a preprocessing directive regardless of whether the implementation supports it.]the program is ill-formed.
(From submission #975.)
Consider:
#define FOO(...) FOO( #include <iostream> )
This is ill-formed per 15.7.1 [cpp.replace.general] paragraph 14.
... If there are sequences of preprocessing tokens within the list of arguments that would otherwise act as preprocessing directives, [Footnote: ...] the program is ill-formed.
However, what about this:
#define FOO(...) FOO( #if )
According to 15.7.1 [cpp.replace.general] paragraph 14, the closing parenthesis is not part of the analysis for a "preprocessing directive" (note "within"), but 15.1 [cpp.pre] paragraph 2 requires a trailing new-line for some text to be recognized as a preprocessing directive (which is not "within" the arguments here).
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2026-09-03 23:06:47 | admin | set | status: open -> tentatively ready |
| 2026-08-23 09:05:11 | admin | set | messages: + msg8664 |
| 2026-08-14 00:00:00 | admin | create | |