This commit is contained in:
Hans Dembinski 2018-11-13 17:30:24 +01:00
parent c0009761f9
commit 3f1bd7ec65
2 changed files with 4 additions and 1 deletions

View File

@ -56,6 +56,9 @@ function(compiled_test SRC)
elseif(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
# cannot use sanitizers with gcc < 8, causes linker errors
target_compile_options(${BASENAME} PRIVATE -Wall -Wextra -g -O0)
if (${BASENAME} MATCHES "parallel")
target_compile_options(${BASENAME} PRIVATE -pthread)
endif()
elseif(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
target_compile_options(${BASENAME} PRIVATE -Wall -Wextra -g -O0 -D__STRICT_ANSI__
-fsanitize=address,undefined

View File

@ -36,7 +36,7 @@ public:
copyable_atomic() = default;
// this is potentially not thread-safe
copyable_atomic(const copyable_atomic& rhs) { this->operator=(rhs); }
copyable_atomic(const copyable_atomic& rhs) : std::atomic<T>() { this->operator=(rhs); }
// this is potentially not thread-safe
copyable_atomic& operator=(const copyable_atomic& rhs) {