public inbox for libstdc++@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jonathan Wakely <jwakely@redhat.com>
To: libstdc++@gcc.gnu.org, gcc-patches@gcc.gnu.org
Subject: [committed] libstdc++: Add missing definition for <charconv> in C++14 mode
Date: Fri, 11 Nov 2022 05:30:59 +0000	[thread overview]
Message-ID: <20221111053059.563909-1-jwakely@redhat.com> (raw)

Tested x86_64-linux. Pushed to trunk.

-- >8 --

We support <charconv> in C++14 as an extension, but that means that
constexpr static data members are not implicitly inline. Add an
out-of-class definition for C++14 mode.

This fixes a FAIL when -std=gnu++14 is used:
FAIL: 20_util/from_chars/1.cc (test for excess errors)

libstdc++-v3/ChangeLog:

	* include/std/charconv (__from_chars_alnum_to_val_table::value):
	[!__cpp_inline_variables]: Add non-inline definition.
---
 libstdc++-v3/include/std/charconv | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/libstdc++-v3/include/std/charconv b/libstdc++-v3/include/std/charconv
index 09163af7fc9..acad865f8aa 100644
--- a/libstdc++-v3/include/std/charconv
+++ b/libstdc++-v3/include/std/charconv
@@ -444,6 +444,12 @@ namespace __detail
       static constexpr type value = (_DecOnly, _S_make_table());
     };
 
+#if ! __cpp_inline_variables
+  template<bool _DecOnly>
+    const typename __from_chars_alnum_to_val_table<_DecOnly>::type
+      __from_chars_alnum_to_val_table<_DecOnly>::value;
+#endif
+
   // If _DecOnly is true: if the character is a decimal digit, then
   // return its corresponding base-10 value, otherwise return a value >= 127.
   // If _DecOnly is false: if the character is an alphanumeric digit, then
-- 
2.38.1


                 reply	other threads:[~2022-11-11  5:31 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=20221111053059.563909-1-jwakely@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).