Kaydet (Commit) d84bf553 authored tarafından Stephan Bergmann's avatar Stephan Bergmann

Silence external/boost deprecated std::iterator warnings with MSVC 2017

At least cl version 19.14.26433 generates such warning C4996 now.  While the one
about the using declaration in boost/iterator.hpp looks somewhat bogus, the one
in boost/circular_buffer/details.hpp is about an actual use of std::iterator as
a base class in Boost-internal code.  If further such places in external/boost
crop up that need fixing, an alternative approach could be to extend the
external/boost/include/ wrappers to be also used with MSVC.  (Globally setting
_SILENCE_CXX17_ITERATOR_BASE_CLASS_DEPRECATION_WARNING has avoided, as it also
finds uses in our own code that should be fixed, like
58222feb "warning STL4015: std::iterator is
deprecated (clang-cl)".)

Change-Id: I6a41421a590fcee57b4ac8bcb7c3631fdfdecb81
Reviewed-on: https://gerrit.libreoffice.org/58755
Tested-by: Jenkins
Reviewed-by: 's avatarStephan Bergmann <sbergman@redhat.com>
üst ffc61735
......@@ -40,6 +40,8 @@ boost_patches += windows-no-utf8-locales.patch.0
boost_patches += gcc9.patch.0
boost_patches += msvc2017.patch.0
$(eval $(call gb_UnpackedTarball_UnpackedTarball,boost))
$(eval $(call gb_UnpackedTarball_set_tarball,boost,$(BOOST_TARBALL)))
......
--- boost/circular_buffer/details.hpp
+++ boost/circular_buffer/details.hpp
@@ -216,12 +216,19 @@
// Helper types
//! Base iterator.
+#if defined _MSC_VER && !defined __clang__ && _MSC_VER == 1914
+#pragma warning(push)
+#pragma warning(disable: 4996)
+#endif
typedef std::iterator<
std::random_access_iterator_tag,
typename Traits::value_type,
typename Traits::difference_type,
typename Traits::pointer,
typename Traits::reference> base_iterator;
+#if defined _MSC_VER && !defined __clang__ && _MSC_VER == 1914
+#pragma warning(pop)
+#endif
//! Non-const iterator.
typedef iterator<Buff, typename Traits::nonconst_self> nonconst_self;
--- boost/iterator.hpp
+++ boost/iterator.hpp
@@ -13,7 +13,14 @@
namespace boost
{
+#if defined _MSC_VER && !defined __clang__ && _MSC_VER == 1914
+#pragma warning(push)
+#pragma warning(disable: 4996)
+#endif
using std::iterator;
+#if defined _MSC_VER && !defined __clang__ && _MSC_VER == 1914
+#pragma warning(pop)
+#endif
} // namespace boost
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