Skip to content

Commit fb99e64

Browse files
authored
Merge 2019-02 CWG Motion 3
P1286R2 Contra CWG DR1778 Fixes #2683.
2 parents 0b326cd + 11fbbe7 commit fb99e64

File tree

1 file changed

+16
-2
lines changed

1 file changed

+16
-2
lines changed

source/declarations.tex

+16-2
Original file line numberDiff line numberDiff line change
@@ -5926,7 +5926,9 @@
59265926
if it were implicitly declared, as follows:
59275927
\begin{itemize}
59285928
\item
5929-
\tcode{T}$_1$ and \tcode{T}$_2$ may have differing \grammarterm{ref-qualifier}{s}; and
5929+
\tcode{T}$_1$ and \tcode{T}$_2$ may have differing \grammarterm{ref-qualifier}{s};
5930+
\item
5931+
\tcode{T}$_1$ and \tcode{T}$_2$ may have differing exception specifications; and
59305932
\item
59315933
if \tcode{T}$_2$ has a parameter of type \tcode{const C\&},
59325934
the corresponding parameter of \tcode{T}$_1$ may be of type \tcode{C\&}.
@@ -5961,12 +5963,24 @@
59615963
constexpr S() = default; // ill-formed: implicit \tcode{S()} is not \tcode{constexpr}
59625964
S(int a = 0) = default; // ill-formed: default argument
59635965
void operator=(const S&) = default; // ill-formed: non-matching return type
5964-
~S() noexcept(false) = default; // deleted: exception specification does not match
5966+
~S() noexcept(false) = default; // OK, despite mismatched exception specification
59655967
private:
59665968
int i;
59675969
S(S&); // OK: private copy constructor
59685970
};
59695971
S::S(S&) = default; // OK: defines copy constructor
5972+
5973+
struct T {
5974+
T();
5975+
T(T &&) noexcept(false);
5976+
};
5977+
struct U {
5978+
T t;
5979+
U();
5980+
U(U &&) noexcept = default;
5981+
};
5982+
U u1;
5983+
U u2 = static_cast<U&&>(u1); // OK, calls \tcode{std::terminate} if \tcode{T::T(T\&\&)} throws
59705984
\end{codeblock}
59715985
\end{example}
59725986

0 commit comments

Comments
 (0)