Closed subbota-a closed 5 months ago
Describe the bug I want to use constrants in the list of GENERATOR's values. gcc and clang doesn't compile code. https://godbolt.org/z/fxzqec7qT
Expected behavior Code is built
Reproduction steps See godbolt reference https://godbolt.org/z/fxzqec7qT
Platform information:
Additional context
#include <catch2/catch_test_macros.hpp> #include <catch2/generators/catch_generators.hpp> TEST_CASE("1", ""){ const auto x = 10; auto g = GENERATE(x, x+1, x+2); REQUIRE(g > 0); }
In file included from <source>:2: <source>: In lambda function: <source>:6:23: error: 'x' is not captured 6 | auto g = GENERATE(x, x+1, x+2);
Use GENERATE_COPY
GENERATE_COPY
Describe the bug I want to use constrants in the list of GENERATOR's values. gcc and clang doesn't compile code. https://godbolt.org/z/fxzqec7qT
Expected behavior Code is built
Reproduction steps See godbolt reference https://godbolt.org/z/fxzqec7qT
Platform information:
Additional context