Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Catch2 should not trigger -Werror=parentheses by default #2654

Open
qnzhou opened this issue Mar 10, 2023 · 1 comment
Open

Catch2 should not trigger -Werror=parentheses by default #2654

qnzhou opened this issue Mar 10, 2023 · 1 comment

Comments

@qnzhou
Copy link

qnzhou commented Mar 10, 2023

Describe the bug
Catch2 triggers-Werror=parentheses on linux (gcc 9.3.1). Here is the error message:

_deps/catch2-src/src/catch2/internal/catch_test_macro_impl.hpp:57:67: error: suggest parentheses around comparison in operand of ‘==’ [-Werror=parentheses]
   57 |             catchAssertionHandler.handleExpr( Catch::Decomposer() <= __VA_ARGS__ ); \
_deps/catch2-src/src/catch2/catch_test_macros.hpp:125:26: note: in expansion of macro ‘INTERNAL_CATCH_TEST’
  125 |   #define REQUIRE( ... ) INTERNAL_CATCH_TEST( "REQUIRE", Catch::ResultDisposition::Normal, __VA_ARGS__  )
      |                          ^~~~~~~~~~~~~~~~~~~

Expected behavior
No warning should be produced.

Reproduction steps
Any REQUIRE(x == y) will do.

Platform information:

  • OS: Centos Linux 7
  • Compiler+version: GCC v9.3.1
  • Catch version: v3.3.2

Additional context
This is related to #674, which is closed but not fixed.

@lethal-guitar
Copy link

I'm running into the same issue using GCC 8.4.0 on Ubuntu 20.04, with Catch v3.4.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants