-
-
Notifications
You must be signed in to change notification settings - Fork 124
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Warnings on constexpr testing #88
Comments
Hi, First, the simplest approach to solve this issue would be ignoring the result of set(CMAKE_CXX_CPPCHECK
${CPPCHECK}
--template=${CPPCHECK_TEMPLATE}
--enable=style,performance,warning,portability
--suppress=knownConditionTrueFalse # newly added line Or we can overreact and remove the whole class of checks which seems to include set(CMAKE_CXX_CPPCHECK
${CPPCHECK}
--template=${CPPCHECK_TEMPLATE}
--enable=performance,warning,portability # removed `style` This, however, is merely a cure for the symptom. The root cause of this behavior seems to stem from how
This means, when #include <catch2/catch_test_macros.hpp> , ignores this line, and moves on. Later it encounters STATIC_REQUIRE(factorial_constexpr(0) == 1); , and without expanding the macro properly set(CMAKE_CXX_CPPCHECK
${CPPCHECK}
--template=${CPPCHECK_TEMPLATE}
--enable=style,performance,warning,portability
--include="${CMAKE_CURRENT_BINARY_DIR}/_deps/catch2-src/src/" # newly added line I believe this should solve your problem at the expense of longer compile time. |
Hi guys,
maybe someone here can help me.
I don't quite understand the idea of the
constexpr
tests. My compiler (Apple Clang 15.0.0) resolves the static checks at compile time, and then throws warnings likeand then, because warnings are promoted to errors, the build fails.
Is this on purpose? I mean, the idea is to check that this is the behavior and then disable the tests?
Thanks.
Pablo
The text was updated successfully, but these errors were encountered: