From: Jonathan Wakely Date: Thu, 24 Oct 2019 12:54:50 +0000 (+0100) Subject: Do not declare std::uses_allocator before C++11 X-Git-Tag: releases/gcc-9.3.0~486 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8fa40f2cc3616f39a94ff58d95c4c4421fd39e2a;p=thirdparty%2Fgcc.git 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 --- 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 (