Skip to content
Open
Show file tree
Hide file tree
Changes from 3 commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
6a0d0a8
CWG2228 Ambiguity resolution for cast to function type
burblebee Jun 18, 2026
7b45088
CWG2684 thread_local dynamic initialization
burblebee Jun 18, 2026
35bd150
CWG2756 Completion of initialization by delegating constructor
burblebee Jun 18, 2026
18509cb
CWG2974 Non-deduced context for qualified-id naming a template
burblebee Jun 18, 2026
357eefe
CWG3023 Default arguments in list-initialization
burblebee Jun 18, 2026
374d475
CWG3027 Equivalence of pack-index-specifiers
burblebee Jun 18, 2026
6d33ee4
CWG3046 Enumerations as part of the common initial sequence
burblebee Jun 18, 2026
56c2d45
CWG3146 Usual arithmetic conversions for enumerations are different in C
burblebee Jun 18, 2026
ac3b7da
CWG3159 Instantiation of variables with incomplete array types
burblebee Jun 18, 2026
ca50c07
CWG3164 Location of specification of __STDCPP_FLOAT16_T__ macro
burblebee Jun 18, 2026
9a12e4e
CWG3166 Protected access rule for a pointer-to-member from a reflect-…
burblebee Jun 18, 2026
a75baee
CWG3167 Initializing typedefs
burblebee Jun 18, 2026
d83cbc5
CWG3168 Issues with integer conversion ranks
burblebee Jun 18, 2026
7a2061f
CWG3176 Sequencing default arguments during constant evaluation
burblebee Jun 18, 2026
7d40e91
CWG3177 Formation of a header-name preprocessing token
burblebee Jun 18, 2026
55ad142
CWG3179 More edge cases for a void function parameter
burblebee Jun 18, 2026
f3d8110
CWG3182 Notional template parameters introduced for an array parameter
burblebee Jun 18, 2026
6fa7c42
CWG3183 No expressions in an expression-list
burblebee Jun 18, 2026
34acac9
CWG3184 Pointer arithmetic with similar types
burblebee Jun 18, 2026
0e16e87
CWG3186 Argument-dependent lookup is for a name
burblebee Jun 18, 2026
e81f5f6
CWG3188 Behavior change for class template argument deduction
burblebee Jun 18, 2026
48b4ced
CWG3190 Ambiguous lookup for type aliases in reflection
burblebee Jun 18, 2026
1811796
FIXUP CWG2756: Remove space in \iref
burblebee Jun 26, 2026
7e6312d
FIXUP CWG3164: Add missing commas
burblebee Jun 26, 2026
9167350
FIXUP CWG3179: Remove blank line; add missing \pnum
burblebee Jun 26, 2026
84d81b2
FIXUP CWG3190: Remove blank lines around \item
burblebee Jun 26, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion source/basic.tex
Original file line number Diff line number Diff line change
Expand Up @@ -3942,7 +3942,7 @@
\item storage with the proper alignment and size
for type \tcode{T} is obtained, and
\item its initialization (if any) is complete
(including vacuous initialization)\iref{dcl.init},
(including vacuous initialization)\iref{dcl.init, class.base.init},
Comment thread
jensmaurer marked this conversation as resolved.
Outdated
\end{itemize}
except that if the object is a union member or subobject thereof,
its lifetime only begins if that union member is the
Expand Down Expand Up @@ -7618,6 +7618,7 @@
the initialization associated with the entity for thread \placeholder{t}
is sequenced before the first non-initialization odr-use by \placeholder{t}
of any non-inline variable with thread storage duration
and dynamic initialization
defined in the same translation unit as the variable to be initialized.
It is \impldef{threads and program points at which deferred dynamic initialization is performed}
in which threads and at which points in the program such deferred dynamic initialization occurs.
Expand Down
16 changes: 13 additions & 3 deletions source/classes.tex
Original file line number Diff line number Diff line change
Expand Up @@ -5621,8 +5621,6 @@
class, thus its constructors never initialize virtual base classes, therefore the
corresponding \grammarterm{mem-initializer}{s} can be omitted.
\end{note}
An attempt to initialize more than one non-static data member of a union renders the
program ill-formed.
\indextext{initialization!const member}%
\indextext{initialization!reference member}%
\begin{note}
Expand Down Expand Up @@ -5658,6 +5656,18 @@
\end{codeblock}
\end{example}

