cplusplus / cplusplus/draft

[cpp.concat] p3 Is a placemarker preprocessing token considered as a valid preporcessing token

Open
#5,629 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TeX
Stars
221
Forks
813
Avg merge
16h 4m
Merged PRs (30d)
36

Description

[cpp.concat] p3 says

If the result is not a valid preprocessing token, the behavior is undefined.

#define concat(X,Y) X##Y
concat(,)   // #1

The result of concat(,) is a single placemarker preprocessing token(result from the concatenation of two placemarker preprocessing tokens).

[lex.pptoken] specifies all normative preprocessing tokens, which does not mention placemarker preprocessing token. The note also says that:

Placemarker preprocessing tokens do not appear in the syntax because they are temporary entities that exist only within translation phase 4.

It is unclear whether the "valid preprocessing token" refers to the preprocessing tokens defined in [lex.pptoken] or refers to the tokens in [lex.pptoken] and the placemarker preprocessing token. Presumably, it refers to the latter. Furhtermore, the text "preprocessing token" in [cpp] intends to include the syntax preprocessing tokens and the placemarker preprocessing token.

[cpp.concat] p3 may be clearer if it is changed to

If the result is not a valid preprocessing token(include placemarker preprocessing token), the behavior is undefined.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading [cpp.concat] p3 alongside [lex.pptoken] and its note on placemarker preprocessing tokens. Check whether the standard consistently uses “preprocessing token” to include placemarkers, then determine wording that resolves the ambiguity. Done means an agreed clarification in the relevant standard-draft text.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
documentation
Issue type
Documentation
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.