summaryrefslogtreecommitdiff
path: root/boost/variant/get.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'boost/variant/get.hpp')
-rw-r--r--boost/variant/get.hpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/boost/variant/get.hpp b/boost/variant/get.hpp
index fd702ba60c..abce6c4664 100644
--- a/boost/variant/get.hpp
+++ b/boost/variant/get.hpp
@@ -173,6 +173,12 @@ relaxed_get(
}
#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES
+
+#if defined(BOOST_MSVC) && (_MSC_VER < 1900) // MSVC-2014 has fixed the incorrect diagnostics.
+# pragma warning(push)
+# pragma warning(disable: 4172) // returning address of local variable or temporary
+#endif
+
template <typename U, BOOST_VARIANT_ENUM_PARAMS(typename T) >
inline
U&&
@@ -188,6 +194,11 @@ relaxed_get(
boost::throw_exception(bad_get());
return static_cast<U&&>(*result);
}
+
+#if defined(BOOST_MSVC) && (_MSC_VER < 1900)
+# pragma warning(pop)
+#endif
+
#endif
/////////////////////////////////////////////////////////////////////////////////////////////////////////////