|
1247 | 1247 | \pnum
|
1248 | 1248 | A defaulted default constructor for class \tcode{X} is defined as deleted if:
|
1249 | 1249 | \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 |
| - |
1259 | 1250 | \item any non-static data member with no default member initializer\iref{class.mem} is
|
1260 | 1251 | of reference type,
|
1261 | 1252 |
|
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} |
1264 | 1256 | is not const-default-constructible\iref{dcl.init},
|
1265 | 1257 |
|
1266 | 1258 | \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), |
1268 | 1260 |
|
1269 | 1261 | \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), |
1271 | 1263 |
|
1272 | 1264 | \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 |
1282 | 1278 | constructor.
|
1283 | 1279 | \end{itemize}
|
1284 | 1280 |
|
|
1543 | 1539 | \tcode{X} is defined as deleted\iref{dcl.fct.def.delete} if \tcode{X} has:
|
1544 | 1540 | \begin{itemize}
|
1545 | 1541 | \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 |
1547 | 1543 | 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 |
1558 | 1552 | constructor, or,
|
1559 | 1553 |
|
1560 | 1554 | \item for the copy constructor, a non-static data member of rvalue reference type.
|
|
1823 | 1817 | A defaulted copy/move assignment operator for
|
1824 | 1818 | class \tcode{X} is defined as deleted if \tcode{X} has:
|
1825 | 1819 | \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 |
| - |
1829 | 1820 | \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 |
1831 | 1822 |
|
1832 | 1823 | \item a non-static data member of reference type, or
|
1833 | 1824 |
|
1834 | 1825 | \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} |
1836 | 1828 | that cannot be copied/moved because overload resolution
|
1837 | 1829 | \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. |
1841 | 1833 | \end{itemize}
|
1842 | 1834 |
|
1843 | 1835 | \begin{note}
|
|
2070 | 2062 | A defaulted destructor for a class
|
2071 | 2063 | \tcode{X} is defined as deleted if:
|
2072 | 2064 | \begin{itemize}
|
2073 |
| -\item \tcode{X} is a union-like class that has a variant |
2074 |
| - member with a non-trivial destructor, |
2075 |
| - |
2076 | 2065 | \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, |
2080 | 2070 |
|
2081 | 2071 | \item or, for a virtual destructor, lookup of the non-array deallocation
|
2082 | 2072 | function results in an ambiguity or in a function that is deleted or
|
|
2489 | 2479 | returning \grammarterm{conversion-type-id}''.
|
2490 | 2480 |
|
2491 | 2481 | \pnum
|
2492 |
| -A conversion function is never used to convert a (possibly cv-qualified) object |
2493 |
| -to the (possibly cv-qualified) same object type (or a reference to it), |
2494 |
| -to a (possibly cv-qualified) base class of that type (or a reference to it), |
| 2482 | +\begin{note} |
| 2483 | +A conversion function is never invoked for |
| 2484 | +implicit or explicit conversions of an object |
| 2485 | +to the same object type (or a reference to it), |
| 2486 | +to a base class of that type (or a reference to it), |
2495 | 2487 | or to \cv{}~\keyword{void}.
|
2496 |
| -\begin{footnote} |
2497 |
| -These conversions are considered |
2498 |
| -as standard conversions for the purposes of overload resolution\iref{over.best.ics,over.ics.ref} and therefore initialization\iref{dcl.init} and explicit casts\iref{expr.static.cast}. A conversion to \keyword{void} does not invoke any conversion function\iref{expr.static.cast}. |
2499 | 2488 | Even though never directly called to perform a conversion,
|
2500 | 2489 | such conversion functions can be declared and can potentially
|
2501 | 2490 | be reached through a call to a virtual conversion function in a base class.
|
2502 |
| -\end{footnote} |
| 2491 | +\end{note} |
2503 | 2492 | \begin{example}
|
2504 | 2493 | \begin{codeblock}
|
2505 | 2494 | struct X {
|
|
0 commit comments