// 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.
+// types) that violate -Wsign-compare and/or -Wbool-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"
+#if __GNUC_PREREQ(5, 0)
+#pragma GCC diagnostic ignored "-Wbool-compare"
+#endif
template <typename RHS, RHS rhs, typename LHS>
bool less_than_impl(LHS const lhs) {
lhs < rhs;
}
-#pragma GCC diagnostic pop
-
template <typename RHS, RHS rhs, typename LHS>
bool greater_than_impl(LHS const lhs) {
return
lhs > rhs;
}
+#pragma GCC diagnostic pop
+
} // namespace detail {
// same as `x < 0`