Skip to content

Commit aa4100a

Browse files
committed
Disable -Wparentheses warning in clang too
1 parent 80fcc4d commit aa4100a

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

tests/snatch/snatch.hpp

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -556,18 +556,14 @@ struct with_what_contains : private contains_substring {
556556
};
557557
} // namespace snatch::matchers
558558

559-
// Test macros.
560-
// ------------
561-
562-
#define TESTING_CONCAT_IMPL(x, y) x##y
563-
#define TESTING_MACRO_CONCAT(x, y) TESTING_CONCAT_IMPL(x, y)
564-
#define TESTING_EXPR(x) snatch::impl::expression{} <= x
559+
// Compiler warning handling.
560+
// --------------------------
565561

566562
// clang-format off
567563
#if defined(__clang__)
568564
# define WARNING_PUSH _Pragma("clang diagnostic push")
569565
# define WARNING_POP _Pragma("clang diagnostic pop")
570-
# define WARNING_DISABLE_PARENTHESES do {} while (0)
566+
# define WARNING_DISABLE_PARENTHESES _Pragma("clang diagnostic ignored \"-Wparentheses\"")
571567
# define WARNING_DISABLE_CONSTANT_COMPARISON do {} while (0)
572568
#elif defined(__GNUC__)
573569
# define WARNING_PUSH _Pragma("GCC diagnostic push")
@@ -587,6 +583,13 @@ struct with_what_contains : private contains_substring {
587583
#endif
588584
// clang-format on
589585

586+
// Test macros.
587+
// ------------
588+
589+
#define TESTING_CONCAT_IMPL(x, y) x##y
590+
#define TESTING_MACRO_CONCAT(x, y) TESTING_CONCAT_IMPL(x, y)
591+
#define TESTING_EXPR(x) snatch::impl::expression{} <= x
592+
590593
#define TEST_CASE(NAME, TAGS) \
591594
static const char* TESTING_MACRO_CONCAT(test_id_, __COUNTER__) = \
592595
snatch::tests.add(NAME, TAGS) = \

0 commit comments

Comments
 (0)