optional: Implement LWG 2900 and P0602

Differential Revision: https://reviews.llvm.org/D32385

llvm-svn: 307505
This commit is contained in:
Casey Carter
2017-07-09 17:15:49 +00:00
parent 4050c77d33
commit f2d571c8ac
6 changed files with 145 additions and 107 deletions

View File

@@ -55,10 +55,10 @@ constexpr bool constexpr_test(InitArgs&&... args)
void test_throwing_ctor() {
#ifndef TEST_HAS_NO_EXCEPTIONS
struct Z {
Z() : count(0) {}
Z(Z&& o) : count(o.count + 1)
{ if (count == 2) throw 6; }
int count;
Z() : count(0) {}
Z(Z&& o) : count(o.count + 1)
{ if (count == 2) throw 6; }
int count;
};
Z z;
optional<Z> rhs(std::move(z));