Simplify some checks by using __CLANG_PREREQ
authorYedidya Feldblum <yfeldblum@fb.com>
Mon, 16 Nov 2015 10:07:19 +0000 (02:07 -0800)
committerfacebook-github-bot-9 <folly-bot@fb.com>
Mon, 16 Nov 2015 10:20:20 +0000 (02:20 -0800)
Summary: [Folly] Simplify some checks by using `__CLANG_PREREQ`.

Reviewed By: meyering

Differential Revision: D2657979

fb-gh-sync-id: 80ff56bbab0e78465d71315b729ad14a09706ed5

folly/test/OptionalTest.cpp

index 0c3d9fdc95b2375fc26c52a64c70d7e82877bf92..bcf08476a768411a52328658378dff0d0f6938f3 100644 (file)
@@ -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 {