X-Git-Url: http://plrg.eecs.uci.edu/git/?a=blobdiff_plain;f=folly%2FTraits.h;h=14e02f5a1f1e2691d36ad72f9150035e3f3b0e68;hb=69433ef3053ca1635c99dc1da712af8784200063;hp=132e0f2b4a0b9aa73365886f1b5098591bc169f8;hpb=7d8fbeb8b9a69cee2a2f26c977ffb3f2b7b6fa92;p=folly.git diff --git a/folly/Traits.h b/folly/Traits.h index 132e0f2b..14e02f5a 100644 --- a/folly/Traits.h +++ b/folly/Traits.h @@ -340,6 +340,13 @@ struct is_negative_impl { 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 bool less_than_impl( typename std::enable_if< @@ -371,6 +378,8 @@ bool less_than_impl( return false; } +#pragma GCC diagnostic pop + template bool greater_than_impl( typename std::enable_if<