1
0
forked from boostorg/core

Deprecated boost/iterator.hpp, emit warnings on inclusion.

The header defines boost::iterator template, which is an alias for
std::iterator, which is itself deprecated since C++17.

Updated test to avoid testing the definition in C++17 onwards
to avoid failures due to deprecation warnings from libc++-13.
This commit is contained in:
Andrey Semashev
2021-12-23 16:41:32 +03:00
parent 06976ccad7
commit 6ae6ff79f1
3 changed files with 19 additions and 1 deletions

View File

@@ -8,8 +8,15 @@
// http://www.boost.org/LICENSE_1_0.txt
//
#define BOOST_ALLOW_DEPRECATED_HEADERS
#define _SILENCE_CXX17_ITERATOR_BASE_CLASS_DEPRECATION_WARNING
#include <boost/config.hpp>
// std::iterator template is deprecated in C++17. Some standard libraries emit warnings
// that cannot be easily suppressed, so disable the tests in C++17 onwards.
#if BOOST_CXX_VERSION < 201703
#include <boost/iterator.hpp>
#include <boost/core/is_same.hpp>
#include <boost/core/lightweight_test_trait.hpp>
@@ -69,3 +76,11 @@ int main()
return boost::report_errors();
}
#else // BOOST_CXX_VERSION < 201703
int main()
{
}
#endif // BOOST_CXX_VERSION < 201703