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

Casey Carter via cfe-commits cfe-commits at lists.llvm.org
Thu Jun 1 15:40:17 PDT 2017


Author: caseycarter
Date: Thu Jun  1 17:40:16 2017
New Revision: 304487

URL: http://llvm.org/viewvc/llvm-project?rev=304487&view=rev
Log:
[test] Allow non-libc++ coroutine_handle::done to strengthen noexcept

Modified:
    libcxx/trunk/test/std/experimental/language.support/support.coroutines/coroutine.handle/coroutine.handle.completion/done.pass.cpp
    libcxx/trunk/test/std/experimental/language.support/support.coroutines/end.to.end/await_result.pass.cpp
    libcxx/trunk/test/std/experimental/language.support/support.coroutines/end.to.end/bool_await_suspend.pass.cpp
    libcxx/trunk/test/std/experimental/language.support/support.coroutines/end.to.end/oneshot_func.pass.cpp

Modified: libcxx/trunk/test/std/experimental/language.support/support.coroutines/coroutine.handle/coroutine.handle.completion/done.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/experimental/language.support/support.coroutines/coroutine.handle/coroutine.handle.completion/done.pass.cpp?rev=304487&r1=304486&r2=304487&view=diff
==============================================================================
--- libcxx/trunk/test/std/experimental/language.support/support.coroutines/coroutine.handle/coroutine.handle.completion/done.pass.cpp (original)
+++ libcxx/trunk/test/std/experimental/language.support/support.coroutines/coroutine.handle/coroutine.handle.completion/done.pass.cpp Thu Jun  1 17:40:16 2017
@@ -33,7 +33,7 @@ void do_test(coro::coroutine_handle<Prom
   // FIXME Add a runtime test
   {
     ASSERT_SAME_TYPE(decltype(H.done()), bool);
-    ASSERT_NOT_NOEXCEPT(H.done());
+    LIBCPP_ASSERT_NOT_NOEXCEPT(H.done());
   }
 }
 

Modified: libcxx/trunk/test/std/experimental/language.support/support.coroutines/end.to.end/await_result.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/experimental/language.support/support.coroutines/end.to.end/await_result.pass.cpp?rev=304487&r1=304486&r2=304487&view=diff
==============================================================================
--- libcxx/trunk/test/std/experimental/language.support/support.coroutines/end.to.end/await_result.pass.cpp (original)
+++ libcxx/trunk/test/std/experimental/language.support/support.coroutines/end.to.end/await_result.pass.cpp Thu Jun  1 17:40:16 2017
@@ -23,7 +23,7 @@ struct coro_t {
     }
     suspend_never initial_suspend() { return {}; }
     suspend_never final_suspend() { return {}; }
-    void return_void(){}
+    void return_void() {}
     static void unhandled_exception() {}
   };
 };
@@ -37,7 +37,7 @@ struct B {
 
 
 struct A {
-  ~A(){}
+  ~A() {}
   bool await_ready() { return true; }
   int await_resume() { return 42; }
   template <typename F> void await_suspend(F) {}

Modified: libcxx/trunk/test/std/experimental/language.support/support.coroutines/end.to.end/bool_await_suspend.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/experimental/language.support/support.coroutines/end.to.end/bool_await_suspend.pass.cpp?rev=304487&r1=304486&r2=304487&view=diff
==============================================================================
--- libcxx/trunk/test/std/experimental/language.support/support.coroutines/end.to.end/bool_await_suspend.pass.cpp (original)
+++ libcxx/trunk/test/std/experimental/language.support/support.coroutines/end.to.end/bool_await_suspend.pass.cpp Thu Jun  1 17:40:16 2017
@@ -25,7 +25,7 @@ struct coro_t {
     }
     suspend_never initial_suspend() { return {}; }
     suspend_never final_suspend() { return {}; }
-    void return_void(){}
+    void return_void() {}
     void unhandled_exception() {}
   };
   coro_t(coroutine_handle<promise_type> hh) : h(hh) {}

Modified: libcxx/trunk/test/std/experimental/language.support/support.coroutines/end.to.end/oneshot_func.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/experimental/language.support/support.coroutines/end.to.end/oneshot_func.pass.cpp?rev=304487&r1=304486&r2=304487&view=diff
==============================================================================
--- libcxx/trunk/test/std/experimental/language.support/support.coroutines/end.to.end/oneshot_func.pass.cpp (original)
+++ libcxx/trunk/test/std/experimental/language.support/support.coroutines/end.to.end/oneshot_func.pass.cpp Thu Jun  1 17:40:16 2017
@@ -68,10 +68,10 @@ private:
 
 std::vector<int> yielded_values = {};
 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 Do2(func<double> f) { yield(f()); }
+void Do2(func<double> f) { yield(static_cast<int>(f())); }
 
 int main() {
   Do1([] { return yield(43); });




More information about the cfe-commits mailing list