[libcxx-commits] [libcxx] d3cbcc4 - [libcxx][test] barrier completion functions must be non-throwing

Casey Carter via libcxx-commits libcxx-commits at lists.llvm.org
Fri Jun 24 09:06:57 PDT 2022


Author: Casey Carter
Date: 2022-06-24T09:06:47-07:00
New Revision: d3cbcc4e8990ffe6d1e2a7708ce30220b95ce025

URL: https://github.com/llvm/llvm-project/commit/d3cbcc4e8990ffe6d1e2a7708ce30220b95ce025
DIFF: https://github.com/llvm/llvm-project/commit/d3cbcc4e8990ffe6d1e2a7708ce30220b95ce025.diff

LOG: [libcxx][test] barrier completion functions must be non-throwing

... per N4910 [thread.barrier.class]/5.

Added: 
    

Modified: 
    libcxx/test/std/thread/thread.barrier/completion.pass.cpp
    libcxx/test/std/thread/thread.barrier/max.pass.cpp

Removed: 
    


################################################################################
diff  --git a/libcxx/test/std/thread/thread.barrier/completion.pass.cpp b/libcxx/test/std/thread/thread.barrier/completion.pass.cpp
index d9760803d2e85..7cc7ce95bf218 100644
--- a/libcxx/test/std/thread/thread.barrier/completion.pass.cpp
+++ b/libcxx/test/std/thread/thread.barrier/completion.pass.cpp
@@ -24,7 +24,7 @@
 int main(int, char**)
 {
   int x = 0;
-  auto comp = [&]() { x += 1; };
+  auto comp = [&]() noexcept { x += 1; };
   std::barrier<decltype(comp)> b(2, comp);
 
   std::thread t = support::make_test_thread([&](){

diff  --git a/libcxx/test/std/thread/thread.barrier/max.pass.cpp b/libcxx/test/std/thread/thread.barrier/max.pass.cpp
index 0060e31ccd347..ec03c5c87a09c 100644
--- a/libcxx/test/std/thread/thread.barrier/max.pass.cpp
+++ b/libcxx/test/std/thread/thread.barrier/max.pass.cpp
@@ -20,7 +20,7 @@
 int main(int, char**)
 {
   static_assert(std::barrier<>::max() > 0, "");
-  auto l = [](){};
+  auto l = []() noexcept {};
   static_assert(std::barrier<decltype(l)>::max() > 0, "");
   return 0;
 }


        


More information about the libcxx-commits mailing list