Commit 2f1ac690 authored by Mark Santaniello's avatar Mark Santaniello Committed by Facebook Github Bot 9

Suppress new GCC 5 warning -Wbool-compare

Summary: This -Wbool-compare is apparently new in GCC 5.  We should ignore it, similar to the existing suppression of -Wsign-compare.

Reviewed By: pixelb, yfeldblum

Differential Revision: D3293675

fbshipit-source-id: 5f90b0dbf049a06c0f6c3df2cdfcc8055358e367
parent 2b6dd2e5
...@@ -337,10 +337,13 @@ struct is_negative_impl<T, false> { ...@@ -337,10 +337,13 @@ struct is_negative_impl<T, false> {
// folly::to integral specializations can end up generating code // folly::to integral specializations can end up generating code
// inside what are really static ifs (not executed because of the templated // 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 // types) that violate -Wsign-compare and/or -Wbool-compare so suppress them
// all calling code from using it. // in order to not prevent all calling code from using it.
#pragma GCC diagnostic push #pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wsign-compare" #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> template <typename RHS, RHS rhs, typename LHS>
bool less_than_impl(LHS const lhs) { bool less_than_impl(LHS const lhs) {
...@@ -350,8 +353,6 @@ bool less_than_impl(LHS const lhs) { ...@@ -350,8 +353,6 @@ bool less_than_impl(LHS const lhs) {
lhs < rhs; lhs < rhs;
} }
#pragma GCC diagnostic pop
template <typename RHS, RHS rhs, typename LHS> template <typename RHS, RHS rhs, typename LHS>
bool greater_than_impl(LHS const lhs) { bool greater_than_impl(LHS const lhs) {
return return
...@@ -360,6 +361,8 @@ bool greater_than_impl(LHS const lhs) { ...@@ -360,6 +361,8 @@ bool greater_than_impl(LHS const lhs) {
lhs > rhs; lhs > rhs;
} }
#pragma GCC diagnostic pop
} // namespace detail { } // namespace detail {
// same as `x < 0` // same as `x < 0`
......
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