libstdc++: Add comment to <charconv> explaining C++14 status
authorJonathan Wakely <jwakely@redhat.com>
Mon, 17 Feb 2020 15:44:03 +0000 (15:44 +0000)
committerJonathan Wakely <jwakely@redhat.com>
Mon, 17 Feb 2020 15:44:03 +0000 (15:44 +0000)
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.

libstdc++-v3/ChangeLog
libstdc++-v3/include/std/charconv

index f4477aa..4556f17 100644 (file)
@@ -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>.
index 9b5a1f7..ff7dfa1 100644 (file)
 
 #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>