public inbox for libstdc++-cvs@sourceware.org
help / color / mirror / Atom feed
From: Tamar Christina <tnfchris@gcc.gnu.org>
To: gcc-cvs@gcc.gnu.org, libstdc++-cvs@gcc.gnu.org
Subject: [gcc(refs/vendors/ARM/heads/arm-struct-reorg-wip)] libstdc++: Add comment to <charconv> explaining C++14 status
Date: Fri, 17 Jul 2020 12:56:18 +0000 (GMT)	[thread overview]
Message-ID: <20200717125618.DFCF6398E4A5@sourceware.org> (raw)

https://gcc.gnu.org/g:cfbc8fbb37e7b406ab2567ac35629793d4b499e7

commit cfbc8fbb37e7b406ab2567ac35629793d4b499e7
Author: Jonathan Wakely <jwakely@redhat.com>
Date:   Mon Feb 17 15:44:03 2020 +0000

    libstdc++: Add comment to <charconv> explaining C++14 status
    
    This header is intentionally valid in C++14 mode, because no conforming
    C++14 program will try to include <charconv> and so it's OK to add new
    (non-reserved in C++14) names to namespace std. However, other headers
    must not include <charconv> transitively prior to C++17, so that we
    don't add those non-reserved names without the user requesting it.
    
    This adds a comment to the header explaining that.
    
            * include/std/charconv: Add comment.

Diff:
---
 libstdc++-v3/ChangeLog            | 2 ++
 libstdc++-v3/include/std/charconv | 4 ++++
 2 files changed, 6 insertions(+)

diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog
index f4477aaa6f2..4556f17f7b7 100644
--- a/libstdc++-v3/ChangeLog
+++ b/libstdc++-v3/ChangeLog
@@ -1,5 +1,7 @@
 2020-02-17  Jonathan Wakely  <jwakely@redhat.com>
 
+	* include/std/charconv: Add comment.
+
 	PR libstdc++/92546 (partial)
 	* include/bits/random.h (uniform_random_bit_generator): Move definition
 	to <bits/uniform_int_dist.h>.
diff --git a/libstdc++-v3/include/std/charconv b/libstdc++-v3/include/std/charconv
index 9b5a1f7cab8..ff7dfa12268 100644
--- a/libstdc++-v3/include/std/charconv
+++ b/libstdc++-v3/include/std/charconv
@@ -31,6 +31,10 @@
 
 #pragma GCC system_header
 
+// As an extension we support <charconv> in C++14, but this header should not
+// be included by any other library headers in C++14 mode. This ensures that
+// the names defined in this header are not added to namespace std unless a
+// user explicitly includes <charconv> in C++14 code.
 #if __cplusplus >= 201402L
 
 #include <type_traits>


                 reply	other threads:[~2020-07-17 12:56 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=20200717125618.DFCF6398E4A5@sourceware.org \
    --to=tnfchris@gcc.gnu.org \
    --cc=gcc-cvs@gcc.gnu.org \
    --cc=libstdc++-cvs@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).