#3222

Restore global comparison operator lookup in decomposition

Openmichaelbawuahwants to merge intofrom

Description

Restore compilation of assertions that use global comparison operators declared before Catch2 headers. For example, REQUIRE(test::S{1} == test::S{1}) fails after b710039 because Catch2's namespace-scope decomposition operators hide the global overload during ordinary lookup.

Evaluate comparisons through constexpr helpers declared before those operators. Preserve operand forwarding, explicit conversion to bool, and the literal-zero fallbacks used for pointer and ordering comparisons. Add regression coverage for all six comparison operators, lvalue/rvalue operands, and null comparisons in both directions.

Validation on Linux with GCC 13:

  • C++14 Debug build using all-tests; all 156 CTest checks passed across the full run and a targeted rerun after repairing local build artifacts.
  • 72 assertions in the two new regression test cases passed.
  • C++20 Compilation/Decomposition tests: 133 assertions in 22 test cases passed.
  • The new regression translation unit fails to compile before the production change and compiles after it.
  • git diff --check passes.

GitHub Issues

Closes #3221.