make futexWaitUntil tolerant of invalid time_point-s
[folly.git] / folly / Traits.h
index 2b94df1360effe21828adedb51b864e7d2282116..14e02f5a1f1e2691d36ad72f9150035e3f3b0e68 100644 (file)
@@ -340,6 +340,13 @@ struct is_negative_impl<T, false> {
   constexpr static bool check(T x) { return false; }
 };
 
+// folly::to integral specializations can end up generating code
+// inside what are really static ifs (not executed because of the templated
+// types) that violate -Wsign-compare so suppress them in order to not prevent
+// all calling code from using it.
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wsign-compare"
+
 template <typename RHS, RHS rhs, typename LHS>
 bool less_than_impl(
   typename std::enable_if<
@@ -371,6 +378,8 @@ bool less_than_impl(
   return false;
 }
 
+#pragma GCC diagnostic pop
+
 template <typename RHS, RHS rhs, typename LHS>
 bool greater_than_impl(
   typename std::enable_if<
@@ -518,7 +527,9 @@ FOLLY_ASSUME_FBVECTOR_COMPATIBLE_1(boost::shared_ptr);
   template <typename, typename> class classname; \
   FOLLY_CREATE_HAS_MEMBER_FN_TRAITS_IMPL(classname, func_name, ); \
   FOLLY_CREATE_HAS_MEMBER_FN_TRAITS_IMPL(classname, func_name, const); \
-  FOLLY_CREATE_HAS_MEMBER_FN_TRAITS_IMPL(classname, func_name, volatile); \
-  FOLLY_CREATE_HAS_MEMBER_FN_TRAITS_IMPL(classname, func_name, volatile const)
+  FOLLY_CREATE_HAS_MEMBER_FN_TRAITS_IMPL( \
+      classname, func_name, /* nolint */ volatile); \
+  FOLLY_CREATE_HAS_MEMBER_FN_TRAITS_IMPL( \
+      classname, func_name, /* nolint */ volatile const)
 
 #endif //FOLLY_BASE_TRAITS_H_