Skip to content

Commit d7aa774

Browse files
authored
Merge 2025-06 CWG Motion 1
P3752R0 Core Language Working Group "ready" Issues for the June, 2025 meeting; excluding issues 3013, 3014 and 3020
2 parents 545c76c + bfa04ab commit d7aa774

File tree

10 files changed

+180
-190
lines changed

10 files changed

+180
-190
lines changed

source/declarations.tex

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6192,9 +6192,10 @@
61926192
``\cvqual{cv1} \tcode{T1}'' by
61936193
user-defined conversion\iref{dcl.init,over.match.copy,over.match.conv};
61946194
the program is ill-formed if the corresponding non-reference
6195-
copy-initialization would be ill-formed. The result of the call to the
6195+
copy-initialization would be ill-formed. The result $E$ of the call to the
61966196
conversion function, as described for the non-reference
6197-
copy-initialization, is then used to direct-initialize the reference.
6197+
copy-initialization, is then used to direct-initialize the reference
6198+
using the form \tcode{($E$)}.
61986199
For this direct-initialization, user-defined conversions are not considered.
61996200
\item
62006201
Otherwise,

source/expressions.tex

Lines changed: 4 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -4384,8 +4384,7 @@
43844384
If \tcode{T} is an lvalue reference type
43854385
or an rvalue reference to function type, the result is an lvalue;
43864386
if \tcode{T} is an rvalue reference to object type, the result is an xvalue;
4387-
otherwise, the result is a prvalue. The \keyword{static_cast} operator shall not cast
4388-
away constness\iref{expr.const.cast}.
4387+
otherwise, the result is a prvalue.
43894388

43904389
\pnum
43914390
\indextext{cast!static!reference}%
@@ -4474,36 +4473,11 @@
44744473
\end{note}
44754474

44764475
\pnum
4477-
Otherwise,
4478-
the inverse of a standard conversion sequence\iref{conv} not containing an
4479-
lvalue-to-rvalue\iref{conv.lval},
4480-
array-to-pointer\iref{conv.array},
4481-
function-to-pointer\iref{conv.func},
4482-
null pointer\iref{conv.ptr}, null member pointer\iref{conv.mem},
4483-
boolean\iref{conv.bool}, or
4484-
function pointer\iref{conv.fctptr}
4485-
conversion, can be performed explicitly using \keyword{static_cast}. A
4486-
program is ill-formed if it uses \keyword{static_cast} to perform the
4487-
inverse of an ill-formed standard conversion sequence.
4488-
\begin{example}
4489-
\begin{codeblock}
4490-
struct B { };
4491-
struct D : private B { };
4492-
void f() {
4493-
static_cast<D*>((B*)0); // error: \tcode{B} is a private base of \tcode{D}
4494-
static_cast<int B::*>((int D::*)0); // error: \tcode{B} is a private base of \tcode{D}
4495-
}
4496-
\end{codeblock}
4497-
\end{example}
4498-
4499-
\pnum
4500-
The lvalue-to-rvalue\iref{conv.lval},
4476+
Otherwise, the lvalue-to-rvalue\iref{conv.lval},
45014477
array-to-pointer\iref{conv.array}, and
45024478
function-to-pointer\iref{conv.func} conversions are applied to the
4503-
operand. Such a \keyword{static_cast} is subject to the restriction that
4504-
the explicit conversion does not cast away
4505-
constness\iref{expr.const.cast}, and the following additional rules
4506-
for specific cases:
4479+
operand, and the conversions that can be performed using \keyword{static_cast} are listed below.
4480+
No other conversion can be performed using \keyword{static_cast}.
45074481

45084482
\pnum
45094483
A value of a scoped enumeration type\iref{dcl.enum}
@@ -4619,9 +4593,6 @@
46194593
\end{codeblock}
46204594
\end{example}
46214595

4622-
\pnum
4623-
No other conversion can be performed using \keyword{static_cast}.
4624-
46254596
\rSec3[expr.reinterpret.cast]{Reinterpret cast}
46264597

46274598
\pnum

