[test] Allow non-libc++ coroutine_handle::done to strengthen noexcept

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@304487 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Casey Carter
2017-06-01 22:40:16 +00:00
parent 974e519e85
commit 2e612e1621
4 changed files with 6 additions and 6 deletions

View File

@@ -33,7 +33,7 @@ void do_test(coro::coroutine_handle<Promise> const& H) {
// FIXME Add a runtime test // FIXME Add a runtime test
{ {
ASSERT_SAME_TYPE(decltype(H.done()), bool); ASSERT_SAME_TYPE(decltype(H.done()), bool);
ASSERT_NOT_NOEXCEPT(H.done()); LIBCPP_ASSERT_NOT_NOEXCEPT(H.done());
} }
} }

View File

@@ -68,10 +68,10 @@ private:
std::vector<int> yielded_values = {}; std::vector<int> yielded_values = {};
int yield(int x) { yielded_values.push_back(x); return x + 1; } int yield(int x) { yielded_values.push_back(x); return x + 1; }
float fyield(int x) { yielded_values.push_back(x); return x + 2; } float fyield(int x) { yielded_values.push_back(x); return static_cast<float>(x + 2); }
void Do1(func<int> f) { yield(f()); } void Do1(func<int> f) { yield(f()); }
void Do2(func<double> f) { yield(f()); } void Do2(func<double> f) { yield(static_cast<int>(f())); }
int main() { int main() {
Do1([] { return yield(43); }); Do1([] { return yield(43); });