\pnum
An attempt to initialize more than one non-static data member of a union renders the
program ill-formed.

\pnum
An object's initialization is considered complete when
a non-delegating constructor for that object returns.
\begin{note}
Therefore, an object's lifetime can begin\iref{basic.life}
before all delegating constructors have completed.
\end{note}

\pnum
If a given non-static data member has both a default member initializer
and a \grammarterm{mem-initializer}, the initialization specified by the
Expand Down Expand Up @@ -6073,7 +6083,7 @@
\end{example}

\pnum
During the construction of an object,
During the initialization of an object,
if the value of any of its subobjects
or any element of its object representation
is accessed through a glvalue that is not obtained, directly or indirectly, from
Expand Down
72 changes: 48 additions & 24 deletions source/declarations.tex
Original file line number Diff line number Diff line change
Expand Up @@ -1911,9 +1911,9 @@
A placeholder type can also be used
in the \grammarterm{type-specifier-seq} of
the \grammarterm{new-type-id} or
in the \grammarterm{type-id} of a
in the \grammarterm{nofun-type-id} of a
\grammarterm{new-expression}\iref{expr.new}.
In such a \grammarterm{type-id},
In such a \grammarterm{nofun-type-id},
the placeholder type shall appear
as one of the \grammarterm{type-specifier}{s} in
the \grammarterm{type-specifier-seq} or
Expand Down Expand Up @@ -2288,7 +2288,7 @@
A placeholder for a deduced class type
can also be used
in the \grammarterm{type-specifier-seq}
in the \grammarterm{new-type-id} or \grammarterm{type-id}
in the \grammarterm{new-type-id} or \grammarterm{nofun-type-id}
of a \grammarterm{new-expression}\iref{expr.new},
as the \grammarterm{simple-type-specifier}
in an explicit type conversion (functional notation)\iref{expr.type.conv},
Expand Down Expand Up @@ -2529,7 +2529,7 @@

\begin{bnf}
\nontermdef{trailing-return-type}\br
\terminal{->} type-id
\terminal{->} nofun-type-id
\end{bnf}

\begin{bnf}
Expand Down Expand Up @@ -2567,20 +2567,40 @@

\pnum
\indextext{type name}%
To specify type conversions explicitly,
\indextext{operator!cast}%
and as an argument of
\tcode{sizeof},
\tcode{alignof},
\keyword{new},
or
\tcode{typeid},
the name of a type shall be specified.
This can be done with a
\grammarterm{type-id} or \grammarterm{new-type-id}\iref{expr.new},
which is syntactically a declaration for a variable or function
A type can be named with a
\grammarterm{type-id},
\grammarterm{nofun-type-id}, or
\grammarterm{new-type-id}\iref{expr.new},
each of
which is syntactically a declaration for a variable or
(only for a \grammarterm{type-id}) function
of that type that omits the name of the entity.

\begin{bnf}
\nontermdef{nofun-type-id}\br
type-specifier-seq \opt{nofun-declarator}
\end{bnf}

\begin{bnf}
\nontermdef{nofun-declarator}\br
ptr-nofun-declarator\br
noptr-nofun-declarator parameters-and-qualifiers trailing-return-type
\end{bnf}

\begin{bnf}
\nontermdef{ptr-nofun-declarator}\br
noptr-nofun-declarator\br
ptr-operator \opt{ptr-nofun-declarator}
\end{bnf}

\begin{bnf}
\nontermdef{noptr-nofun-declarator}\br
noptr-nofun-declarator parameters-and-qualifiers\br
\opt{noptr-nofun-declarator} \terminal{[} \opt{constant-expression} \terminal{]} \opt{attribute-specifier-seq}\br
\terminal{(} ptr-nofun-declarator \terminal{)}
\end{bnf}

\begin{bnf}
\nontermdef{type-id}\br
type-specifier-seq \opt{abstract-declarator}
Expand Down Expand Up @@ -2625,6 +2645,7 @@