source/intro.tex

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,8 @@
7171
Language Specification},
7272
Standard Ecma-262, third edition, 1999.
7373
\item
74-
The Unicode Consortium. \doccite{The Unicode Standard}.
75-
Available from: \url{https://www.unicode.org/versions/latest/}
74+
The Unicode Consortium. \doccite{The Unicode Standard}, Version 15.1.
75+
Available from: \url{https://www.unicode.org/versions/Unicode15.1.0/}
7676
\end{itemize}
7777
\indextext{references!normative|)}
7878

@@ -874,6 +874,11 @@
874874
\ref{implimits} lists some quantities that can be subject to limitations and
875875
a potential minimum supported value for each quantity.
876876

877+
\pnum
878+
A conforming implementation may use an implementation-defined version
879+
of the Unicode Standard that is a later version than the one
880+
referenced in \ref{intro.refs}.
881+
877882
\pnum
878883
A conforming implementation may have extensions (including
879884
additional library functions), provided they do not alter the

source/lex.tex

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -588,16 +588,23 @@
588588
the next preprocessing token is the longest sequence of
589589
characters that could constitute a preprocessing token, even if that
590590
would cause further lexical analysis to fail,
591-
except that a \grammarterm{header-name}\iref{lex.header} is only formed
591+
except that
592592
\begin{itemize}
593593
\item
594-
after the \tcode{include} or \tcode{import} preprocessing token in a
595-
\tcode{\#include}\iref{cpp.include} or
596-
\tcode{import}\iref{cpp.import} directive, or
597-
594+
a \grammarterm{header-name}\iref{lex.header} is only formed
595+
\begin{itemize}
598596
\item
599-
within a \grammarterm{has-include-expression}.
600-
597+
immediately after the \tcode{include}, \tcode{embed}, or \tcode{import} preprocessing token in a
598+
\tcode{\#include}\iref{cpp.include}, \tcode{\#embed}\iref{cpp.embed}, or
599+
\tcode{import}\iref{cpp.import} directive, respectively, or
600+
\item
601+
immediately after a preprocessing token sequence of \xname{has_include}
602+
or \xname{has_embed} immediately followed by \tcode{(}
603+
in a \tcode{\#if}, \tcode{\#elif}, or \tcode{\#embed} directive\iref{cpp.cond,cpp.embed} and
604+
\end{itemize}
605+
\item
606+
a \grammarterm{string-literal} token is never formed
607+
when a \grammarterm{header-name} token can be formed.
601608
\end{itemize}
602609
\end{itemize}
603610

source/overloading.tex

Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2126,24 +2126,13 @@
21262126
defined for the purposes of \ref{over}; the actual initialization is
21272127
defined in terms of constructors and is not a conversion.
21282128
\end{note}
2129-
Any difference in top-level cv-qualification is
2130-
subsumed by the initialization itself and does not constitute a conversion.
2131-
\begin{example}
2132-
A parameter of type
2133-
\tcode{A}
2134-
can be initialized from an argument of type
2135-
\tcode{const A}.
2136-
The implicit conversion sequence for that case is the identity sequence; it
2137-
contains no ``conversion'' from
2138-
\tcode{const A}
2139-
to
2140-
\tcode{A}.
2141-
\end{example}
21422129

21432130
\pnum
2144-
When the parameter has a class type and the argument expression has the
2145-
same type, the implicit conversion sequence is an identity conversion.
2131+
When the cv-unqualified version of the type of the argument expression
2132+
is the same as the parameter type,
2133+
the implicit conversion sequence is an identity conversion.
21462134
When the parameter has a class type and the argument expression has a
2135+
(possibly cv-qualified)
21472136
derived class type, the implicit conversion sequence is a
21482137
derived-to-base
21492138
\indextext{conversion!derived-to-base}%
@@ -2153,6 +2142,14 @@
21532142
There is no such standard conversion; this derived-to-base conversion exists
21542143
only in the description of implicit conversion sequences.
21552144
\end{note}
2145+
\begin{example}
2146+
An implicit conversion sequence from an argument of type \tcode{const A}
2147+
to a parameter of type \tcode{A} can be formed,
2148+
even if overload resolution for copy-initialization of \tcode{A}
2149+
from the argument would not find a viable function\iref{over.match.ctor,over.match.viable}.
2150+
The implicit conversion sequence for that case is the identity sequence; it
2151+
contains no ``conversion'' from \tcode{const A} to \tcode{A}.
2152+
\end{example}
21562153

21572154
\pnum
21582155
When the parameter is the implicit object parameter of a static member function,

0 commit comments

Comments
 (0)