From 1471e9804e02567a62b9b0acfb2cdb542ce861a2 Mon Sep 17 00:00:00 2001 From: Eisenwave Date: Sun, 29 Mar 2026 22:37:25 +0200 Subject: [PATCH 1/2] P3598R0 CWG 3158 - `const`-ification of Splice Expressions --- source/expressions.tex | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/source/expressions.tex b/source/expressions.tex index 90c438e6d6..2193e4c6eb 100644 --- a/source/expressions.tex +++ b/source/expressions.tex @@ -3562,7 +3562,7 @@ \end{example} \pnum -For a \grammarterm{splice-expression} of the form \grammarterm{splice-specifier}, +For a \grammarterm{splice-expression} $E$ of the form \grammarterm{splice-specifier}, let $S$ be the construct designated by \grammarterm{splice-specifier}. \begin{itemize} \item @@ -3612,10 +3612,24 @@ Otherwise, if $S$ is a variable or a structured binding, $S$ shall either have static or thread storage duration or shall inhabit a scope enclosing the expression. -The expression is an lvalue referring to the object or function $X$ -associated with or referenced by $S$, -has the same type as that of $S$, and +$E$ is an lvalue referring to the object or function $X$ +associated with or referenced by $S$, and is a bit-field if and only if $X$ is a bit-field. +If $E$ appears in the predicate of a contract assertion C\iref{basic.contract} +and $S$ is +\begin{itemize} +\item +a variable declared outside of $C$ +of object type \tcode{T}, +\item +a variable declared outside of $C$ +of type ``reference to \tcode{T}'', or +\item +a structured binding of type \tcode{T} +whose corresponding variable is declared outside of $C$, +\end{itemize} +then the type of $E$ is \tcode{const T}, +otherwise $E$ has the same type as that of $S$. \begin{note} The type of a \grammarterm{splice-expression} designating a variable or structured binding of reference type From 002cd77adffb4c9b34ba262e2d84f6b2f15fbc5e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20K=C3=B6ppe?= Date: Sun, 12 Apr 2026 11:29:42 +0100 Subject: [PATCH 2/2] [expr.prim.splice] Add introductory words "The expression". This avoids starting a sentence with a symbol. Sentences should start with normal English words. --- source/expressions.tex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/expressions.tex b/source/expressions.tex index 2193e4c6eb..13f2e15671 100644 --- a/source/expressions.tex +++ b/source/expressions.tex @@ -3612,7 +3612,7 @@ Otherwise, if $S$ is a variable or a structured binding, $S$ shall either have static or thread storage duration or shall inhabit a scope enclosing the expression. -$E$ is an lvalue referring to the object or function $X$ +The expression $E$ is an lvalue referring to the object or function $X$ associated with or referenced by $S$, and is a bit-field if and only if $X$ is a bit-field. If $E$ appears in the predicate of a contract assertion C\iref{basic.contract}