From 8fa40f2cc3616f39a94ff58d95c4c4421fd39e2a Mon Sep 17 00:00:00 2001 From: Jonathan Wakely Date: Thu, 24 Oct 2019 13:54:50 +0100 Subject: [PATCH] Do not declare std::uses_allocator before C++11 Backport from mainline 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. From-SVN: r277387 --- libstdc++-v3/ChangeLog | 6 ++++++ libstdc++-v3/include/bits/memoryfwd.h | 2 ++ libstdc++-v3/testsuite/17_intro/names.cc | 4 ++++ 3 files changed, 12 insertions(+) diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 00cab7704174..fe6c649aece6 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,5 +1,11 @@ 2019-10-24 Jonathan Wakely + Backport from mainline + 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. + Backport from mainline 2019-10-18 Jonathan Wakely diff --git a/libstdc++-v3/include/bits/memoryfwd.h b/libstdc++-v3/include/bits/memoryfwd.h index 8b1664a398d5..732ac805322d 100644 --- a/libstdc++-v3/include/bits/memoryfwd.h +++ b/libstdc++-v3/include/bits/memoryfwd.h @@ -66,9 +66,11 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION template<> class allocator; +#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 66c639ff3a33..a47d53503e3f 100644 --- a/libstdc++-v3/testsuite/17_intro/names.cc +++ b/libstdc++-v3/testsuite/17_intro/names.cc @@ -100,6 +100,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 ( -- 2.47.2