Skip to content

Commit b3e0421

Browse files
committed
CWG1353 Array and variant members and deleted special member functions
1 parent a9cb3a0 commit b3e0421

File tree

1 file changed

+37
-47
lines changed

1 file changed

+37
-47
lines changed

source/classes.tex

Lines changed: 37 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -1247,38 +1247,34 @@
12471247
\pnum
12481248
A defaulted default constructor for class \tcode{X} is defined as deleted if:
12491249
\begin{itemize}
1250-
\item \tcode{X} is a union that has a variant member
1251-
with a non-trivial default constructor and
1252-
no variant member of \tcode{X} has a default member initializer,
1253-
1254-
\item \tcode{X} is a non-union class that has a variant member \tcode{M}
1255-
with a non-trivial default constructor and
1256-
no variant member of the anonymous union containing \tcode{M}
1257-
has a default member initializer,
1258-
12591250
\item any non-static data member with no default member initializer\iref{class.mem} is
12601251
of reference type,
12611252

1262-
\item any non-variant non-static data member of const-qualified type (or array
1263-
thereof) with no \grammarterm{brace-or-equal-initializer}
1253+
\item any non-variant non-static data member of const-qualified type
1254+
(or possibly multi-dimensional array thereof)
1255+
with no \grammarterm{brace-or-equal-initializer}
12641256
is not const-default-constructible\iref{dcl.init},
12651257

12661258
\item \tcode{X} is a union and all of its variant members are of const-qualified
1267-
type (or array thereof),
1259+
type (or possibly multi-dimensional array thereof),
12681260

12691261
\item \tcode{X} is a non-union class and all members of any anonymous union member are
1270-
of const-qualified type (or array thereof),
1262+
of const-qualified type (or possibly multi-dimensional array thereof),
12711263

12721264
\item any potentially constructed subobject, except for a non-static data member
1273-
with a \grammarterm{brace-or-equal-initializer}, has
1274-
class type \tcode{M} (or array thereof) and either \tcode{M}
1275-
has no default constructor or overload resolution\iref{over.match}
1276-
as applied to find \tcode{M}'s corresponding
1277-
constructor results in an ambiguity or in a function that is deleted or
1278-
inaccessible from the defaulted default constructor, or
1279-
1280-
\item any potentially constructed subobject has a type
1281-
with a destructor that is deleted or inaccessible from the defaulted default
1265+
with a \grammarterm{brace-or-equal-initializer}
1266+
or a variant member of a union where another non-static data member
1267+
has a \grammarterm{brace-or-equal-initializer},
1268+
has class type \tcode{M} (or possibly multi-dimensional array thereof)
1269+
and overload resolution\iref{over.match}
1270+
as applied to find \tcode{M}'s corresponding constructor
1271+
either does not result in a usable candidate\iref{over.match.general}
1272+
or, in the case of a variant member, selects a non-trivial function, or
1273+
1274+
\item any potentially constructed subobject has
1275+
class type \tcode{M} (or possibly multi-dimensional array thereof) and
1276+
\tcode{M} has
1277+
a destructor that is deleted or inaccessible from the defaulted default
12821278
constructor.
12831279
\end{itemize}
12841280

@@ -1543,18 +1539,16 @@
15431539
\tcode{X} is defined as deleted\iref{dcl.fct.def.delete} if \tcode{X} has:
15441540
\begin{itemize}
15451541
\item a potentially constructed subobject of type
1546-
\tcode{M} (or array thereof) that cannot be copied/moved because
1542+
\tcode{M} (or possibly multi-dimensional array thereof) for which
15471543
overload resolution\iref{over.match}, as applied to find
1548-
\tcode{M}'s
1549-
corresponding constructor, results in an ambiguity or
1550-
a function that is deleted or inaccessible from the
1551-
defaulted constructor,
1552-
1553-
\item a variant member whose corresponding constructor
1554-
as selected by overload resolution is non-trivial,
1555-
1556-
\item any potentially constructed subobject of a type
1557-
with a destructor that is deleted or inaccessible from the defaulted
1544+
\tcode{M}'s corresponding constructor,
1545+
either does not result in a usable candidate\iref{over.match.general} or,
1546+
in the case of a variant member, selects a non-trivial function,
1547+
1548+
\item any potentially constructed subobject of
1549+
class type \tcode{M} (or possibly multi-dimensional array thereof)
1550+
where \tcode{M} has
1551+
a destructor that is deleted or inaccessible from the defaulted
15581552
constructor, or,
15591553

15601554
\item for the copy constructor, a non-static data member of rvalue reference type.
@@ -1823,21 +1817,19 @@
18231817
A defaulted copy/move assignment operator for
18241818
class \tcode{X} is defined as deleted if \tcode{X} has:
18251819
\begin{itemize}
1826-
\item a variant member with a non-trivial corresponding assignment operator and
1827-
\tcode{X} is a union-like class, or
1828-
18291820
\item a non-static data member of \keyword{const} non-class
1830-
type (or array thereof), or
1821+
type (or possibly multi-dimensional array thereof), or
18311822

18321823
\item a non-static data member of reference type, or
18331824

18341825
\item a direct non-static data member of class type \tcode{M}
1835-
(or array thereof) or a direct base class \tcode{M}
1826+
(or possibly multi-dimensional array thereof) or
1827+
a direct base class \tcode{M}
18361828
that cannot be copied/moved because overload resolution
18371829
\iref{over.match}, as applied to find \tcode{M}'s corresponding
1838-
assignment operator, results in an ambiguity or
1839-
a function that is deleted or inaccessible from the
1840-
defaulted assignment operator.
1830+
assignment operator,
1831+
either does not result in a usable candidate\iref{over.match.general} or,
1832+
in the case of a variant member, selects a non-trivial function.
18411833
\end{itemize}
18421834

18431835
\begin{note}
@@ -2070,13 +2062,11 @@
20702062
A defaulted destructor for a class
20712063
\tcode{X} is defined as deleted if:
20722064
\begin{itemize}
2073-
\item \tcode{X} is a union-like class that has a variant
2074-
member with a non-trivial destructor,
2075-
20762065
\item any potentially constructed subobject has class type
2077-
\tcode{M} (or array thereof) and
2078-
\tcode{M} has a deleted destructor or a destructor
2079-
that is inaccessible from the defaulted destructor,
2066+
\tcode{M} (or possibly multi-dimensional array thereof) and
2067+
\tcode{M} has a destructor that is deleted or
2068+
is inaccessible from the defaulted destructor or,
2069+
in the case of a variant member, is non-trivial,
20802070

20812071
\item or, for a virtual destructor, lookup of the non-array deallocation
20822072
function results in an ambiguity or in a function that is deleted or

0 commit comments

Comments
 (0)