From: Jonathan Wakely Date: Tue, 22 Oct 2019 21:48:53 +0000 (+0100) Subject: Do not declare std::uses_allocator before C++11 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=9e1f9bc54496c65a11987dc7c238c84878d10062;p=gcc.git Do not declare std::uses_allocator before C++11 * include/bits/memoryfwd.h (uses_allocator): Do not declare for C++98. * testsuite/17_intro/names.cc: Check uses_allocator in C++98. From-SVN: r277301 --- diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index f5d2a0189e4..6ffe6fa12b5 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,5 +1,8 @@ 2019-10-22 Jonathan Wakely + * include/bits/memoryfwd.h (uses_allocator): Do not declare for C++98. + * testsuite/17_intro/names.cc: Check uses_allocator in C++98. + * include/bits/alloc_traits.h (allocator_traits>::allocate): Ignore hint for C++20. (allocator_traits>::construct): Perform placement new diff --git a/libstdc++-v3/include/bits/memoryfwd.h b/libstdc++-v3/include/bits/memoryfwd.h index d42eabeceb8..6542adc1cdd 100644 --- a/libstdc++-v3/include/bits/memoryfwd.h +++ b/libstdc++-v3/include/bits/memoryfwd.h @@ -68,9 +68,11 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION class allocator; #endif +#if __cplusplus >= 201103L /// Declare uses_allocator so it can be specialized in \ etc. template struct uses_allocator; +#endif /// @} group memory diff --git a/libstdc++-v3/testsuite/17_intro/names.cc b/libstdc++-v3/testsuite/17_intro/names.cc index 3d6148fa0e8..81a1d6fdf46 100644 --- a/libstdc++-v3/testsuite/17_intro/names.cc +++ b/libstdc++-v3/testsuite/17_intro/names.cc @@ -103,6 +103,10 @@ #define tmp ( +#if __cplusplus < 201103L +#define uses_allocator ( +#endif + #if __cplusplus < 201703L // defines to_chars_result::ptr and to_chars_result::ec #define ec (