Skip to content

Commit 11b0144

Browse files
eisenwavetkoeppe
authored andcommitted
CWG3089 const-default-constructible improperly handles std::meta::info
Fixes NB US 39-076 (C++26 CD).
1 parent 0078561 commit 11b0144

File tree

1 file changed

+19
-13
lines changed

1 file changed

+19
-13
lines changed

source/declarations.tex

Lines changed: 19 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5092,32 +5092,38 @@
50925092
\end{itemize}
50935093

50945094
\pnum
5095-
A class type \tcode{T} is \defn{const-default-constructible} if
5095+
A type \cv{}~\tcode{T} is \defn{const-default-constructible} if
5096+
\begin{itemize}
5097+
\item
5098+
\tcode{T} is \tcode{std::meta::info};
5099+
\item
5100+
\tcode{T} is \tcode{std::nullptr_t};
5101+
\item
50965102
default-initialization of \tcode{T} would invoke
5097-
a user-provided constructor of \tcode{T} (not inherited from a base class)
5098-
or if
5103+
a user-provided constructor of \tcode{T} (not inherited from a base class);
5104+
\item
5105+
\tcode{T} is a class type where
50995106
\begin{itemize}
51005107
\item
5101-
each direct non-variant non-static data member \tcode{M} of \tcode{T}
5102-
has a default member initializer
5103-
or, if \tcode{M} is of class type \tcode{X} (or array thereof),
5104-
\tcode{X} is const-default-constructible,
5108+
each direct non-variant non-static data member of \tcode{T}
5109+
has a default member initializer or
5110+
is of const-default-constructible type,
51055111
\item
51065112
if \tcode{T} is a union with at least one non-static data member,
51075113
exactly one variant member has a default member initializer,
51085114
\item
51095115
if \tcode{T} is not a union,
5110-
for each anonymous union member with at least one non-static data member (if any),
5111-
exactly one non-static data member has a default member initializer, and
5116+
the type of each anonymous union member is const-default-constructible, and
5117+
\item
5118+
each potentially constructed base class of \tcode{T} is const-default-constructible; or
5119+
\end{itemize}
51125120
\item
5113-
each potentially constructed base class of \tcode{T} is const-default-constructible.
5121+
\tcode{T} is an array of const-default-constructible type.
51145122
\end{itemize}
51155123

51165124
If a program calls for the default-initialization of an object of a
51175125
const-qualified type \tcode{T},
5118-
\tcode{T} shall be \tcode{std::meta::\linebreak info}
5119-
or a const-default-constructible class type,
5120-
or array thereof.
5126+
\tcode{T} shall be a const-default-constructible type.
51215127

51225128
\pnum
51235129
To

0 commit comments

Comments
 (0)