It is possible to identify uniquely the location in the
\grammarterm{abstract-declarator}
or \grammarterm{nofun-declarator}
where the identifier would appear if the construction were a declarator
in a declaration.
The named type is then the same as the type of the
Expand Down Expand Up @@ -2716,6 +2737,10 @@
\grammarterm{type-id}
in its syntactic context shall be considered a
\grammarterm{type-id}.
\begin{note}
No such ambiguity can arise between an expression and
a \grammarterm{nofun-type-id}.
\end{note}
However, a construct that can syntactically be a \grammarterm{type-id}
whose outermost \grammarterm{abstract-declarator}
would match the grammar of an \grammarterm{abstract-declarator}
Expand All @@ -2731,19 +2756,18 @@
Y<int(1)> d; // expression

void foo(signed char a) {
sizeof(int()); // \grammarterm{type-id} (ill-formed)
sizeof(int()); // expression
sizeof(int(a)); // expression
sizeof(int(unsigned(a))); // \grammarterm{type-id} (ill-formed)

(int())+1; // \grammarterm{type-id} (ill-formed)
sizeof(int(unsigned(a))); // expression
(int())+1; // expression
(int(a))+1; // expression
(int(unsigned(a)))+1; // \grammarterm{type-id} (ill-formed)
(int(unsigned(a)))+1; // expression
}

typedef struct BB { int C[2]; } *B, C;
void g() {
sizeof(B()->C[1]); // OK, \tcode{\keyword{sizeof}(}expression\tcode{)}
sizeof(auto()->C[1]); // error: \keyword{sizeof} of a function returning an array
sizeof(auto()->C[1]); // error: ill-formed expression
}
\end{codeblock}
\end{example}
Expand Down Expand Up @@ -9405,7 +9429,7 @@

\begin{bnf}
\nontermdef{alignment-specifier}\br
\keyword{alignas} \terminal{(} type-id \opt{\terminal{...}} \terminal{)}\br
\keyword{alignas} \terminal{(} nofun-type-id \opt{\terminal{...}} \terminal{)}\br
\keyword{alignas} \terminal{(} constant-expression \opt{\terminal{...}} \terminal{)}
\end{bnf}

Expand Down Expand Up @@ -9637,8 +9661,8 @@

\pnum
An \grammarterm{alignment-specifier} of the form
\tcode{alignas(} \grammarterm{type-id} \tcode{)} has the same
effect as \tcode{alignas(\brk{}alignof(} \grammarterm{type-id}~\tcode{))}\iref{expr.alignof}.
\tcode{alignas(} \grammarterm{nofun-type-id} \tcode{)} has the same
effect as \tcode{alignas(alignof(} \grammarterm{nofun-type-id}~\tcode{))}\iref{expr.alignof}.

\pnum
The alignment requirement of an entity is the strictest nonzero alignment
Expand Down
24 changes: 12 additions & 12 deletions source/expressions.tex
Original file line number Diff line number Diff line change
Expand Up @@ -5226,9 +5226,9 @@
\terminal{--} cast-expression\br
await-expression\br
\keyword{sizeof} unary-expression\br
\keyword{sizeof} \terminal{(} type-id \terminal{)}\br
\keyword{sizeof} \terminal{(} nofun-type-id \terminal{)}\br
\keyword{sizeof} \terminal{...} \terminal{(} identifier \terminal{)}\br
\keyword{alignof} \terminal{(} type-id \terminal{)}\br
\keyword{alignof} \terminal{(} nofun-type-id \terminal{)}\br
noexcept-expression\br
new-expression\br
delete-expression\br
Expand Down Expand Up @@ -5656,7 +5656,7 @@
occupied by a non-potentially-overlapping object of the type
of its operand. The operand is either an expression,
which is an unevaluated operand\iref{term.unevaluated.operand}, or a parenthesized
\grammarterm{type-id}.
\grammarterm{nofun-type-id}.
\indextext{type!incomplete}%
The \keyword{sizeof} operator shall not be applied to an expression that
has function or incomplete type,
Expand Down Expand Up @@ -5747,7 +5747,7 @@
\indextext{\idxcode{alignof}}%
\indextext{expression!\idxcode{alignof}}%
An \keyword{alignof} expression yields the alignment requirement
of its operand type. The operand shall be a \grammarterm{type-id}
of its operand type. The operand shall be a \grammarterm{nofun-type-id}
representing a complete object type, or an array thereof, or a reference
to one of those types.

