Commit `b710039` breaks tests with overloaded `operator==`
Los mantenedores suelen responder en 2 días
@michaelbawuah ya está trabajando en esto.
Desde el 13/10/2026.
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 75/100
- Tipo de issue
- Error
- Claridad
- Bien especificado
- Estado de actividad
- Activo
- Stack tecnológico
- cpp
- Área
- testing-qa
Línea de trabajo
Start by tracing the equality expression decomposition in src/catch2/internal/catch_decomposer.hpp, especially the operators around the reported line 345, and compare the behavior before and after commit b710039. Use the reduced reproduction from the issue as the first compile check. Done means the global operator== overload works inside a top-level REQUIRE and the relevant Catch2 tests pass.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Describe the bug
I have code with a operator== overload in the global scope (it is meant to be used with classes from std::).
REQUIRE assertions which use this operator at the top-level fail to compile since 3.16.1 / b710039a0848aa58bbe4e1bc270e7b0c809b676d.
Expected behavior
The following code compiles and runs fine.
Reproduction steps
This is a reduced example.
namespace test {
struct S {
int x;
};
}
constexpr bool operator==(const test::S& lhs, const test::S& rhs)
{
return lhs.x == rhs.x;
}
#include <catch2/catch_test_macros.hpp>
TEST_CASE("Test")
{
REQUIRE(test::S{1} == test::S{1});
}
Platform information:
- OS: Up-to-date Arch Linux (12/Oct/2026)
- Compiler+version: GCC 16.2.1 20260810
- Catch version: v3.16.1
Additional context
Error message:
/usr/include/catch2/internal/catch_decomposer.hpp:345:5: error: no match for ‘operator==’ (operand types are ‘const test::S’ and ‘test::S’)
345 | CATCH_INTERNAL_DEFINE_EXPRESSION_EQUALITY_OPERATOR( eq, == )
| ^
• there are 2 candidates
• candidate 1: ‘template<class LhsT, class RhsT, class T> const Catch::BinaryExpr<LhsT, const RhsT&> Catch::operator==(const BinaryExpr<LhsT, RhsT>&, T)’
/usr/include/catch2/internal/catch_decomposer.hpp:239:5:
239 | CATCH_INTERNAL_DEFINE_BINARY_EXPR_OPERATOR( == )
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
• template argument deduction/substitution failed:
• ‘const test::S’ is not derived from ‘const Catch::BinaryExpr<LhsT, RhsT>’
/usr/include/catch2/internal/catch_decomposer.hpp:345:5:
345 | CATCH_INTERNAL_DEFINE_EXPRESSION_EQUALITY_OPERATOR( eq, == )
| ^
• candidate 2: ‘template<class LhsT, class RhsT> constexpr std::enable_if_t<((bool)std::conjunction<Catch::Detail::is_eq_comparable_impl<typename std::remove_reference<_Tp>::type&, typename std::remove_reference<_Arg>::type&, void>, std::negation<Catch::capture_by_value<typename std::remove_cv<typename std::remove_reference<_Arg>::type>::type> > >::value), Catch::BinaryExpr<LhsT, const RhsT&> > Catch::operator==(ExprLhs<LhsT>&&, RhsT&&)’
/usr/include/catch2/internal/catch_decomposer.hpp:345:5:
345 | CATCH_INTERNAL_DEFINE_EXPRESSION_EQUALITY_OPERATOR( eq, == )
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
• template argument deduction/substitution failed:
• types ‘Catch::ExprLhs<LhsT>’ and ‘const test::S’ have incompatible cv-qualifiers
/usr/include/catch2/internal/catch_decomposer.hpp:345:5:
345 | CATCH_INTERNAL_DEFINE_EXPRESSION_EQUALITY_OPERATOR( eq, == )
| ^
/usr/include/catch2/internal/catch_decomposer.hpp:345:5: error: could not convert ‘{<expression error>, (& lhs)->Catch::ExprLhs<const test::S&>::getLhs(), Catch::operator""_sr(((const char*)"=="), 2), rhs}’ from ‘<brace-enclosed initializer list>’ to ‘std::enable_if_t<true, Catch::BinaryExpr<const test::S&, const test::S&> >’ {aka ‘Catch::BinaryExpr<const test::S&, const test::S&>’}
345 | CATCH_INTERNAL_DEFINE_EXPRESSION_EQUALITY_OPERATOR( eq, == )
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| |
| <brace-enclosed initializer list>
- Lenguaje dominante
- C++
- Estrellas
- 21.6k
- Forks
- 3.4k
- Merge medio
- 3 d 12 h
- PR fusionados (30 d)
- 5
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de catchorg/Catch2
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 79/100
Los mantenedores suelen responder en 2 días
-
catch_discover_tests passes all EXTRA_ARGS as one argumentPosiblemente ocupada @CyberKun la tomó hace 11 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
catchorg/Catch2#3239 · 1 comentario ·
Los mantenedores suelen responder en 2 días
-
Not seeing some error messages from fakeit in jetbrains riderPosiblemente ocupada @Amanpal9 la tomó hace 21 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
catchorg/Catch2#3228 · 1 comentario ·
Los mantenedores suelen responder en 2 días
-
catch_discover_tests fails for Emscripten/WASM tests since v3.16.0Posiblemente ocupada @nafiurahman00 la tomó hace 8 días. AbiertoExtras
Dificultad 3/5 1-2 días Aptitud para principiantes 72/100
catchorg/Catch2#3241 · 1 comentario ·
Los mantenedores suelen responder en 2 días
-
Dificultad 5/5 Más de una semana Aptitud para principiantes 35/100
Los mantenedores suelen responder en 2 días
Todos los issues de catchorg/Catch2
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
cp-algorithms/cp-algorithms#1774 ·
Los mantenedores suelen responder en 1 día
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
telefonicaid/fiware-orion#4836 ·
Los mantenedores suelen responder en 1 día
-
nixd exits at startup when its parent process belongs to another userPosiblemente ocupada @conao3 la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
nix-community/nixd#930 ·
Los mantenedores suelen responder en 2 días
-
refactor topic-ui topic-weather
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
Los mantenedores suelen responder en 1 día
-
Command-Install Needs-Triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 79/100
microsoft/winget-cli#6718 ·
Los mantenedores suelen responder en 2 días