You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
CWG3125 [cpp.cond] Premature and otherwise redundant requirement for "token"s in #if #813
https://wg21.link/cpp.cond#8 requires that the preprocessing tokens that appear in #if after "all macro replacements have occurred shall be in the lexical form of a token." https://wg21.link/cpp.cond#10 is clear that the macro replacements occur prior to evaluation (including evaluation of has-include-expressions, etc.). This means that the "token" requirement is enforced prior to the formation of header-names from header-name-tokens. Thus the above is ill-formed due to the # preprocessing token; however, that result seems unintended (and only EDG enforces it).
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.
changed the title [-][cpp.cond] Premature and otherwise redundant requirement for "token"s in `#if`[/-][+]CWG3125 [cpp.cond] Premature and otherwise redundant requirement for "token"s in `#if`[/+]on Nov 18, 2025
Activity
jensmaurer commentedon Nov 18, 2025
CWG3125
[-][cpp.cond] Premature and otherwise redundant requirement for "token"s in `#if`[/-][+]CWG3125 [cpp.cond] Premature and otherwise redundant requirement for "token"s in `#if`[/+]