Skip to content

Commit e9ef9e1

Browse files
committed
[libc++] Fix tests after llvm#144220
This is a backport of the test fixes made in llvm#151935 Fixes llvm#150601
1 parent 3db29aa commit e9ef9e1

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

libcxx/test/libcxx/utilities/expected/expected.expected/value.observers.verify.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ void test() {
9595
std::expected<int, CopyConstructibleButNotMoveConstructible> e;
9696
[[maybe_unused]] auto val = std::move(e).value();
9797
// expected-error-re@*:* {{static assertion failed {{.*}}error_type has to be both copy constructible and constructible from decltype(std::move(error()))}}
98+
// The following diagnostic is emmitted in expected.h:
9899
}
99100
}
100101

@@ -118,14 +119,16 @@ void test() {
118119
const std::expected<int, CopyConstructibleButNotMoveConstructible> e;
119120
[[maybe_unused]] auto val = std::move(e).value();
120121
// expected-error-re@*:* {{static assertion failed {{.*}}error_type has to be both copy constructible and constructible from decltype(std::move(error()))}}
122+
// The following diagnostic is emmitted in expected.h:
121123
}
122124
}
123125
// These diagnostics happen when we try to construct bad_expected_access from the non copy-constructible error type.
124126
#if _LIBCPP_HAS_EXCEPTIONS
125127
// expected-error-re@*:* {{call to deleted constructor of{{.*}}}}
126128
// expected-error-re@*:* {{call to deleted constructor of{{.*}}}}
127-
// expected-error-re@*:* 1-2{{call to deleted constructor of{{.*}}}}
128-
// expected-error-re@*:* 0-2{{call to deleted constructor of{{.*}}}}
129129
#endif
130+
// These diagnostics can also additionally be produced by static_assert (see GH150601).
131+
// expected-error-re@*:* 0-2{{call to deleted constructor of{{.*}}}}
132+
// expected-error-re@*:* 0-2{{call to deleted constructor of{{.*}}}}
130133
}
131134
// clang-format on

0 commit comments

Comments
 (0)