diff --git a/projects/SelfTest/UsageTests/Matchers.tests.cpp b/projects/SelfTest/UsageTests/Matchers.tests.cpp index 1797d4a1..3fc64b96 100644 --- a/projects/SelfTest/UsageTests/Matchers.tests.cpp +++ b/projects/SelfTest/UsageTests/Matchers.tests.cpp @@ -242,12 +242,14 @@ namespace { namespace MatchersTests { ~CustomAllocator() = default; +#if defined(_MSC_VER) && _MSVC_LANG < 201703L using std::allocator::address; - using std::allocator::allocate; using std::allocator::construct; - using std::allocator::deallocate; using std::allocator::max_size; using std::allocator::destroy; +#endif + using std::allocator::allocate; + using std::allocator::deallocate; }; TEST_CASE("Vector matchers", "[matchers][vector]") { diff --git a/projects/SelfTest/UsageTests/Message.tests.cpp b/projects/SelfTest/UsageTests/Message.tests.cpp index 93347084..d151b2ba 100644 --- a/projects/SelfTest/UsageTests/Message.tests.cpp +++ b/projects/SelfTest/UsageTests/Message.tests.cpp @@ -241,6 +241,17 @@ std::ostream& operator<<(std::ostream& out, helper_1436 const& helper) { return out; } +// Clang and gcc have different names for this warning, and clang also +// warns about an unused value +#if defined(__GNUG__) && !defined(__clang__) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wcomma-subscript" +#elif defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-comma-subscript" +#pragma clang diagnostic ignored "-Wunused-value" +#endif + TEST_CASE("CAPTURE can deal with complex expressions involving commas", "[messages][capture]") { CAPTURE(std::vector{1, 2, 3}[0, 1, 2], std::vector{1, 2, 3}[(0, 1)], @@ -251,6 +262,10 @@ TEST_CASE("CAPTURE can deal with complex expressions involving commas", "[messag SUCCEED(); } +#ifdef __GNUG__ +#pragma GCC diagnostic pop +#endif + TEST_CASE("CAPTURE parses string and character constants", "[messages][capture]") { CAPTURE(("comma, in string", "escaped, \", "), "single quote in string,',", "some escapes, \\,\\\\"); CAPTURE("some, ), unmatched, } prenheses {[<");