cplusplus / cplusplus/draft

[expr.const] P2686R4 made it less clear that a prvalue constant expression must have an object type CWG3136

Open
#7,551 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

In C++23, it seemed clear to me that a prvalue constant expression was required to have an object type, because N4950 [expr.const] p13 explicitly listed permitted cases for various object types.

However, after P2686R4, [expr.const] p22 doesn't seem to require object types, and void expressions are arguably accepted. At least, a prvalue of an empty class type and a void prvalue don't seem distinguishable.

Should we clarify the wording to say a prvalue constant expression must have an object type, or, conversely, a void expression can be a prvalue constant expression?

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 with the cited [expr.const] paragraphs in N4950 and the current draft, then read P2686R4 and CWG3136. Compare the treatment of empty-class prvalues and void prvalues, and resolve whether the wording should require an object type or permit void; done means an agreed clarification in the standard wording.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
compilers
Issue type
Documentation
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.