Commit 95ccc564 authored by Yedidya Feldblum's avatar Yedidya Feldblum Committed by facebook-github-bot-9

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
parent 5bad4e9f
...@@ -201,9 +201,7 @@ public: ...@@ -201,9 +201,7 @@ public:
constexpr Range(Iter start, size_t size) constexpr Range(Iter start, size_t size)
: b_(start), e_(start + size) { } : b_(start), e_(start + size) { }
# if !defined(__clang__) || __clang_major__ > 3 || \ # if !__clang__ || __CLANG_PREREQ(3, 7) // Clang 3.6 crashes on this line
(__clang_major__ == 3 && __clang_minor__ > 6)
// Clang 3.6 crashes on this line
/* implicit */ Range(std::nullptr_t) = delete; /* implicit */ Range(std::nullptr_t) = delete;
# endif # endif
......
...@@ -18,6 +18,7 @@ ...@@ -18,6 +18,7 @@
#include <stdexcept> #include <stdexcept>
#include <folly/ExceptionWrapper.h> #include <folly/ExceptionWrapper.h>
#include <folly/Conv.h> #include <folly/Conv.h>
#include <folly/Portability.h>
using namespace folly; using namespace folly;
...@@ -176,12 +177,12 @@ TEST(ExceptionWrapper, with_exception_test) { ...@@ -176,12 +177,12 @@ TEST(ExceptionWrapper, with_exception_test) {
EXPECT_EQ(ew2.class_name(), "IntException"); EXPECT_EQ(ew2.class_name(), "IntException");
ew2.with_exception<AbstractIntException>([&](AbstractIntException& ie) { ew2.with_exception<AbstractIntException>([&](AbstractIntException& ie) {
EXPECT_EQ(ie.getInt(), expected); 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 push
# pragma clang diagnostic ignored "-Wunevaluated-expression" # pragma clang diagnostic ignored "-Wunevaluated-expression"
#endif #endif
EXPECT_EQ(typeid(ie), typeid(IntException)); EXPECT_EQ(typeid(ie), typeid(IntException));
#if defined __clang__ && (__clang_major__ > 3 || __clang_minor__ >= 6) #if __CLANG_PREREQ(3, 6)
# pragma clang diagnostic pop # pragma clang diagnostic pop
#endif #endif
}); });
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment