mirror of
https://github.com/catchorg/Catch2.git
synced 2025-08-03 05:45:39 +02:00
Disable Wmissing-noreturn for test files
Adding unreachable to `FAIL` and `SKIP` made Clang become very good at figuring out that tests of `FAIL` and `SKIP` will never return and thus could be marked as [[noreturn]]. To avoid introducing lot of warning suppression noise into the test files, we just disable it instead.
This commit is contained in:
@@ -103,7 +103,13 @@ if(CATCH_BUILD_FUZZERS)
|
||||
endif()
|
||||
|
||||
if(CATCH_DEVELOPMENT_BUILD)
|
||||
add_warnings_to_targets("${CATCH_WARNING_TARGETS}")
|
||||
set(CATCH_ALL_TARGETS ${CATCH_IMPL_TARGETS} ${CATCH_TEST_TARGETS})
|
||||
add_warnings_to_targets("${CATCH_ALL_TARGETS}")
|
||||
# After we added the noreturn hint to FAIL and SKIP, Clang became
|
||||
# extremely good at diagnosing tests that test these macros as being
|
||||
# noreturn, but not marked as such. This made the warning useless for
|
||||
# our test files.
|
||||
add_cxx_flag_if_supported_to_targets("-Wno-missing-noreturn" "${CATCH_TEST_TARGETS}")
|
||||
endif()
|
||||
|
||||
# Only perform the installation steps when Catch is not being used as
|
||||
|
Reference in New Issue
Block a user