Expand Down Expand Up @@ -5805,7 +5805,7 @@
\indextext{storage management|see{\tcode{delete}}}%
\indextext{\idxcode{new}}%
The \grammarterm{new-expression} attempts to create an object of the
\grammarterm{type-id} or \grammarterm{new-type-id}\iref{dcl.name} to which
\grammarterm{nofun-type-id} or \grammarterm{new-type-id}\iref{dcl.name} to which
it is applied. The type of that object is the \defnadj{allocated}{type}.
\indextext{type!incomplete}%
This type shall be a complete object type\iref{term.incomplete.type},
Expand All @@ -5816,14 +5816,14 @@
\grammarterm{new-expression}{s}.
\end{note}
\begin{note}
The \grammarterm{type-id} can be a cv-qualified type, in which case the
The \grammarterm{nofun-type-id} can be a cv-qualified type, in which case the
object created by the \grammarterm{new-expression} has a cv-qualified type.
\end{note}

\begin{bnf}
\nontermdef{new-expression}\br
\opt{\terminal{::}} \keyword{new} \opt{new-placement} new-type-id \opt{new-initializer} \br
\opt{\terminal{::}} \keyword{new} \opt{new-placement} \terminal{(} type-id \terminal{)} \opt{new-initializer}
\opt{\terminal{::}} \keyword{new} \opt{new-placement} \terminal{(} nofun-type-id \terminal{)} \opt{new-initializer}
\end{bnf}

\indextext{\idxcode{new}!storage allocation}%
Expand Down Expand Up @@ -5861,12 +5861,12 @@
a placeholder for a deduced class type\iref{dcl.type.class.deduct}
appears in the
\grammarterm{type-specifier-seq} of a \grammarterm{new-type-id} or
\grammarterm{type-id} of a \grammarterm{new-expression},
\grammarterm{nofun-type-id} of a \grammarterm{new-expression},
the allocated type is deduced as follows:
Let
\placeholder{init} be the \grammarterm{new-initializer}, if any,
and
\tcode{T} be the \grammarterm{new-type-id} or \grammarterm{type-id} of
\tcode{T} be the \grammarterm{new-type-id} or \grammarterm{nofun-type-id} of
the \grammarterm{new-expression}, then the allocated type is the type
deduced for the variable \tcode{x} in the invented
declaration\iref{dcl.spec.auto}:
Expand Down Expand Up @@ -5953,7 +5953,7 @@
\end{example}

\pnum
If the \grammarterm{type-id} or \grammarterm{new-type-id}
If the \grammarterm{nofun-type-id} or \grammarterm{new-type-id}
denotes an array type of unknown bound\iref{dcl.array},
the \grammarterm{new-initializer} shall not be omitted;
the allocated object is an array with \tcode{n} elements,
Expand Down Expand Up @@ -6053,7 +6053,7 @@
\indextext{array!\idxcode{new}}%
When the allocated type is ``array of \tcode{N} \tcode{T}''
(that is, the \grammarterm{noptr-new-declarator} syntax is used or the
\grammarterm{new-type-id} or \grammarterm{type-id} denotes an array type),
\grammarterm{new-type-id} or \grammarterm{nofun-type-id} denotes an array type),
the \grammarterm{new-expression} yields a prvalue of type ``pointer to \tcode{T}''
that points to the initial element (if any) of the array.
Otherwise, let \tcode{T} be the allocated type;
Expand Down Expand Up @@ -6996,7 +6996,7 @@
\begin{bnf}
\nontermdef{cast-expression}\br
unary-expression\br
\terminal{(} type-id \terminal{)} cast-expression
\terminal{(} nofun-type-id \terminal{)} cast-expression
\end{bnf}

