From: Yedidya Feldblum Date: Sun, 15 Nov 2015 19:52:43 +0000 (-0800) Subject: Simplify some checks by using __CLANG_PREREQ X-Git-Tag: deprecate-dynamic-initializer~254 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=95ccc564c5c70715ca9d499e93147dc2f8d72b8f;p=folly.git Simplify some checks by using __CLANG_PREREQ Summary: [Folly] Simplify some checks by using `__CLANG_PREREQ`. Reviewed By: meyering Differential Revision: D2656842 fb-gh-sync-id: e762fba423fb7cc08907d10dc10f8f46d93a9fe4 --- diff --git a/folly/Range.h b/folly/Range.h index c72288e2..ce235bef 100644 --- a/folly/Range.h +++ b/folly/Range.h @@ -201,9 +201,7 @@ public: constexpr Range(Iter start, size_t size) : b_(start), e_(start + size) { } -# if !defined(__clang__) || __clang_major__ > 3 || \ - (__clang_major__ == 3 && __clang_minor__ > 6) - // Clang 3.6 crashes on this line +# if !__clang__ || __CLANG_PREREQ(3, 7) // Clang 3.6 crashes on this line /* implicit */ Range(std::nullptr_t) = delete; # endif diff --git a/folly/test/ExceptionWrapperTest.cpp b/folly/test/ExceptionWrapperTest.cpp index 79660da3..723dff04 100644 --- a/folly/test/ExceptionWrapperTest.cpp +++ b/folly/test/ExceptionWrapperTest.cpp @@ -18,6 +18,7 @@ #include #include #include +#include using namespace folly; @@ -176,12 +177,12 @@ TEST(ExceptionWrapper, with_exception_test) { EXPECT_EQ(ew2.class_name(), "IntException"); ew2.with_exception([&](AbstractIntException& ie) { EXPECT_EQ(ie.getInt(), expected); -#if defined __clang__ && (__clang_major__ > 3 || __clang_minor__ >= 6) +#if __CLANG_PREREQ(3, 6) # pragma clang diagnostic push # pragma clang diagnostic ignored "-Wunevaluated-expression" #endif EXPECT_EQ(typeid(ie), typeid(IntException)); -#if defined __clang__ && (__clang_major__ > 3 || __clang_minor__ >= 6) +#if __CLANG_PREREQ(3, 6) # pragma clang diagnostic pop #endif });