Skip to content
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

Catch2 is not ready for c++23 #2744

Closed
piotrrak opened this issue Sep 14, 2023 · 3 comments
Closed

Catch2 is not ready for c++23 #2744

piotrrak opened this issue Sep 14, 2023 · 3 comments
Labels
Good First Issue Issues that can be undertaken by someone new to the project

Comments

@piotrrak
Copy link

piotrrak commented Sep 14, 2023

Description
There wasn't many issues so far with what g++/clang++ implement now (for meson build)

This one test won't work due to lack of std::vector::operator[] (int, int, int)

diff --git a/tests/SelfTest/UsageTests/Message.tests.cpp b/tests/SelfTest/UsageTests/Message.tests.cpp
index a5e69582..40ab8316 100644
--- a/tests/SelfTest/UsageTests/Message.tests.cpp
+++ b/tests/SelfTest/UsageTests/Message.tests.cpp
@@ -256,7 +256,7 @@ std::ostream& operator<<(std::ostream& out, helper_1436<T1, T2> const& helper) {
 #endif
 
 TEST_CASE("CAPTURE can deal with complex expressions involving commas", "[messages][capture]") {
-    CAPTURE(std::vector<int>{1, 2, 3}[0, 1, 2],
+    CAPTURE(std::vector<int>{1, 2, 3}[(0, 1, 2)],
             std::vector<int>{1, 2, 3}[(0, 1)],
             std::vector<int>{1, 2, 3}[0]);
     CAPTURE((helper_1436<int, int>{12, -12}),

Additional context
When the time comes, that c++23 is supported.

@horenmar
Copy link
Member

This should be fixed by having custom type with multi-arg operator[] guarded by the __cpp_multidimensional_subscript feature macro. If multiarg [] is not available, the CAPTURE will be evaluated with the comma operator, if it is, as an multiarg [].

@piotrrak
Copy link
Author

This should be fixed by having custom type with multi-arg operator[] guarded by the __cpp_multidimensional_subscript feature macro. If multiarg [] is not available, the CAPTURE will be evaluated with the comma operator, if it is, as an multiarg [].

Indeed.

@horenmar horenmar added the Good First Issue Issues that can be undertaken by someone new to the project label Oct 26, 2023
@piotrrak
Copy link
Author

@horenmar Thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Good First Issue Issues that can be undertaken by someone new to the project
Projects
None yet
Development

No branches or pull requests

2 participants