summaryrefslogtreecommitdiff
path: root/external/boost
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2015-12-01 12:56:04 +0100
committerStephan Bergmann <sbergman@redhat.com>2015-12-02 08:02:27 +0100
commit0c70c7d3df63fe88015c992a088c06c590185fcd (patch)
tree3731546082f751b29c910b7fabaebe1b64c0f003 /external/boost
parent5d7e556e478a5a301fd046c893542dabef36d82c (diff)
external/boost: Work around -Werror,-Winvalid-constexpr
Change-Id: I819be5efb25632d26fe49a71dbc07fe16e4914b1
Diffstat (limited to 'external/boost')
-rw-r--r--external/boost/clang-cl.patch.042
1 files changed, 42 insertions, 0 deletions
diff --git a/external/boost/clang-cl.patch.0 b/external/boost/clang-cl.patch.0
index 0dd44d4a3678..6713dc041924 100644
--- a/external/boost/clang-cl.patch.0
+++ b/external/boost/clang-cl.patch.0
@@ -1,3 +1,45 @@
+# clang-cl supports constexpr, so BOOST_CHRONO_LIB_CONSTEXPR expands to
+# "constexpr", but MSVC's std::numeric_limits<>::max() isn't marked as
+# constexpr, so clang-cl issues -Winvalid-constexpr:
+--- boost/chrono/duration.hpp
++++ boost/chrono/duration.hpp
+@@ -348,29 +348,36 @@
+ static BOOST_CHRONO_LIB_CONSTEXPR T lowest() BOOST_CHRONO_LIB_NOEXCEPT_OR_THROW {return (std::numeric_limits<T>::min) ();}
+ };
+
++#if defined _MSC_VER && defined __clang__
++#pragma clang diagnostic push
++#pragma clang diagnostic ignored "-Winvalid-constexpr"
++#endif
+ template <>
+ struct chrono_numeric_limits<float,true> {
+ static BOOST_CHRONO_LIB_CONSTEXPR float lowest() BOOST_CHRONO_LIB_NOEXCEPT_OR_THROW
+ {
+ return -(std::numeric_limits<float>::max) ();
+ }
+ };
+
+ template <>
+ struct chrono_numeric_limits<double,true> {
+ static BOOST_CHRONO_LIB_CONSTEXPR double lowest() BOOST_CHRONO_LIB_NOEXCEPT_OR_THROW
+ {
+ return -(std::numeric_limits<double>::max) ();
+ }
+ };
+
+ template <>
+ struct chrono_numeric_limits<long double,true> {
+ static BOOST_CHRONO_LIB_CONSTEXPR long double lowest() BOOST_CHRONO_LIB_NOEXCEPT_OR_THROW
+ {
+ return -(std::numeric_limits<long double>::max)();
+ }
+ };
++#if defined _MSC_VER && defined __clang__
++#pragma clang diagnostic pop
++#endif
+
+ template <class T>
+ struct numeric_limits : chrono_numeric_limits<typename remove_cv<T>::type>
--- boost/config/compiler/clang.hpp
+++ boost/config/compiler/clang.hpp
@@ -260,9 +260,7 @@