From: Jonathan Wakely <jwakely@redhat.com>
To: libstdc++@gcc.gnu.org, gcc-patches@gcc.gnu.org
Subject: [PATCH] Do not declare std::uses_allocator before C++11
Date: Tue, 22 Oct 2019 22:09:00 -0000 [thread overview]
Message-ID: <20191022220450.GN4169@redhat.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 272 bytes --]
* include/bits/memoryfwd.h (uses_allocator): Do not declare for C++98.
* testsuite/17_intro/names.cc: Check uses_allocator in C++98.
Tested powerpc64le-linux, committed to trunk.
This should be backported too, as it should never have been declared
for C++98.
[-- Attachment #2: patch.txt --]
[-- Type: text/plain, Size: 1333 bytes --]
commit cdbab4a65ff6fdbe44196a5903b27d06075e60e5
Author: Jonathan Wakely <jwakely@redhat.com>
Date: Tue Oct 22 22:39:16 2019 +0100
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.
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<void>;
#endif
+#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 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
// <charconv> defines to_chars_result::ptr and to_chars_result::ec
#define ec (
reply other threads:[~2019-10-22 22:05 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20191022220450.GN4169@redhat.com \
--to=jwakely@redhat.com \
--cc=gcc-patches@gcc.gnu.org \
--cc=libstdc++@gcc.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).