mirror of
https://github.com/catchorg/Catch2.git
synced 2024-11-16 18:52:25 +01:00
28e651f152
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 |
||
---|---|---|
.. | ||
Approx.tests.cpp | ||
BDD.tests.cpp | ||
Benchmark.tests.cpp | ||
Class.tests.cpp | ||
Compilation.tests.cpp | ||
Condition.tests.cpp | ||
Decomposition.tests.cpp | ||
EnumToString.tests.cpp | ||
Exception.tests.cpp | ||
Generators.tests.cpp | ||
Matchers.tests.cpp | ||
MatchersRanges.tests.cpp | ||
Message.tests.cpp | ||
Misc.tests.cpp | ||
ToStringByte.tests.cpp | ||
ToStringChrono.tests.cpp | ||
ToStringGeneral.tests.cpp | ||
ToStringOptional.tests.cpp | ||
ToStringPair.tests.cpp | ||
ToStringTuple.tests.cpp | ||
ToStringVariant.tests.cpp | ||
ToStringVector.tests.cpp | ||
ToStringWhich.tests.cpp | ||
Tricky.tests.cpp | ||
VariadicMacros.tests.cpp |