[gcc/devel/omp/gcc-9] Do not declare std::uses_allocator before C++11
Tobias Burnus
burnus@gcc.gnu.org
Thu Mar 5 14:14:00 GMT 2020
https://gcc.gnu.org/g:8fa40f2cc3616f39a94ff58d95c4c4421fd39e2a
commit 8fa40f2cc3616f39a94ff58d95c4c4421fd39e2a
Author: Jonathan Wakely <jwakely@redhat.com>
Date: Thu Oct 24 13:54:50 2019 +0100
Do not declare std::uses_allocator before C++11
Backport from mainline
2019-10-22 Jonathan Wakely <jwakely@redhat.com>
* 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:
---
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 00cab77..fe6c649 100644
--- a/libstdc++-v3/ChangeLog
+++ b/libstdc++-v3/ChangeLog
@@ -1,6 +1,12 @@
2019-10-24 Jonathan Wakely <jwakely@redhat.com>
Backport from mainline
+ 2019-10-22 Jonathan Wakely <jwakely@redhat.com>
+
+ * 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 <jwakely@redhat.com>
PR libstdc++/92143
diff --git a/libstdc++-v3/include/bits/memoryfwd.h b/libstdc++-v3/include/bits/memoryfwd.h
index 8b1664a..732ac80 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<void>;
+#if __cplusplus >= 201103L
/// Declare uses_allocator so it can be specialized in \<queue\> etc.
template<typename, typename>
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 66c639f..a47d535 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
// <charconv> defines to_chars_result::ptr and to_chars_result::ec
#define ec (
More information about the Libstdc++-cvs
mailing list