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 5926
5926
if it were implicitly declared, as follows:
5927
5927
\begin {itemize }
5928
5928
\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
5930
5932
\item
5931
5933
if \tcode {T}$ _2 $ has a parameter of type \tcode {const C\& },
5932
5934
the corresponding parameter of \tcode {T}$ _1 $ may be of type \tcode {C\& }.
5961
5963
constexpr S() = default; // ill-formed: implicit \tcode {S()} is not \tcode {constexpr}
5962
5964
S(int a = 0) = default; // ill-formed: default argument
5963
5965
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
5965
5967
private:
5966
5968
int i;
5967
5969
S(S&); // OK: private copy constructor
5968
5970
};
5969
5971
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
5970
5984
\end {codeblock }
5971
5985
\end {example }
5972
5986
You can’t perform that action at this time.
0 commit comments