From d69f6a7a3523aea7cbe5578cdbaea6e3a9920d8c Mon Sep 17 00:00:00 2001 From: Yedidya Feldblum Date: Mon, 16 Nov 2015 02:07:19 -0800 Subject: [PATCH] Simplify some checks by using __CLANG_PREREQ Summary: [Folly] Simplify some checks by using `__CLANG_PREREQ`. Reviewed By: meyering Differential Revision: D2657979 fb-gh-sync-id: 80ff56bbab0e78465d71315b729ad14a09706ed5 --- folly/test/OptionalTest.cpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/folly/test/OptionalTest.cpp b/folly/test/OptionalTest.cpp index 0c3d9fdc..bcf08476 100644 --- a/folly/test/OptionalTest.cpp +++ b/folly/test/OptionalTest.cpp @@ -473,11 +473,9 @@ TEST(Optional, MakeOptional) { EXPECT_EQ(**optIntPtr, 3); } -#ifdef __clang__ +#if __CLANG_PREREQ(3, 6) # pragma clang diagnostic push -# if __clang_major__ > 3 || __clang_minor__ >= 6 -# pragma clang diagnostic ignored "-Wself-move" -# endif +# pragma clang diagnostic ignored "-Wself-move" #endif TEST(Optional, SelfAssignment) { @@ -490,8 +488,8 @@ TEST(Optional, SelfAssignment) { ASSERT_TRUE(b.hasValue() && b.value() == 23333333); } -#ifdef __clang__ -#pragma clang diagnostic pop +#if __CLANG_PREREQ(3, 6) +# pragma clang diagnostic pop #endif class ContainsOptional { -- 2.34.1