From patchwork Fri Nov 11 05:30:59 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Wakely X-Patchwork-Id: 18472 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp555535wru; Thu, 10 Nov 2022 21:33:30 -0800 (PST) X-Google-Smtp-Source: AA0mqf4Ax03pFSLmpVmzaqaVfS5WVNTSkoQPaZjfdCCtHLVElhcyx1LTSdHp+Et0BnH+nAQPhlU/ X-Received: by 2002:a05:6402:3885:b0:461:8d98:3d6d with SMTP id fd5-20020a056402388500b004618d983d6dmr111972edb.116.1668144810495; Thu, 10 Nov 2022 21:33:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668144810; cv=none; d=google.com; s=arc-20160816; b=Ux/SQ+ekFWDdJmKYbc6Fy8TEaDvL/FZ4x1TP0Qo6XJkyJl6h5qEUNDaGdr5Z8HHj2b bFN1iePrbuBn0Supy5i/CtYdnuFq7Qm+BRqa56Ax2s5sjF1k8JqyITCK3a0yFfN6T2MJ gVdtA54g73MJPDNmr0yT+JuAm6ZTWL8/al6+HAIiA05Iyjk0syGPRfLdMGQsjKRJaCoO 16QEkDaQEMalm+Mk5dONmZ6e29DWnfh3uz0mY79v3m6Izkkq2YnitQMXGKLuKx6rGz+Q a2BXx19D7u3F1mH19rTzSI6dnqgIUwpQwVr9e+ySvLXpc+KbIuyt5Avt2Ny+Dj/in02l /Ylw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:reply-to:from:list-subscribe:list-help:list-post :list-archive:list-unsubscribe:list-id:precedence :content-transfer-encoding:mime-version:message-id:date:subject:to :dmarc-filter:delivered-to:dkim-signature:dkim-filter; bh=RTi1ywGl/ly88nylri7MBWRLQlan8VZaoIvSKQHBVns=; b=b4cFx7wF/mwY284KCSXvQbuaPFqdGrttcurTSTF5U96/eT7oB78Aeq+QPtj0YR4s0b oXbSZsmxyfRT8EKWC2DVLbBt5epxMWBwOPX0hCBmVtPx+LeiWOi7/c/a7lbRvED1nqhV UVZXccB6e1g7nnBXilDqkRswMLN4yM9QXqcS7veV7A5GSp1HKFFbdYevQvZAYFfgrrBx ExrnZk/QPeR0cxvvT/W4XwsQVqXtKovzff3zteF1AdyGSQVpXixnzhdIX99smK6REwbk z9nop1UHkdjjJVcVnwazFpbHY7ik4MsJcOxlpfn3J/u+JxzV8gnx9AGuxgxerYzGEvNv wnlA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=KovZOjcT; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id eb6-20020a0564020d0600b0045d0660a039si1774897edb.316.2022.11.10.21.33.30 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Nov 2022 21:33:30 -0800 (PST) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=KovZOjcT; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 79BE1381E5DF for ; Fri, 11 Nov 2022 05:32:36 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 79BE1381E5DF DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1668144756; bh=RTi1ywGl/ly88nylri7MBWRLQlan8VZaoIvSKQHBVns=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=KovZOjcT0VJpUcmnkGMXGRRd19Nvx6HQHxgfSEeDHDv/TXkbGoN2l29sc1itdEtzk Zj8nrqE8yqTaeOGiqwX9vJ2tctb54k9hOfgy694i6ooE9jcIZ5utVVwL6SuL8DxgCe bfccjga5+KARqaSe196Z1R7S5N9K1vs44aD1rAj8= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id 7D147382E80C for ; Fri, 11 Nov 2022 05:31:05 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 7D147382E80C Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-213-DYtvPM8jNAORth7FR9N0CA-1; Fri, 11 Nov 2022 00:31:01 -0500 X-MC-Unique: DYtvPM8jNAORth7FR9N0CA-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id BE6E81C051A8; Fri, 11 Nov 2022 05:31:00 +0000 (UTC) Received: from localhost (unknown [10.33.36.199]) by smtp.corp.redhat.com (Postfix) with ESMTP id 87D42C19145; Fri, 11 Nov 2022 05:31:00 +0000 (UTC) To: libstdc++@gcc.gnu.org, gcc-patches@gcc.gnu.org Subject: [committed] libstdc++: Add missing definition for in C++14 mode Date: Fri, 11 Nov 2022 05:30:59 +0000 Message-Id: <20221111053059.563909-1-jwakely@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.8 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-12.2 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Jonathan Wakely via Gcc-patches From: Jonathan Wakely Reply-To: Jonathan Wakely Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1749176612456900154?= X-GMAIL-MSGID: =?utf-8?q?1749176612456900154?= Tested x86_64-linux. Pushed to trunk. -- >8 -- We support 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 + 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