File tree 1 file changed +16
-2
lines changed
1 file changed +16
-2
lines changed Original file line number Diff line number Diff line change 5924
5924
if it were implicitly declared, as follows:
5925
5925
\begin {itemize }
5926
5926
\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
5928
5930
\item
5929
5931
if \tcode {T}$ _2 $ has a parameter of type \tcode {const C\& },
5930
5932
the corresponding parameter of \tcode {T}$ _1 $ may be of type \tcode {C\& }.
5959
5961
constexpr S() = default; // ill-formed: implicit \tcode {S()} is not \tcode {constexpr}
5960
5962
S(int a = 0) = default; // ill-formed: default argument
5961
5963
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
5963
5965
private:
5964
5966
int i;
5965
5967
S(S&); // OK: private copy constructor
5966
5968
};
5967
5969
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
5968
5982
\end {codeblock }
5969
5983
\end {example }
5970
5984
You can’t perform that action at this time.
0 commit comments