message: clang builds should finally be passing now!
diff: @@ -9,9 +9,6 @@ DOCTEST_MAKE_STD_HEADERS_CLEAN_FROM_WARNINGS_ON_WALL_BEGIN
  #include <stdexcept>
  DOCTEST_MAKE_STD_HEADERS_CLEAN_FROM_WARNINGS_ON_WALL_END
  -static std::exception_ptr g_exception_ptr = nullptr;
  -static std::mutex g_mutex;
  -
  TEST_CASE("threads...") {
  auto call_from_thread = [](int value) {
  INFO("print me!");
  @@ -40,18 +37,21 @@ TEST_CASE("threads...") {
  // exceptions from threads (that includes failing REQUIRE asserts) have to be handled explicitly
  SUBCASE("spawned threads with exception propagation") {
  - auto might_throw = []() {
  + std::exception_ptr exception_ptr = nullptr;
  + std::mutex mutex;
  +
  + auto might_throw = [&]() {
  try {
  REQUIRE(1 == 1);
  REQUIRE(1 == 2); // will fail and throw an exception
  MESSAGE("not reached!");
  } catch(...) {
  - // make sure there are no races when dealing with the global exception ptr
  - std::lock_guard<std::mutex> lock(g_mutex);
  + // make sure there are no races when dealing with the exception ptr
  + std::lock_guard<std::mutex> lock(mutex);
  - // set the global exception pointer in case of an exception - might overwrite
  + // set the exception pointer in case of an exception - might overwrite
  // another exception but here we care about propagating any exception - not all
  - g_exception_ptr = std::current_exception();
  + exception_ptr = std::current_exception();
  }
  };
  std::thread t1(might_throw);
  @@ -61,8 +61,8 @@ TEST_CASE("threads...") {
  t2.join();
  // if any thread has thrown an exception - rethrow it
  - if(g_exception_ptr)
  - std::rethrow_exception(g_exception_ptr);
  + if(exception_ptr)
  + std::rethrow_exception(exception_ptr);
  }
  }
  