-
-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Fix Clang 19 -Wc++20-extensions warning
#2968
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
Fix Clang 19 -Wc++20-extensions warning
#2968
Conversation
|
I'm still seeing the same problem present in #2934 as well as this implementation. |
-Wc++20-extensions warning
|
In my tests, (osx/linux, arm64) this seemed to cause other problems. For anybody w/ cmake I'm going with the following and moving on: if(CMAKE_CXX_STANDARD EQUAL 17
AND CMAKE_CXX_COMPILER_ID STREQUAL "Clang"
AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL "19.0.0")
# Fix for https://github.com/catchorg/Catch2/issues/2910 TEMPLATE_TEST_CASE()
# "error: passing no argument for the '...' parameter of a variadic macro is a
# C++20 extension [-Werror,-Wc++20-extensions]"
target_compile_options(Catch2 INTERFACE -Wno-c++20-extensions)
endif()
|
|
Pretty sure commit 6 is the right thing to do here. Test clang-{19,20} for simple: #include <catch2/catch_template_test_macros.hpp>
#include <catch2/catch_test_macros.hpp>
#include <vector>
TEMPLATE_TEST_CASE( "one-arg", "[bar]", int)
{
std::vector<TestType> vec;
vec.push_back(2);
}
TEMPLATE_TEST_CASE("two-arg", "[bar]", int, float) {
std::vector<TestType> vec;
vec.push_back(2);
} |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## devel #2968 +/- ##
=======================================
Coverage 90.98% 90.98%
=======================================
Files 198 198
Lines 8599 8599
=======================================
Hits 7823 7823
Misses 776 776 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ugh, the differences in the warning name are annoying.
The changes seem fine.
@ChrisThrasher If you want me to take a second look at something, you need to ping me on Discord. I have about 100 notifications from Catch2 on GH, and I am currently ignoring them all.
|
Merge? |
5bb8d12 to
998dda5
Compare
ChrisThrasher
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was able to test this with Catch 19 and 20 and confirm that it works. Thanks!
Description
-Wc++20-extensionswarning #2910.GitHub Issues
#2910
Minimal reproduction
Tested with:
Patch Results
Error seen (clang-19 only):
test.cpp:6:1: error: passing no argument for the '...' parameter of a variadic macro is a C++20 extension [-Werror,-Wc++20-extensions]