Skip to content

[expr.const] Unmark introduction of "constant expression" as definition#8429

Merged
tkoeppe merged 1 commit into
cplusplus:mainfrom
eisenwave:fix-duplicate-constant-expression
Nov 5, 2025
Merged

[expr.const] Unmark introduction of "constant expression" as definition#8429
tkoeppe merged 1 commit into
cplusplus:mainfrom
eisenwave:fix-duplicate-constant-expression

Conversation

@eisenwave

Copy link
Copy Markdown
Member

Fixes #6589.

As explained in that issue, this definition is a duplicate. It's not actually a definition, it's just falsely marked \defnx. The actual definition can be found below:

draft/source/expressions.tex

Lines 7811 to 7815 in 78635c9

A \defnadj{constant}{expression} is either
a glvalue core constant expression that refers to
an entity that is a permitted result of a constant expression (as defined below), or
a prvalue core constant expression whose value
satisfies the following constraints:

@frederick-vs-ja was concerned that removing definition formatting would drop the requirement that copy elision is not performed. However, that is not the case; https://eel.is/c++draft/class.copy.elision#1.sentence-6 explains that copy elision is not performed in constant expressions. The intro fluff in the first (duplicate) definition in [expr.const] is just repeating that.

@eisenwave

Copy link
Copy Markdown
Member Author

@jensmaurer please have a look. This is bordering on a CWG issue, but I believe it's clearly just a misapplication of \defnx.

@jensmaurer jensmaurer left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed; this is intro fluff and leftover from times when we didn't have the elaborate "core constant expression" / "constant expression" distinction.

@tkoeppe tkoeppe merged commit 6d884ba into cplusplus:main Nov 5, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[expr.const] "Constant expression" is defined twice

3 participants