Skip to content

[expr.prim.splice] Const-ify variable-template splice in contract predicate#13

Open
abhinavagarwal07 wants to merge 1 commit into
mainfrom
fix-splice-specialization-contract-const
Open

[expr.prim.splice] Const-ify variable-template splice in contract predicate#13
abhinavagarwal07 wants to merge 1 commit into
mainfrom
fix-splice-specialization-contract-const

Conversation

@abhinavagarwal07

Copy link
Copy Markdown
Owner

P3598R0 added contract-predicate const-ification to [expr.prim.splice] paragraph 2 for splice-specifier expressions designating variables, but not to paragraph 4's template splice-specialization-specifier form. A variable-template specialization accessed via template [:^^var:]<...> is therefore mutable in a contract predicate, while the same object is const via [:^^var<...>:] (paragraph 2) or the id-expression var<...> ([expr.prim.id.unqual] p7). Name the expression E and apply the same const-ification (using U to avoid clashing with the template T) so all forms agree.

…dicate

P3598R0 added contract-predicate const-ification to [expr.prim.splice]
paragraph 2 for splice-specifier expressions designating variables, but
not to paragraph 4's template splice-specialization-specifier form. A
variable-template specialization accessed via template [:^^var:]<...> was
therefore mutable in a contract predicate, while the same object is const
via [:^^var<...>:] or the id-expression var<...>. Name the expression E
and apply the same const-ification (using U to avoid clashing with the
template T) so all forms agree.
@abhinavagarwal07 abhinavagarwal07 force-pushed the fix-splice-specialization-contract-const branch from fed26a0 to 34a9f5d Compare June 17, 2026 16:15
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.

1 participant