Skip to content

Commit

Permalink
Merge 2019-02 CWG Motion 3
Browse files Browse the repository at this point in the history
P1286R2 Contra CWG DR1778

Fixes #2683.
  • Loading branch information
zygoloid authored Mar 9, 2019
2 parents 0b326cd + 11fbbe7 commit fb99e64
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions source/declarations.tex
Original file line number Diff line number Diff line change
Expand Up @@ -5926,7 +5926,9 @@
if it were implicitly declared, as follows:
\begin{itemize}
\item
\tcode{T}$_1$ and \tcode{T}$_2$ may have differing \grammarterm{ref-qualifier}{s}; and
\tcode{T}$_1$ and \tcode{T}$_2$ may have differing \grammarterm{ref-qualifier}{s};
\item
\tcode{T}$_1$ and \tcode{T}$_2$ may have differing exception specifications; and
\item
if \tcode{T}$_2$ has a parameter of type \tcode{const C\&},
the corresponding parameter of \tcode{T}$_1$ may be of type \tcode{C\&}.
Expand Down Expand Up @@ -5961,12 +5963,24 @@
constexpr S() = default; // ill-formed: implicit \tcode{S()} is not \tcode{constexpr}
S(int a = 0) = default; // ill-formed: default argument
void operator=(const S&) = default; // ill-formed: non-matching return type
~S() noexcept(false) = default; // deleted: exception specification does not match
~S() noexcept(false) = default; // OK, despite mismatched exception specification
private:
int i;
S(S&); // OK: private copy constructor
};
S::S(S&) = default; // OK: defines copy constructor

struct T {
T();
T(T &&) noexcept(false);
};
struct U {
T t;
U();
U(U &&) noexcept = default;
};
U u1;
U u2 = static_cast<U&&>(u1); // OK, calls \tcode{std::terminate} if \tcode{T::T(T\&\&)} throws
\end{codeblock}
\end{example}

Expand Down

0 comments on commit fb99e64

Please sign in to comment.