\pnum
Expand Down
17 changes: 10 additions & 7 deletions source/templates.tex
Original file line number Diff line number Diff line change
Expand Up @@ -5834,6 +5834,7 @@
Expressions of the following forms are type-dependent only if the type
specified by the
\grammarterm{type-id},
\grammarterm{nofun-type-id},
\grammarterm{simple-type-specifier},
\grammarterm{typename-specifier},
or
Expand All @@ -5846,12 +5847,12 @@
typename-specifier \terminal{(} \opt{expression-list} \terminal{)}\br
typename-specifier braced-init-list\br
\opt{\terminal{::}} \keyword{new} \opt{new-placement} new-type-id \opt{new-initializer}\br
\opt{\terminal{::}} \keyword{new} \opt{new-placement} \terminal{(} type-id \terminal{)} \opt{new-initializer}\br
\opt{\terminal{::}} \keyword{new} \opt{new-placement} \terminal{(} nofun-type-id \terminal{)} \opt{new-initializer}\br
\keyword{dynamic_cast} \terminal{<} type-id \terminal{>} \terminal{(} expression \terminal{)}\br
\keyword{static_cast} \terminal{<} type-id \terminal{>} \terminal{(} expression \terminal{)}\br
\keyword{const_cast} \terminal{<} type-id \terminal{>} \terminal{(} expression \terminal{)}\br
\keyword{reinterpret_cast} \terminal{<} type-id \terminal{>} \terminal{(} expression \terminal{)}\br
\terminal{(} type-id \terminal{)} cast-expression
\terminal{(} nofun-type-id \terminal{)} cast-expression
\end{ncsimplebnf}

\pnum
Expand All @@ -5861,9 +5862,9 @@
\begin{ncsimplebnf}
literal\br
\keyword{sizeof} unary-expression\br
\keyword{sizeof} \terminal{(} type-id \terminal{)}\br
\keyword{sizeof} \terminal{(} nofun-type-id \terminal{)}\br
\keyword{sizeof} \terminal{...} \terminal{(} identifier \terminal{)}\br
\keyword{alignof} \terminal{(} type-id \terminal{)}\br
\keyword{alignof} \terminal{(} nofun-type-id \terminal{)}\br
\keyword{typeid} \terminal{(} expression \terminal{)}\br
\keyword{typeid} \terminal{(} type-id \terminal{)}\br
\opt{\terminal{::}} \keyword{delete} cast-expression\br
Expand Down Expand Up @@ -5967,14 +5968,15 @@
\grammarterm{unary-expression} or \grammarterm{expression}
is type-dependent or the
\grammarterm{type-id}
or \grammarterm{nofun-type-id}
is dependent:

\begin{ncsimplebnf}
\keyword{sizeof} unary-expression\br
\keyword{sizeof} \terminal{(} type-id \terminal{)}\br
\keyword{sizeof} \terminal{(} nofun-type-id \terminal{)}\br
\keyword{typeid} \terminal{(} expression \terminal{)}\br
\keyword{typeid} \terminal{(} type-id \terminal{)}\br
\keyword{alignof} \terminal{(} type-id \terminal{)}
\keyword{alignof} \terminal{(} nofun-type-id \terminal{)}
\end{ncsimplebnf}

\begin{note}
Expand All @@ -5985,6 +5987,7 @@
\pnum
Expressions of the following form are value-dependent if either the
\grammarterm{type-id},
\grammarterm{nofun-type-id},
\grammarterm{simple-type-specifier}, or
\grammarterm{typename-specifier}
is dependent or the
Expand All @@ -6006,7 +6009,7 @@
\keyword{const_cast} \terminal{<} type-id \terminal{>} \terminal{(} expression \terminal{)}\br
\keyword{reinterpret_cast} \terminal{<} type-id \terminal{>} \terminal{(} expression \terminal{)}\br
\keyword{dynamic_cast} \terminal{<} type-id \terminal{>} \terminal{(} expression \terminal{)}\br
\terminal{(} type-id \terminal{)} cast-expression
\terminal{(} nofun-type-id \terminal{)} cast-expression
\end{ncsimplebnf}

\pnum
Expand Down