Read-only mirrors. Development, issues and pull requests are on GitHub.

summaryrefslogtreecommitdiffhomepage
path: root/fuzzing/fuzz_TestSpecParser.cpp
diff options
context:
space:
mode:
authorMartin Hořeňovský2022-12-08 16:31:55 +0100
committerMartin Hořeňovský2022-12-09 00:40:01 +0100
commit28e651f1521449f2fce8b202307b6312a0ebe429 (patch)
tree8ef6703991c15c2d964adedd929cdf439d633526 /fuzzing/fuzz_TestSpecParser.cpp
parent2d7be1f7de8dee8beaa048e8d7ded7efb92f2284 (diff)
downloadcatch3-28e651f1521449f2fce8b202307b6312a0ebe429.tar.gz
Move SFINAE in decomposer into return type
This is needed so that we can use conjunction and other logical type traits to workaround issue with older GCC versions (8 and below), when they run into types that have ambiguous constructor from `0`, see e.g. #2571. However, using conjunction and friends in the SFINAE constraint in the template parameter breaks for C++20 and up, due to the new comparison operator rewriting rules. With C++20, when the compiler see `a == b`, it also tries `b == a` and collects overload set for both of these expressions. In Catch2, this means that e.g. `REQUIRE( 1 == 2 )` would lead the compiler to check overloads for both `ExprLhs<int> == int` and `int == ExprLhs<int>`. Since the overload set and SFINAE constraints assume that `ExprLhs<T>` is always on the left side, when the compiler tries to resolve the template parameters, all hell breaks loose and the compilation fails. By moving the SFINAE constraints to the return type, the compiler can discard the switched expression without having to resolve the complex SFINAE constraints, and thus everything works the way it is supposed to. Fixes #2571
Diffstat (limited to 'fuzzing/fuzz_TestSpecParser.cpp')
0 files changed, 0 insertions, 0 deletions