summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorMathias Preiner <mathias.preiner@gmail.com>2021-02-26 12:48:33 -0800
committerGitHub <noreply@github.com>2021-02-26 12:48:33 -0800
commitf2adf69b7c364b45f75c3b5027d8a24213fd4001 (patch)
tree041ed83754893e9d465d0b38f6c7b5af2e4a77ee /test
parent0b9fe94d346b7448a0e092cc9f43013aadfe9548 (diff)
Fix -Werror issues with clang and use clang for debug-cln build. (#6004)
This fixes some issues that break the nightly ASAN builds with clang.
Diffstat (limited to 'test')
-rw-r--r--test/unit/CMakeLists.txt16
-rw-r--r--test/unit/theory/theory_white.h2
2 files changed, 16 insertions, 2 deletions
diff --git a/test/unit/CMakeLists.txt b/test/unit/CMakeLists.txt
index a6291178b..46ff346e0 100644
--- a/test/unit/CMakeLists.txt
+++ b/test/unit/CMakeLists.txt
@@ -57,6 +57,11 @@ macro(cvc4_add_unit_test is_white name output_dir)
if(${is_white})
target_compile_options(${name} PRIVATE -fno-access-control)
endif()
+ # Disable the Wunused-comparison warnings for the unit tests.
+ check_cxx_compiler_flag("-Wno-unused-comparison" HAVE_FLAGWno_unused_comparison)
+ if(HAVE_FLAGWno_unused_comparison)
+ target_compile_options(${name} PRIVATE -Wno-unused-comparison)
+ endif()
add_dependencies(build-units ${name})
# Generate into bin/test/unit/<output_dir>.
set(test_bin_dir ${CMAKE_BINARY_DIR}/bin/test/unit/${output_dir})
@@ -125,7 +130,16 @@ macro(cvc4_add_cxx_unit_test is_white name output_dir)
endif()
# Disable the Wsuggest-override warnings for the unit tests. CxxTest generates
# code that does not properly add the override keyword to runTest().
- target_compile_options(${name} PRIVATE -Wno-suggest-override)
+ check_cxx_compiler_flag("-Wno-suggest-override" HAVE_FLAGWno_suggest_override)
+ if(HAVE_FLAGWno_suggest_override)
+ target_compile_options(${name} PRIVATE -Wno-suggest-override)
+ endif()
+ # Disable the Wunused-comparison warnings for the unit tests.
+ check_cxx_compiler_flag("-Wno-unused-comparison" HAVE_FLAGWno_unused_comparison)
+ if(HAVE_FLAGWno_unused_comparison)
+ target_compile_options(${name} PRIVATE -Wno-unused-comparison)
+ endif()
+
add_dependencies(build-units ${name})
# Generate into bin/test/unit/<output_dir>.
set(test_bin_dir ${CMAKE_BINARY_DIR}/bin/test/unit/${output_dir})
diff --git a/test/unit/theory/theory_white.h b/test/unit/theory/theory_white.h
index 4b6c1a064..5ac316612 100644
--- a/test/unit/theory/theory_white.h
+++ b/test/unit/theory/theory_white.h
@@ -108,7 +108,7 @@ class DummyTheory : public Theory {
d_theoryState = &d_state;
}
- TheoryRewriter* getTheoryRewriter() { return nullptr; }
+ TheoryRewriter* getTheoryRewriter() override { return nullptr; }
void registerTerm(TNode n) {
// check that we registerTerm() a term only once
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback