Skip to content

Commit e423e04

Browse files
author
Dawn Perchik
committed
P1286R2 Contra CWG DR1778
Also fixes CWG1778. [dcl.fct.def.default]/2 Remove "and" from previous bullet.
1 parent 6f34b05 commit e423e04

File tree

1 file changed

+16
-2
lines changed

1 file changed

+16
-2
lines changed

source/declarations.tex

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5924,7 +5924,9 @@
59245924
if it were implicitly declared, as follows:
59255925
\begin{itemize}
59265926
\item
5927-
\tcode{T}$_1$ and \tcode{T}$_2$ may have differing \grammarterm{ref-qualifier}{s}; and
5927+
\tcode{T}$_1$ and \tcode{T}$_2$ may have differing \grammarterm{ref-qualifier}{s};
5928+
\item
5929+
\tcode{T}$_1$ and \tcode{T}$_2$ may have differing exception specifications; and
59285930
\item
59295931
if \tcode{T}$_2$ has a parameter of type \tcode{const C\&},
59305932
the corresponding parameter of \tcode{T}$_1$ may be of type \tcode{C\&}.
@@ -5959,12 +5961,24 @@
59595961
constexpr S() = default; // ill-formed: implicit \tcode{S()} is not \tcode{constexpr}
59605962
S(int a = 0) = default; // ill-formed: default argument
59615963
void operator=(const S&) = default; // ill-formed: non-matching return type
5962-
~S() noexcept(false) = default; // deleted: exception specification does not match
5964+
~S() noexcept(false) = default; // OK, despite mismatched exception specification
59635965
private:
59645966
int i;
59655967
S(S&); // OK: private copy constructor
59665968
};
59675969
S::S(S&) = default; // OK: defines copy constructor
5970+
5971+
struct T {
5972+
T();
5973+
T(T &&) noexcept(false);
5974+
};
5975+
struct U {
5976+
T t;
5977+
U();
5978+
U(U &&) noexcept = default;
5979+
};
5980+
U u1;
5981+
U u2 = static_cast<U&&>(u1); // OK, calls \tcode{std::terminate} if \tcode{T::T(T\&\&)} throws
59685982
\end{codeblock}
59695983
\end{example}
59705984

0 commit comments

Comments
 (0)