[{"id":3673086,"web_url":"http://patchwork.ozlabs.org/comment/3673086/","msgid":"<CAKvuMXDKTKfe0h6AfC6ei42AL3av+zdaMmKVxgbn02pWyPHsHg@mail.gmail.com>","list_archive_url":null,"date":"2026-04-03T11:49:50","subject":"Re: [PATCH] libstdc++: Export explicit instantiations of\n __format::__do_vformat_to.","submitter":{"id":90409,"url":"http://patchwork.ozlabs.org/api/people/90409/","name":"Tomasz Kamiński","email":"tkaminsk@redhat.com"},"content":"On Fri, Apr 3, 2026 at 1:48 PM Tomasz Kamiński <tkaminsk@redhat.com> wrote:\n\n> This patch exports instantiations of __format::__do_vformat_to\n> for _Sink_iter and char/wchar_t. As every format function is\n> implementing as delegating the one of these overloads, this\n> significantly reduces the compliation time.\n>\n> Instantiating __format::__do_vformat_to triggers specializations\n> of formatters for types stored in handle direclty (arithmetic\n> types, strings), however we do not export any of their symbols.\n> This keeps the interface boundary minimal. This file should\n> be recompiled in later mode, when it is called stable.\n>\n> libstdc++-v3/ChangeLog:\n>\n>         * config/abi/pre/gnu.ver (GLIBCXX_3.4): Exclude exports\n>         of std::basic_fo* (matching basic_format_context).\n>         (GLIBCXX_3.4.35): Export __format::__do_vformat_to\n>         specializations for _Sink_iter and char/wchar_t.\n>         * include/std/format: (__format::__do_vformat_to):\n>         Remove inline and declare extern instantiation\n>         of __format::__do_vformat_to _Sink_iter and char/wchar_t.\n>         * src/c++20/Makefile.am: Add format-inst.cc.\n>         * src/c++20/Makefile.in: Regenerate.\n>         * src/c++20/format-inst.cc: New file defining explicit\n>         instantiation.\n> ---\n> From simple test on files from testsuite/std/format/functions/, the\n> results looks very promising:\n>\n>                 Before  After\n> format.cc       24.203s 10.846s\n> format_to.cc    18.475s 2.844s\n> format_to_n.cc  18.677s 3.074s\n> vformat_to.cc   17.281s 2.246s\n>\n> However, I am a bit concerned if the approach works, as\n> libstdc++.so will always contains weak simbol for __do_vformat_to\n> for _Sink_iter<char>, that supports only C++20 specifiers.\n> Should we instead compile the format-inst in latest mode, and\n> always provide extern defintion?\n> Note that the same problem will also be present for the print function,\n> but I haven not realized it then.\n>\nThe scenarios like that are not only teoreticall, debug support (?) for\nstring and char was recently added.\n\n>\n> I plan to do similar change for __formatter_chrono<char>::_M_format\n> functions (entry point).\n>\n>\n>  libstdc++-v3/config/abi/pre/gnu.ver   |  8 ++++-\n>  libstdc++-v3/include/std/format       | 13 +++++++-\n>  libstdc++-v3/src/c++20/Makefile.am    |  3 +-\n>  libstdc++-v3/src/c++20/Makefile.in    |  6 ++--\n>  libstdc++-v3/src/c++20/format-inst.cc | 46 +++++++++++++++++++++++++++\n>  5 files changed, 71 insertions(+), 5 deletions(-)\n>  create mode 100644 libstdc++-v3/src/c++20/format-inst.cc\n>\n> diff --git a/libstdc++-v3/config/abi/pre/gnu.ver\n> b/libstdc++-v3/config/abi/pre/gnu.ver\n> index fb968e122d8..2b391584c94 100644\n> --- a/libstdc++-v3/config/abi/pre/gnu.ver\n> +++ b/libstdc++-v3/config/abi/pre/gnu.ver\n> @@ -34,7 +34,9 @@ GLIBCXX_3.4 {\n>        std::basic_[a-e]*;\n>        std::basic_f[a-h]*;\n>  #     std::basic_filebuf;\n> -      std::basic_f[j-r]*;\n> +      std::basic_f[j-n]*;\n> +#     std::basic_format_context;\n> +      std::basic_f[p-r]*;\n>  #     std::basic_fstream;\n>        std::basic_f[t-z]*;\n>        std::basic_[g-h]*;\n> @@ -2587,6 +2589,10 @@ GLIBCXX_3.4.35 {\n>      _ZNSt12__cow_stringaSEOS_;\n>      _ZNKSt12__cow_string5c_strEv;\n>\n> +    # __format::__do_vformat_to(_Sink_iter<char>, string_view, const\n> format_args&, const locale*);\n> +    # __format::__do_vformat_to(_Sink_iter<wchar_t>, wstring_view, const\n> wformat_args&, const locale*);\n> +\n> _ZNSt8__format15__do_vformat_toINS_10_Sink_iterI[wc]EE[wc]St20basic_format_contextIS2_[wc]EEET_S5_St17basic_string_viewIT0_St11char_traitsIS7_EERKSt17basic_format_argsIT1_EPKSt6locale;\n> +\n>  #if defined (_WIN32) && !defined (__CYGWIN__)\n>      _ZSt19__get_once_callablev;\n>      _ZSt15__get_once_callv;\n> diff --git a/libstdc++-v3/include/std/format\n> b/libstdc++-v3/include/std/format\n> index eca5bd213aa..2a8229a2eb5 100644\n> --- a/libstdc++-v3/include/std/format\n> +++ b/libstdc++-v3/include/std/format\n> @@ -5220,7 +5220,7 @@ namespace __format\n>      };\n>\n>    template<typename _Out, typename _CharT, typename _Context>\n> -    inline _Out\n> +    _Out\n>      __do_vformat_to(_Out __out, basic_string_view<_CharT> __fmt,\n>                     const basic_format_args<_Context>& __args,\n>                     const locale* __loc)\n> @@ -5310,6 +5310,17 @@ namespace __format\n>         }\n>      }\n>\n> +#if __cplusplus <= 202002L && _GLIBCXX_EXTERN_TEMPLATE > 0\n> +    extern template _Sink_iter<char>\n> +      __do_vformat_to(_Sink_iter<char>, string_view,\n> +                     const format_args&, const locale*);\n> +# ifdef _GLIBCXX_USE_WCHAR_T\n> +    extern template _Sink_iter<wchar_t>\n> +      __do_vformat_to(_Sink_iter<wchar_t>, wstring_view,\n> +                     const wformat_args&, const locale*);\n> +# endif\n> +#endif\n> +\n>    template<typename _Out, typename _CharT>\n>      format_to_n_result<_Out>\n>      __do_vformat_to_n(_Out __out, iter_difference_t<_Out> __n,\n> diff --git a/libstdc++-v3/src/c++20/Makefile.am\n> b/libstdc++-v3/src/c++20/Makefile.am\n> index 0061678dc0f..7744fa43a63 100644\n> --- a/libstdc++-v3/src/c++20/Makefile.am\n> +++ b/libstdc++-v3/src/c++20/Makefile.am\n> @@ -30,7 +30,8 @@ headers =\n>  if ENABLE_EXTERN_TEMPLATE\n>  # XTEMPLATE_FLAGS = -fno-implicit-templates\n>  inst_sources = \\\n> -       sstream-inst.cc\n> +       sstream-inst.cc \\\n> +       format-inst.cc\n>  else\n>  # XTEMPLATE_FLAGS =\n>  inst_sources =\n> diff --git a/libstdc++-v3/src/c++20/Makefile.in\n> b/libstdc++-v3/src/c++20/Makefile.in\n> index f481ad08edb..566d7292021 100644\n> --- a/libstdc++-v3/src/c++20/Makefile.in\n> +++ b/libstdc++-v3/src/c++20/Makefile.in\n> @@ -124,7 +124,8 @@ CONFIG_CLEAN_VPATH_FILES =\n>  LTLIBRARIES = $(noinst_LTLIBRARIES)\n>  libc__20convenience_la_LIBADD =\n>  am__objects_1 = tzdb.lo format.lo atomic.lo clock.lo syncbuf.lo\n> -@ENABLE_EXTERN_TEMPLATE_TRUE@am__objects_2 = sstream-inst.lo\n> +@ENABLE_EXTERN_TEMPLATE_TRUE@am__objects_2 = sstream-inst.lo \\\n> +@ENABLE_EXTERN_TEMPLATE_TRUE@  format-inst.lo\n>  @GLIBCXX_HOSTED_TRUE@am_libc__20convenience_la_OBJECTS =  \\\n>  @GLIBCXX_HOSTED_TRUE@  $(am__objects_1) $(am__objects_2)\n>  libc__20convenience_la_OBJECTS = $(am_libc__20convenience_la_OBJECTS)\n> @@ -433,7 +434,8 @@ headers =\n>\n>  # XTEMPLATE_FLAGS = -fno-implicit-templates\n>  @ENABLE_EXTERN_TEMPLATE_TRUE@inst_sources = \\\n> -@ENABLE_EXTERN_TEMPLATE_TRUE@  sstream-inst.cc\n> +@ENABLE_EXTERN_TEMPLATE_TRUE@  sstream-inst.cc \\\n> +@ENABLE_EXTERN_TEMPLATE_TRUE@  format-inst.cc\n>\n>  sources = tzdb.cc format.cc atomic.cc clock.cc syncbuf.cc\n>  @GLIBCXX_HOSTED_FALSE@libc__20convenience_la_SOURCES =\n> diff --git a/libstdc++-v3/src/c++20/format-inst.cc\n> b/libstdc++-v3/src/c++20/format-inst.cc\n> new file mode 100644\n> index 00000000000..1904de35f7b\n> --- /dev/null\n> +++ b/libstdc++-v3/src/c++20/format-inst.cc\n> @@ -0,0 +1,46 @@\n> +// Definitions for <chrono> formatting -*- C++ -*-\n> +\n> +// Copyright The GNU Toolchain Authors.\n> +//\n> +// This file is part of the GNU ISO C++ Library.  This library is free\n> +// software; you can redistribute it and/or modify it under the\n> +// terms of the GNU General Public License as published by the\n> +// Free Software Foundation; either version 3, or (at your option)\n> +// any later version.\n> +\n> +// This library is distributed in the hope that it will be useful,\n> +// but WITHOUT ANY WARRANTY; without even the implied warranty of\n> +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n> +// GNU General Public License for more details.\n> +\n> +// Under Section 7 of GPL version 3, you are granted additional\n> +// permissions described in the GCC Runtime Library Exception, version\n> +// 3.1, as published by the Free Software Foundation.\n> +\n> +// You should have received a copy of the GNU General Public License and\n> +// a copy of the GCC Runtime Library Exception along with this program;\n> +// see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see\n> +// <http://www.gnu.org/licenses/>.\n> +\n> +#include <format>\n> +#include <chrono>\n> +\n> +namespace std\n> +{\n> +_GLIBCXX_BEGIN_NAMESPACE_VERSION\n> +namespace __format\n> +{\n> +\n> + template _Sink_iter<char>\n> +   __do_vformat_to(_Sink_iter<char>, string_view,\n> +                  const format_args&, const locale*);\n> +\n> +# ifdef _GLIBCXX_USE_WCHAR_T\n> + template _Sink_iter<wchar_t>\n> +   __do_vformat_to(_Sink_iter<wchar_t>, wstring_view,\n> +                  const wformat_args&, const locale*);\n> +# endif\n> +\n> +} // namespace __format\n> +_GLIBCXX_END_NAMESPACE_VERSION\n> +} // namespace std\n> --\n> 2.53.0\n>\n>","headers":{"Return-Path":"<gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org>","X-Original-To":["incoming@patchwork.ozlabs.org","gcc-patches@gcc.gnu.org"],"Delivered-To":["patchwork-incoming@legolas.ozlabs.org","gcc-patches@gcc.gnu.org"],"Authentication-Results":["legolas.ozlabs.org;\n\tdkim=pass (1024-bit key;\n unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256\n header.s=mimecast20190719 header.b=PLrUVLoY;\n\tdkim-atps=neutral","legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org\n (client-ip=38.145.34.32; helo=vm01.sourceware.org;\n envelope-from=gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org;\n receiver=patchwork.ozlabs.org)","sourceware.org;\n\tdkim=pass (1024-bit key,\n unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256\n header.s=mimecast20190719 header.b=PLrUVLoY","sourceware.org; dmarc=pass (p=quarantine dis=none)\n header.from=redhat.com","sourceware.org; spf=pass smtp.mailfrom=redhat.com","server2.sourceware.org;\n arc=none smtp.remote-ip=170.10.129.124"],"Received":["from vm01.sourceware.org (vm01.sourceware.org [38.145.34.32])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519 server-signature ECDSA (secp384r1) server-digest SHA384)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4fnH9f6L44z1yCs\n\tfor <incoming@patchwork.ozlabs.org>; Fri, 03 Apr 2026 22:51:01 +1100 (AEDT)","from vm01.sourceware.org (localhost [127.0.0.1])\n\tby sourceware.org (Postfix) with ESMTP id 7B1BA4BA23F2\n\tfor <incoming@patchwork.ozlabs.org>; Fri,  3 Apr 2026 11:50:59 +0000 (GMT)","from us-smtp-delivery-124.mimecast.com\n (us-smtp-delivery-124.mimecast.com [170.10.129.124])\n by sourceware.org (Postfix) with ESMTP id 9A98D4BA2E3D\n for <gcc-patches@gcc.gnu.org>; Fri,  3 Apr 2026 11:50:07 +0000 (GMT)","from mail-yw1-f198.google.com (mail-yw1-f198.google.com\n [209.85.128.198]) by relay.mimecast.com with ESMTP with STARTTLS\n (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id\n us-mta-379-o_V7OozDMz2N14Eb7BXnVA-1; Fri, 03 Apr 2026 07:50:05 -0400","by mail-yw1-f198.google.com with SMTP id\n 00721157ae682-7900fc7033bso26265307b3.1\n for <gcc-patches@gcc.gnu.org>; Fri, 03 Apr 2026 04:50:05 -0700 (PDT)"],"DKIM-Filter":["OpenDKIM Filter v2.11.0 sourceware.org 7B1BA4BA23F2","OpenDKIM Filter v2.11.0 sourceware.org 9A98D4BA2E3D"],"DMARC-Filter":"OpenDMARC Filter v1.4.2 sourceware.org 9A98D4BA2E3D","ARC-Filter":"OpenARC Filter v1.0.0 sourceware.org 9A98D4BA2E3D","ARC-Seal":"i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1775217007; cv=none;\n b=D0szmO7fplE3FTRYYXbBZ1g1L12kCqHCF1X5H2dhb++jELRQNrubKhZIlXI5bRt/PSgZ1ODhz8afC0itaOBc+5MiHb4fFuLqKIr25mF66TSeYDUQAht/n0XAJ6UL9dJpkiPBjKVIIQMXD6wq3ZH4gncmAJRPseVTeIA644tCNfU=","ARC-Message-Signature":"i=1; a=rsa-sha256; d=sourceware.org; s=key;\n t=1775217007; c=relaxed/simple;\n bh=Q1UwfcvlYnHYJXi1T06D1i9rdcrzc8doMUbTzjflFKA=;\n h=DKIM-Signature:MIME-Version:From:Date:Message-ID:Subject:To;\n b=x0y1N5BCOaoJoBqOfMWzEjb6CoaHBoRLdorcB3Oh+MWvFc+ZiDBBQMDAzh8mf+XGuQkhKO7gmsNB5eZF7xvtClAMHJAhBYTvbXEwq8rgDvRpDd5KE/zB7LbyJb6QUzOOxZOUJ6zbZVKIf+EkFX/hLIZ+s8CQF/kfcfY8lzun64s=","ARC-Authentication-Results":"i=1; server2.sourceware.org","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;\n s=mimecast20190719; t=1775217007;\n h=from:from:reply-to:subject:subject:date:date:message-id:message-id:\n to:to:cc:mime-version:mime-version:content-type:content-type:\n in-reply-to:in-reply-to:references:references;\n bh=vL8yCKlO1Acre3017C5bVS5HSTwrMRtGbF3tX+nlewc=;\n b=PLrUVLoYcbUhZzrlF0aV6yPv09RzZQiZDZwaxuWX3zbs2n8MJTje9l/h2wmzJqjQ1Qkl6m\n Hvvmm4I5wBrCgx4o6PRu2fzwq290FXf4dkLV+B7IjmaOKeTaq0ylOnKDirgNWjPkFQzYb4\n 2M34KP1JM3Ijv5JXdN6rLV2j++W7a1M=","X-MC-Unique":"o_V7OozDMz2N14Eb7BXnVA-1","X-Mimecast-MFC-AGG-ID":"o_V7OozDMz2N14Eb7BXnVA_1775217005","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20251104; t=1775217005; x=1775821805;\n h=to:subject:message-id:date:from:in-reply-to:references:mime-version\n :x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id\n :reply-to;\n bh=vL8yCKlO1Acre3017C5bVS5HSTwrMRtGbF3tX+nlewc=;\n b=jpfLduxO7pzxz24IEuhuoxq9+2Az+BQwTxB+2jGDxhdh0VX46gCUN/PLL7MmhmKltD\n lfhrs2UUE6RCIyx7Y1P5m3yiF1DlKORDLI5ZEwCbzPhtWxHtlX1nenuwSJDGFGHJ0QX7\n tF2bPxUjfiZ445SUK6/bFp3qv96Ehu9jH92HytKhSkRxWutrNAgfrDHLNvyyEt827oOa\n 8za6F5BpmzDxhxo/1lJjJQsA2Rt58s5PXtI37tejD2EY+9Py5kIo+mVGbXIKrb6O0kUE\n T5CeXJ1SScVxy1BqeV0p6Si4DRjjk5jHLxqsLN/GKO6KVEvhhT1/Or57zzocaKwyjxqW\n r5Iw==","X-Forwarded-Encrypted":"i=1;\n AJvYcCV3LlIXLGbmgtMl3qSk8aNq5UZe0l+SYSDOGYXFKVu+Hti7YJMu6mCJ2ekAVQ75xGgocbkg85V7D/tAzA==@gcc.gnu.org","X-Gm-Message-State":"AOJu0Yw+RPfyNdRcOoxRQT3SL5hSVSL7Z5RxSm+b+ewMm7ayXVhy2uEH\n iu4kURq7zCXX2oMhVYFVsCUFXywHTvXEuq/MVZL6VS8aWHXXuPCnCqfSL/5t3x4T4u3wVJJJA0C\n RnrEeOncOdRWaXnwB9H3/2jQS30mLN2udFQJBvJI5Vv2ZKOot1BLfUB9TFR3L9qVU1ig8RYkFue\n 6Xxbf4kDgiD5S9yBym/yYOLKrKMOJnOhsWlhfpdTZ0Fg==","X-Gm-Gg":"AeBDievpEsUVo7U+4UnK3uIyj2UlnAWI7JtJRcHpk+WNwt9PcQnkRQv73SJOjVfL17A\n gnT0CQ+N97MhCIwhsDyHQp728Ikz1LwbqF8J6h8bswppvcJLEhgeZ1j4pUPB2w5UOBdVt/GWL0j\n C+GxWAk3uWLEGCUNBkFvHYyt8xCrM4nvQ1Z0WC7FCnz3KI12sZAqMoqy99ziaP58b3h9Al2zsIw\n fnlLBKdsezMhpDs7GIPl7YxOB6eCMhszzGshrTrruI9eKoU9PUHrbcstGwbt4JvB9hR","X-Received":["by 2002:a05:690c:d8d:b0:7a2:ce0e:8650 with SMTP id\n 00721157ae682-7a4e0e714a5mr21154237b3.14.1775217004922;\n Fri, 03 Apr 2026 04:50:04 -0700 (PDT)","by 2002:a05:690c:d8d:b0:7a2:ce0e:8650 with SMTP id\n 00721157ae682-7a4e0e714a5mr21154077b3.14.1775217004399; Fri, 03 Apr 2026\n 04:50:04 -0700 (PDT)"],"MIME-Version":"1.0","References":"<20260403114721.110965-1-tkaminsk@redhat.com>","In-Reply-To":"<20260403114721.110965-1-tkaminsk@redhat.com>","From":"Tomasz Kaminski <tkaminsk@redhat.com>","Date":"Fri, 3 Apr 2026 13:49:50 +0200","X-Gm-Features":"AQROBzCCeC6SzvKl8BMWER7w9Rknz_1uBnivU0WA1XIK6AsbWx9klgTW27TDn4A","Message-ID":"\n <CAKvuMXDKTKfe0h6AfC6ei42AL3av+zdaMmKVxgbn02pWyPHsHg@mail.gmail.com>","Subject":"Re: [PATCH] libstdc++: Export explicit instantiations of\n __format::__do_vformat_to.","To":"libstdc++@gcc.gnu.org, gcc-patches@gcc.gnu.org","X-Mimecast-Spam-Score":"0","X-Mimecast-MFC-PROC-ID":"ZShPRESbE9XZiOqYUuYgcycM1EPEvjxlJgu0it5eIHM_1775217005","X-Mimecast-Originator":"redhat.com","Content-Type":"multipart/alternative; boundary=\"000000000000f2b97f064e8cea23\"","X-BeenThere":"gcc-patches@gcc.gnu.org","X-Mailman-Version":"2.1.30","Precedence":"list","List-Id":"Gcc-patches mailing list <gcc-patches.gcc.gnu.org>","List-Unsubscribe":"<https://gcc.gnu.org/mailman/options/gcc-patches>,\n <mailto:gcc-patches-request@gcc.gnu.org?subject=unsubscribe>","List-Archive":"<https://gcc.gnu.org/pipermail/gcc-patches/>","List-Post":"<mailto:gcc-patches@gcc.gnu.org>","List-Help":"<mailto:gcc-patches-request@gcc.gnu.org?subject=help>","List-Subscribe":"<https://gcc.gnu.org/mailman/listinfo/gcc-patches>,\n <mailto:gcc-patches-request@gcc.gnu.org?subject=subscribe>","Errors-To":"gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org"}},{"id":3673170,"web_url":"http://patchwork.ozlabs.org/comment/3673170/","msgid":"<CAH6eHdRi0T7Z=ciLQ6_sA6LyOdh+f8mDPY75sBu1NVDChm1O5g@mail.gmail.com>","list_archive_url":null,"date":"2026-04-03T15:20:53","subject":"Re: [PATCH] libstdc++: Export explicit instantiations of\n __format::__do_vformat_to.","submitter":{"id":4329,"url":"http://patchwork.ozlabs.org/api/people/4329/","name":"Jonathan Wakely","email":"jwakely.gcc@gmail.com"},"content":"On Fri, 3 Apr 2026, 12:50 Tomasz Kaminski, <tkaminsk@redhat.com> wrote:\n\n>\n>\n> On Fri, Apr 3, 2026 at 1:48 PM Tomasz Kamiński <tkaminsk@redhat.com>\n> wrote:\n>\n>> This patch exports instantiations of __format::__do_vformat_to\n>> for _Sink_iter and char/wchar_t. As every format function is\n>> implementing as delegating the one of these overloads, this\n>> significantly reduces the compliation time.\n>>\n>> Instantiating __format::__do_vformat_to triggers specializations\n>> of formatters for types stored in handle direclty (arithmetic\n>> types, strings), however we do not export any of their symbols.\n>> This keeps the interface boundary minimal. This file should\n>> be recompiled in later mode, when it is called stable.\n>>\n>> libstdc++-v3/ChangeLog:\n>>\n>>         * config/abi/pre/gnu.ver (GLIBCXX_3.4): Exclude exports\n>>         of std::basic_fo* (matching basic_format_context).\n>>         (GLIBCXX_3.4.35): Export __format::__do_vformat_to\n>>         specializations for _Sink_iter and char/wchar_t.\n>>         * include/std/format: (__format::__do_vformat_to):\n>>         Remove inline and declare extern instantiation\n>>         of __format::__do_vformat_to _Sink_iter and char/wchar_t.\n>>         * src/c++20/Makefile.am: Add format-inst.cc.\n>>         * src/c++20/Makefile.in: Regenerate.\n>>         * src/c++20/format-inst.cc: New file defining explicit\n>>         instantiation.\n>> ---\n>> From simple test on files from testsuite/std/format/functions/, the\n>> results looks very promising:\n>>\n>>                 Before  After\n>> format.cc       24.203s 10.846s\n>> format_to.cc    18.475s 2.844s\n>> format_to_n.cc  18.677s 3.074s\n>> vformat_to.cc   17.281s 2.246s\n>>\n>> However, I am a bit concerned if the approach works, as\n>> libstdc++.so will always contains weak simbol for __do_vformat_to\n>> for _Sink_iter<char>, that supports only C++20 specifiers.\n>> Should we instead compile the format-inst in latest mode, and\n>> always provide extern defintion?\n>> Note that the same problem will also be present for the print function,\n>> but I haven not realized it then.\n>>\n> The scenarios like that are not only teoreticall, debug support (?) for\n> string and char was recently added.\n>\n\nYes, I think we should instantiate the latest definition.\n\nBefore C++26 there's no way to use those new format specifiers anyway,\nbecause the format string is always parsed as a consteval format_string and\nso only C++20 or C++23 formats will be recognized.\n\n\n\n\n>> I plan to do similar change for __formatter_chrono<char>::_M_format\n>> functions (entry point).\n>>\n>>\n>>  libstdc++-v3/config/abi/pre/gnu.ver   |  8 ++++-\n>>  libstdc++-v3/include/std/format       | 13 +++++++-\n>>  libstdc++-v3/src/c++20/Makefile.am    |  3 +-\n>>  libstdc++-v3/src/c++20/Makefile.in    |  6 ++--\n>>  libstdc++-v3/src/c++20/format-inst.cc | 46 +++++++++++++++++++++++++++\n>>  5 files changed, 71 insertions(+), 5 deletions(-)\n>>  create mode 100644 libstdc++-v3/src/c++20/format-inst.cc\n>>\n>> diff --git a/libstdc++-v3/config/abi/pre/gnu.ver\n>> b/libstdc++-v3/config/abi/pre/gnu.ver\n>> index fb968e122d8..2b391584c94 100644\n>> --- a/libstdc++-v3/config/abi/pre/gnu.ver\n>> +++ b/libstdc++-v3/config/abi/pre/gnu.ver\n>> @@ -34,7 +34,9 @@ GLIBCXX_3.4 {\n>>        std::basic_[a-e]*;\n>>        std::basic_f[a-h]*;\n>>  #     std::basic_filebuf;\n>> -      std::basic_f[j-r]*;\n>> +      std::basic_f[j-n]*;\n>> +#     std::basic_format_context;\n>> +      std::basic_f[p-r]*;\n>>  #     std::basic_fstream;\n>>        std::basic_f[t-z]*;\n>>        std::basic_[g-h]*;\n>> @@ -2587,6 +2589,10 @@ GLIBCXX_3.4.35 {\n>>      _ZNSt12__cow_stringaSEOS_;\n>>      _ZNKSt12__cow_string5c_strEv;\n>>\n>> +    # __format::__do_vformat_to(_Sink_iter<char>, string_view, const\n>> format_args&, const locale*);\n>> +    # __format::__do_vformat_to(_Sink_iter<wchar_t>, wstring_view, const\n>> wformat_args&, const locale*);\n>> +\n>> _ZNSt8__format15__do_vformat_toINS_10_Sink_iterI[wc]EE[wc]St20basic_format_contextIS2_[wc]EEET_S5_St17basic_string_viewIT0_St11char_traitsIS7_EERKSt17basic_format_argsIT1_EPKSt6locale;\n>> +\n>>  #if defined (_WIN32) && !defined (__CYGWIN__)\n>>      _ZSt19__get_once_callablev;\n>>      _ZSt15__get_once_callv;\n>> diff --git a/libstdc++-v3/include/std/format\n>> b/libstdc++-v3/include/std/format\n>> index eca5bd213aa..2a8229a2eb5 100644\n>> --- a/libstdc++-v3/include/std/format\n>> +++ b/libstdc++-v3/include/std/format\n>> @@ -5220,7 +5220,7 @@ namespace __format\n>>      };\n>>\n>>    template<typename _Out, typename _CharT, typename _Context>\n>> -    inline _Out\n>> +    _Out\n>>      __do_vformat_to(_Out __out, basic_string_view<_CharT> __fmt,\n>>                     const basic_format_args<_Context>& __args,\n>>                     const locale* __loc)\n>> @@ -5310,6 +5310,17 @@ namespace __format\n>>         }\n>>      }\n>>\n>> +#if __cplusplus <= 202002L && _GLIBCXX_EXTERN_TEMPLATE > 0\n>> +    extern template _Sink_iter<char>\n>> +      __do_vformat_to(_Sink_iter<char>, string_view,\n>> +                     const format_args&, const locale*);\n>> +# ifdef _GLIBCXX_USE_WCHAR_T\n>> +    extern template _Sink_iter<wchar_t>\n>> +      __do_vformat_to(_Sink_iter<wchar_t>, wstring_view,\n>> +                     const wformat_args&, const locale*);\n>> +# endif\n>> +#endif\n>> +\n>>    template<typename _Out, typename _CharT>\n>>      format_to_n_result<_Out>\n>>      __do_vformat_to_n(_Out __out, iter_difference_t<_Out> __n,\n>> diff --git a/libstdc++-v3/src/c++20/Makefile.am\n>> b/libstdc++-v3/src/c++20/Makefile.am\n>> index 0061678dc0f..7744fa43a63 100644\n>> --- a/libstdc++-v3/src/c++20/Makefile.am\n>> +++ b/libstdc++-v3/src/c++20/Makefile.am\n>> @@ -30,7 +30,8 @@ headers =\n>>  if ENABLE_EXTERN_TEMPLATE\n>>  # XTEMPLATE_FLAGS = -fno-implicit-templates\n>>  inst_sources = \\\n>> -       sstream-inst.cc\n>> +       sstream-inst.cc \\\n>> +       format-inst.cc\n>>  else\n>>  # XTEMPLATE_FLAGS =\n>>  inst_sources =\n>> diff --git a/libstdc++-v3/src/c++20/Makefile.in\n>> b/libstdc++-v3/src/c++20/Makefile.in\n>> index f481ad08edb..566d7292021 100644\n>> --- a/libstdc++-v3/src/c++20/Makefile.in\n>> +++ b/libstdc++-v3/src/c++20/Makefile.in\n>> @@ -124,7 +124,8 @@ CONFIG_CLEAN_VPATH_FILES =\n>>  LTLIBRARIES = $(noinst_LTLIBRARIES)\n>>  libc__20convenience_la_LIBADD =\n>>  am__objects_1 = tzdb.lo format.lo atomic.lo clock.lo syncbuf.lo\n>> -@ENABLE_EXTERN_TEMPLATE_TRUE@am__objects_2 = sstream-inst.lo\n>> +@ENABLE_EXTERN_TEMPLATE_TRUE@am__objects_2 = sstream-inst.lo \\\n>> +@ENABLE_EXTERN_TEMPLATE_TRUE@  format-inst.lo\n>>  @GLIBCXX_HOSTED_TRUE@am_libc__20convenience_la_OBJECTS =  \\\n>>  @GLIBCXX_HOSTED_TRUE@  $(am__objects_1) $(am__objects_2)\n>>  libc__20convenience_la_OBJECTS = $(am_libc__20convenience_la_OBJECTS)\n>> @@ -433,7 +434,8 @@ headers =\n>>\n>>  # XTEMPLATE_FLAGS = -fno-implicit-templates\n>>  @ENABLE_EXTERN_TEMPLATE_TRUE@inst_sources = \\\n>> -@ENABLE_EXTERN_TEMPLATE_TRUE@  sstream-inst.cc\n>> +@ENABLE_EXTERN_TEMPLATE_TRUE@  sstream-inst.cc \\\n>> +@ENABLE_EXTERN_TEMPLATE_TRUE@  format-inst.cc\n>>\n>>  sources = tzdb.cc format.cc atomic.cc clock.cc syncbuf.cc\n>>  @GLIBCXX_HOSTED_FALSE@libc__20convenience_la_SOURCES =\n>> diff --git a/libstdc++-v3/src/c++20/format-inst.cc\n>> b/libstdc++-v3/src/c++20/format-inst.cc\n>> new file mode 100644\n>> index 00000000000..1904de35f7b\n>> --- /dev/null\n>> +++ b/libstdc++-v3/src/c++20/format-inst.cc\n>> @@ -0,0 +1,46 @@\n>> +// Definitions for <chrono> formatting -*- C++ -*-\n>> +\n>> +// Copyright The GNU Toolchain Authors.\n>> +//\n>> +// This file is part of the GNU ISO C++ Library.  This library is free\n>> +// software; you can redistribute it and/or modify it under the\n>> +// terms of the GNU General Public License as published by the\n>> +// Free Software Foundation; either version 3, or (at your option)\n>> +// any later version.\n>> +\n>> +// This library is distributed in the hope that it will be useful,\n>> +// but WITHOUT ANY WARRANTY; without even the implied warranty of\n>> +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n>> +// GNU General Public License for more details.\n>> +\n>> +// Under Section 7 of GPL version 3, you are granted additional\n>> +// permissions described in the GCC Runtime Library Exception, version\n>> +// 3.1, as published by the Free Software Foundation.\n>> +\n>> +// You should have received a copy of the GNU General Public License and\n>> +// a copy of the GCC Runtime Library Exception along with this program;\n>> +// see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see\n>> +// <http://www.gnu.org/licenses/>.\n>> +\n>> +#include <format>\n>> +#include <chrono>\n>> +\n>> +namespace std\n>> +{\n>> +_GLIBCXX_BEGIN_NAMESPACE_VERSION\n>> +namespace __format\n>> +{\n>> +\n>> + template _Sink_iter<char>\n>> +   __do_vformat_to(_Sink_iter<char>, string_view,\n>> +                  const format_args&, const locale*);\n>> +\n>> +# ifdef _GLIBCXX_USE_WCHAR_T\n>> + template _Sink_iter<wchar_t>\n>> +   __do_vformat_to(_Sink_iter<wchar_t>, wstring_view,\n>> +                  const wformat_args&, const locale*);\n>> +# endif\n>> +\n>> +} // namespace __format\n>> +_GLIBCXX_END_NAMESPACE_VERSION\n>> +} // namespace std\n>> --\n>> 2.53.0\n>>\n>>","headers":{"Return-Path":"<gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org>","X-Original-To":["incoming@patchwork.ozlabs.org","gcc-patches@gcc.gnu.org"],"Delivered-To":["patchwork-incoming@legolas.ozlabs.org","gcc-patches@gcc.gnu.org"],"Authentication-Results":["legolas.ozlabs.org;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256\n header.s=20251104 header.b=RIw5wa14;\n\tdkim-atps=neutral","legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org\n (client-ip=2620:52:6:3111::32; helo=vm01.sourceware.org;\n envelope-from=gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org;\n receiver=patchwork.ozlabs.org)","sourceware.org;\n\tdkim=pass (2048-bit key,\n unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256\n header.s=20251104 header.b=RIw5wa14","sourceware.org;\n dmarc=pass (p=none dis=none) header.from=gmail.com","sourceware.org; spf=pass smtp.mailfrom=gmail.com","server2.sourceware.org;\n arc=pass smtp.remote-ip=209.85.208.178"],"Received":["from vm01.sourceware.org (vm01.sourceware.org\n [IPv6:2620:52:6:3111::32])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519 server-signature ECDSA (secp384r1) server-digest SHA384)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4fnMs82pfBz1yCs\n\tfor <incoming@patchwork.ozlabs.org>; Sat, 04 Apr 2026 02:22:03 +1100 (AEDT)","from vm01.sourceware.org (localhost [127.0.0.1])\n\tby sourceware.org (Postfix) with ESMTP id 86B754BA23E5\n\tfor <incoming@patchwork.ozlabs.org>; Fri,  3 Apr 2026 15:22:01 +0000 (GMT)","from mail-lj1-f178.google.com (mail-lj1-f178.google.com\n [209.85.208.178])\n by sourceware.org (Postfix) with ESMTPS id 1D4E04BA23DB\n for <gcc-patches@gcc.gnu.org>; Fri,  3 Apr 2026 15:21:07 +0000 (GMT)","by mail-lj1-f178.google.com with SMTP id\n 38308e7fff4ca-38ad26e3992so17670641fa.1\n for <gcc-patches@gcc.gnu.org>; Fri, 03 Apr 2026 08:21:07 -0700 (PDT)"],"DKIM-Filter":["OpenDKIM Filter v2.11.0 sourceware.org 86B754BA23E5","OpenDKIM Filter v2.11.0 sourceware.org 1D4E04BA23DB"],"DMARC-Filter":"OpenDMARC Filter v1.4.2 sourceware.org 1D4E04BA23DB","ARC-Filter":"OpenARC Filter v1.0.0 sourceware.org 1D4E04BA23DB","ARC-Seal":["i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1775229667; cv=pass;\n b=qiachLiRYJs+V77DcwGbPv2v/RV04GsMoWBF3SGz9CfnhCMcP7bhZ89viawt+hY8hmX+I8gN/Uv68qcw+KIqTCn5j7ZfUxSXdglUQXR8hxc8vUkoALyKhiA0UNPfWRUJX3ENXmAzK6YOzkPGmZgwBOBG12wrP6HXf2jljbBKh58=","i=1; a=rsa-sha256; t=1775229666; cv=none;\n d=google.com; s=arc-20240605;\n b=gmh6Y7AwsJ4y3jCFN5hfmV205+bwgy1RQmfGiquxUXd/mUxXoc/UsSp0E/oflyimff\n 1pQcd+7voh2xgVpW2rbWhzCX6VryyyL0bIxcvIeB57xazBWeNM2w6su/cRH1vkDEMRGP\n OmeNZo0lRyXYB0a0uQBd8It0fFV5zRPslPU9uZ7nnu6q9Bfggozm1je2qsC0J8hHr04X\n z3utqkO83hrvYvu9Q1sRMqKrC5UXpy/xWu0NDUaLAdhUyzBytV4/XzP/47NRlwwt5qfK\n ds05ENRKl38RYOZvVw2/zQU9LFNEpu/CEO/aMQokSEfChCtZOsun6NV0tW2o3hlZWJHB\n uC0w=="],"ARC-Message-Signature":["i=2; a=rsa-sha256; d=sourceware.org; s=key;\n t=1775229667; c=relaxed/simple;\n bh=qS7S6flFZoHyPYP9Y8nSv/+uU69OW2vMFozXEUL5Kg0=;\n h=DKIM-Signature:MIME-Version:From:Date:Message-ID:Subject:To;\n b=mSVHLdUJ2UxJHaniHAq9wdnAOD7hfm2qWizr/Z8ZuopK77dGXWfH74K/PEIu8FPkBdvkOizxxBjGqsSMb9wcmgauOX086LjbIOLbtVU67rX1SjiNNU5QNjyHWWmzn/5jTY0XoDCbhVPaShxBgP8y0y2ZBbzLFKgrexr4lf9D4tA=","i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com;\n s=arc-20240605;\n h=cc:to:subject:message-id:date:from:in-reply-to:references\n :mime-version:dkim-signature;\n bh=7K53kFMpssREuYv92fXPF3pThZCPWKZqkB3OEP+LZUY=;\n fh=FSQiTK+/XsTauF4EEuw75i0JdyzSWohXBfxy7DL2pTQ=;\n b=QyLKuTci7JyyYTHc8AGnhfglS+beUaiQxtCauX04NDbkrGAm8StzQtJ2/5uwC8Svqi\n EuYi9COg5gaB1tZnuk3g2jup8bJbGh/CLjt2e+QRanjjaWoj3JVsoPKABboizcAkqKrd\n vBEfK4JnDDoHiJYFPwDkcUvI/dVkFT95hzLf/fzUk6JIcxdlMa+yJpgwO1jK2wDxoomz\n TSv+E0Wl3cf03lxB7iocqhzux2TR7kONXQnr/UDVJilihQPuzWk34phSuNbrMzGs7U9P\n ytRlcEgw20MYQhqxDL7ho1LovkGmaQh+fLOzfgYM6zbaMFsO19sfgTm320JVljP8TnO/\n gvhw==; darn=gcc.gnu.org"],"ARC-Authentication-Results":["i=2; server2.sourceware.org","i=1; mx.google.com; arc=none"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=gmail.com; s=20251104; t=1775229666; x=1775834466; darn=gcc.gnu.org;\n h=cc:to:subject:message-id:date:from:in-reply-to:references\n :mime-version:from:to:cc:subject:date:message-id:reply-to;\n bh=7K53kFMpssREuYv92fXPF3pThZCPWKZqkB3OEP+LZUY=;\n b=RIw5wa142yWFosEjRDwrAZjdEQnNANryeWEnirc95c+9HTTYJnP70rTCxEi2HKQGI9\n dD7OJ8ioxNCxpIuL3iN+S2GbF8vBnma8im8y1hk0kmCTov5fYpk9274hnnKitHUG2KE1\n QrBK6dQvcKUgZmsOM4PWxj16hnwFUi78wgObk7g3lPQHd+/lkWq6sqoF9WojCjejTfbg\n Y5r6cR2fqSs8I+E3tOc7jkcUwKy+/1Mgtk9TgFXSB87jmNBPyqKP9N253LaSrc80Hzb1\n 9AVxp/WwoVcIGqHz3X0fiQ6I61ObbhoABXjTkxUN7w/knHwkPfYeYJmS7c+j0xWEy0J/\n HtXQ==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20251104; t=1775229666; x=1775834466;\n h=cc:to:subject:message-id:date:from:in-reply-to:references\n :mime-version:x-gm-gg:x-gm-message-state:from:to:cc:subject:date\n :message-id:reply-to;\n bh=7K53kFMpssREuYv92fXPF3pThZCPWKZqkB3OEP+LZUY=;\n b=WEnCrkIVmhyZH0YCmcLkdKqaHjKGFMr8Z5c7ceLOe0KI1tT7+MwQTlybozVNvO9wg2\n 7HbvEbH0z1TNnvnZ/gnCXZuKAZ6p1xPtZfrUSbVgrBobN+KoxYVSbv4P7tgvzJZVHBj5\n zjgLrldpH31SNlPIS6A8E2z4G/pW6/EcYzdvhqwCnHmaxUZgVLx+dd6YbUciFrlpY8qE\n 614XWrVRwBN/y/4W+kD0QRoPbC/wx5ATIAbst3p01Cs0ro8pLVbQkVI2C/RQH+eRnbz5\n m67/iQ3OTS40XrQAd15X2w+o9FqtEEikQvEl49trIwISaQEjaHimYQMWYJiSCJ3U7aDi\n snKA==","X-Forwarded-Encrypted":"i=1;\n AJvYcCU9YeGWWHHJrdiEcDlAOa6bUzNfXH8uOJsNAGdvORE9p2EcrfacfCDz2hNeXiMebuWTGlxXX+yJqxBeoQ==@gcc.gnu.org","X-Gm-Message-State":"AOJu0Yx5tBifI691oNk7GWN4LqjISf7xY1gcxQJsFWd9wgf/Uh4AX3xl\n 2lWrDuEVbyA8PUt6KF4lWXaMjj9sPN77S+pykMaTp868NVLvoUl461q4C3pFmz67Jf589gvloJJ\n mD/UEOGTtEdyTQFa1QcepLj9RCSWFejg=","X-Gm-Gg":"AeBDievI5FAeIX8UfiG5uoZ47HkRHwg+BzyUOWqtnzX01C3rL81ncw+2/FtiitgPZ2C\n 0hcT4XQSfT1DQOxeiVQIvDeeknNmTkvLffBAB1PkTsUxNrmscbgRMrVkLeNtqoDuKJrEc3xIw19\n dA/AL8FOI/8WhjdlQfjSlPBY6rIxChpaJ5SAv3BTLbJ+d4mZHyqHwAP2kGq3YX7OMR7IU4qyPow\n +/BBPyE5a66HNLgjsC1rT3qYWb4nnxTU+Cew6zb6PAUydFrssCUK8C1HqGJgoMRgeNcXtrXMu3g\n 1yVEXNLtrE4y/8rsNtLnTH10u1s7JKYiojU/7Ko2z0KYTPAF2ahxXmjCF7+o3MI3na7ZVr43Ejq\n 3mANvqbVsFEbFsyLRPYohXpYrJKY=","X-Received":"by 2002:a2e:8a86:0:b0:37f:c5ca:a6d4 with SMTP id\n 38308e7fff4ca-38d8d34e403mr9715331fa.6.1775229665353; Fri, 03 Apr 2026\n 08:21:05 -0700 (PDT)","MIME-Version":"1.0","References":"<20260403114721.110965-1-tkaminsk@redhat.com>\n <CAKvuMXDKTKfe0h6AfC6ei42AL3av+zdaMmKVxgbn02pWyPHsHg@mail.gmail.com>","In-Reply-To":"\n <CAKvuMXDKTKfe0h6AfC6ei42AL3av+zdaMmKVxgbn02pWyPHsHg@mail.gmail.com>","From":"Jonathan Wakely <jwakely.gcc@gmail.com>","Date":"Fri, 3 Apr 2026 16:20:53 +0100","X-Gm-Features":"AQROBzBZjqdwrRLvpMLcgeKmfrCikRHr1g6Ty2Yz2PNE3gHw8JsWsvkkogHOfTU","Message-ID":"\n <CAH6eHdRi0T7Z=ciLQ6_sA6LyOdh+f8mDPY75sBu1NVDChm1O5g@mail.gmail.com>","Subject":"Re: [PATCH] libstdc++: Export explicit instantiations of\n __format::__do_vformat_to.","To":"Tomasz Kaminski <tkaminsk@redhat.com>","Cc":"\"libstdc++\" <libstdc++@gcc.gnu.org>, gcc-patches <gcc-patches@gcc.gnu.org>","Content-Type":"multipart/alternative; boundary=\"000000000000992377064e8fdd18\"","X-BeenThere":"gcc-patches@gcc.gnu.org","X-Mailman-Version":"2.1.30","Precedence":"list","List-Id":"Gcc-patches mailing list <gcc-patches.gcc.gnu.org>","List-Unsubscribe":"<https://gcc.gnu.org/mailman/options/gcc-patches>,\n <mailto:gcc-patches-request@gcc.gnu.org?subject=unsubscribe>","List-Archive":"<https://gcc.gnu.org/pipermail/gcc-patches/>","List-Post":"<mailto:gcc-patches@gcc.gnu.org>","List-Help":"<mailto:gcc-patches-request@gcc.gnu.org?subject=help>","List-Subscribe":"<https://gcc.gnu.org/mailman/listinfo/gcc-patches>,\n <mailto:gcc-patches-request@gcc.gnu.org?subject=subscribe>","Errors-To":"gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org"}},{"id":3673176,"web_url":"http://patchwork.ozlabs.org/comment/3673176/","msgid":"<CAKvuMXDhuRJdhWSZo+jaaLUnRMtDzBQB3jhJUz3hyA+TTM30mQ@mail.gmail.com>","list_archive_url":null,"date":"2026-04-03T15:31:07","subject":"Re: [PATCH] libstdc++: Export explicit instantiations of\n __format::__do_vformat_to.","submitter":{"id":90409,"url":"http://patchwork.ozlabs.org/api/people/90409/","name":"Tomasz Kamiński","email":"tkaminsk@redhat.com"},"content":"On Fri, Apr 3, 2026 at 5:21 PM Jonathan Wakely <jwakely.gcc@gmail.com>\nwrote:\n\n>\n>\n> On Fri, 3 Apr 2026, 12:50 Tomasz Kaminski, <tkaminsk@redhat.com> wrote:\n>\n>>\n>>\n>> On Fri, Apr 3, 2026 at 1:48 PM Tomasz Kamiński <tkaminsk@redhat.com>\n>> wrote:\n>>\n>>> This patch exports instantiations of __format::__do_vformat_to\n>>> for _Sink_iter and char/wchar_t. As every format function is\n>>> implementing as delegating the one of these overloads, this\n>>> significantly reduces the compliation time.\n>>>\n>>> Instantiating __format::__do_vformat_to triggers specializations\n>>> of formatters for types stored in handle direclty (arithmetic\n>>> types, strings), however we do not export any of their symbols.\n>>> This keeps the interface boundary minimal. This file should\n>>> be recompiled in later mode, when it is called stable.\n>>>\n>>> libstdc++-v3/ChangeLog:\n>>>\n>>>         * config/abi/pre/gnu.ver (GLIBCXX_3.4): Exclude exports\n>>>         of std::basic_fo* (matching basic_format_context).\n>>>         (GLIBCXX_3.4.35): Export __format::__do_vformat_to\n>>>         specializations for _Sink_iter and char/wchar_t.\n>>>         * include/std/format: (__format::__do_vformat_to):\n>>>         Remove inline and declare extern instantiation\n>>>         of __format::__do_vformat_to _Sink_iter and char/wchar_t.\n>>>         * src/c++20/Makefile.am: Add format-inst.cc.\n>>>         * src/c++20/Makefile.in: Regenerate.\n>>>         * src/c++20/format-inst.cc: New file defining explicit\n>>>         instantiation.\n>>> ---\n>>> From simple test on files from testsuite/std/format/functions/, the\n>>> results looks very promising:\n>>>\n>>>                 Before  After\n>>> format.cc       24.203s 10.846s\n>>> format_to.cc    18.475s 2.844s\n>>> format_to_n.cc  18.677s 3.074s\n>>> vformat_to.cc   17.281s 2.246s\n>>>\n>>> However, I am a bit concerned if the approach works, as\n>>> libstdc++.so will always contains weak simbol for __do_vformat_to\n>>> for _Sink_iter<char>, that supports only C++20 specifiers.\n>>> Should we instead compile the format-inst in latest mode, and\n>>> always provide extern defintion?\n>>> Note that the same problem will also be present for the print function,\n>>> but I haven not realized it then.\n>>>\n>> The scenarios like that are not only teoreticall, debug support (?) for\n>> string and char was recently added.\n>>\n>\n> Yes, I think we should instantiate the latest definition.\n>\n> Before C++26 there's no way to use those new format specifiers anyway,\n> because the format string is always parsed as a consteval format_string and\n> so only C++20 or C++23 formats will be recognized.\n>\nYou can observe this by calling vformat_to, and we have a test checking if\nvformat_to(\"{:?}\", string) works or not,\nso we will end up in unfortunae situation when ? is supported for dynamic\nformatting, but not for static one.\n\nI am experimenting with adding _M_ftm member to basic_format_context and\nbasic_format_parse_context,\nand using it to decide if given format specifier should be rejected.\n\n>\n>\n>\n>>> I plan to do similar change for __formatter_chrono<char>::_M_format\n>>> functions (entry point).\n>>>\n>>>\n>>>  libstdc++-v3/config/abi/pre/gnu.ver   |  8 ++++-\n>>>  libstdc++-v3/include/std/format       | 13 +++++++-\n>>>  libstdc++-v3/src/c++20/Makefile.am    |  3 +-\n>>>  libstdc++-v3/src/c++20/Makefile.in    |  6 ++--\n>>>  libstdc++-v3/src/c++20/format-inst.cc | 46 +++++++++++++++++++++++++++\n>>>  5 files changed, 71 insertions(+), 5 deletions(-)\n>>>  create mode 100644 libstdc++-v3/src/c++20/format-inst.cc\n>>>\n>>> diff --git a/libstdc++-v3/config/abi/pre/gnu.ver\n>>> b/libstdc++-v3/config/abi/pre/gnu.ver\n>>> index fb968e122d8..2b391584c94 100644\n>>> --- a/libstdc++-v3/config/abi/pre/gnu.ver\n>>> +++ b/libstdc++-v3/config/abi/pre/gnu.ver\n>>> @@ -34,7 +34,9 @@ GLIBCXX_3.4 {\n>>>        std::basic_[a-e]*;\n>>>        std::basic_f[a-h]*;\n>>>  #     std::basic_filebuf;\n>>> -      std::basic_f[j-r]*;\n>>> +      std::basic_f[j-n]*;\n>>> +#     std::basic_format_context;\n>>> +      std::basic_f[p-r]*;\n>>>  #     std::basic_fstream;\n>>>        std::basic_f[t-z]*;\n>>>        std::basic_[g-h]*;\n>>> @@ -2587,6 +2589,10 @@ GLIBCXX_3.4.35 {\n>>>      _ZNSt12__cow_stringaSEOS_;\n>>>      _ZNKSt12__cow_string5c_strEv;\n>>>\n>>> +    # __format::__do_vformat_to(_Sink_iter<char>, string_view, const\n>>> format_args&, const locale*);\n>>> +    # __format::__do_vformat_to(_Sink_iter<wchar_t>, wstring_view,\n>>> const wformat_args&, const locale*);\n>>> +\n>>> _ZNSt8__format15__do_vformat_toINS_10_Sink_iterI[wc]EE[wc]St20basic_format_contextIS2_[wc]EEET_S5_St17basic_string_viewIT0_St11char_traitsIS7_EERKSt17basic_format_argsIT1_EPKSt6locale;\n>>> +\n>>>  #if defined (_WIN32) && !defined (__CYGWIN__)\n>>>      _ZSt19__get_once_callablev;\n>>>      _ZSt15__get_once_callv;\n>>> diff --git a/libstdc++-v3/include/std/format\n>>> b/libstdc++-v3/include/std/format\n>>> index eca5bd213aa..2a8229a2eb5 100644\n>>> --- a/libstdc++-v3/include/std/format\n>>> +++ b/libstdc++-v3/include/std/format\n>>> @@ -5220,7 +5220,7 @@ namespace __format\n>>>      };\n>>>\n>>>    template<typename _Out, typename _CharT, typename _Context>\n>>> -    inline _Out\n>>> +    _Out\n>>>      __do_vformat_to(_Out __out, basic_string_view<_CharT> __fmt,\n>>>                     const basic_format_args<_Context>& __args,\n>>>                     const locale* __loc)\n>>> @@ -5310,6 +5310,17 @@ namespace __format\n>>>         }\n>>>      }\n>>>\n>>> +#if __cplusplus <= 202002L && _GLIBCXX_EXTERN_TEMPLATE > 0\n>>> +    extern template _Sink_iter<char>\n>>> +      __do_vformat_to(_Sink_iter<char>, string_view,\n>>> +                     const format_args&, const locale*);\n>>> +# ifdef _GLIBCXX_USE_WCHAR_T\n>>> +    extern template _Sink_iter<wchar_t>\n>>> +      __do_vformat_to(_Sink_iter<wchar_t>, wstring_view,\n>>> +                     const wformat_args&, const locale*);\n>>> +# endif\n>>> +#endif\n>>> +\n>>>    template<typename _Out, typename _CharT>\n>>>      format_to_n_result<_Out>\n>>>      __do_vformat_to_n(_Out __out, iter_difference_t<_Out> __n,\n>>> diff --git a/libstdc++-v3/src/c++20/Makefile.am\n>>> b/libstdc++-v3/src/c++20/Makefile.am\n>>> index 0061678dc0f..7744fa43a63 100644\n>>> --- a/libstdc++-v3/src/c++20/Makefile.am\n>>> +++ b/libstdc++-v3/src/c++20/Makefile.am\n>>> @@ -30,7 +30,8 @@ headers =\n>>>  if ENABLE_EXTERN_TEMPLATE\n>>>  # XTEMPLATE_FLAGS = -fno-implicit-templates\n>>>  inst_sources = \\\n>>> -       sstream-inst.cc\n>>> +       sstream-inst.cc \\\n>>> +       format-inst.cc\n>>>  else\n>>>  # XTEMPLATE_FLAGS =\n>>>  inst_sources =\n>>> diff --git a/libstdc++-v3/src/c++20/Makefile.in\n>>> b/libstdc++-v3/src/c++20/Makefile.in\n>>> index f481ad08edb..566d7292021 100644\n>>> --- a/libstdc++-v3/src/c++20/Makefile.in\n>>> +++ b/libstdc++-v3/src/c++20/Makefile.in\n>>> @@ -124,7 +124,8 @@ CONFIG_CLEAN_VPATH_FILES =\n>>>  LTLIBRARIES = $(noinst_LTLIBRARIES)\n>>>  libc__20convenience_la_LIBADD =\n>>>  am__objects_1 = tzdb.lo format.lo atomic.lo clock.lo syncbuf.lo\n>>> -@ENABLE_EXTERN_TEMPLATE_TRUE@am__objects_2 = sstream-inst.lo\n>>> +@ENABLE_EXTERN_TEMPLATE_TRUE@am__objects_2 = sstream-inst.lo \\\n>>> +@ENABLE_EXTERN_TEMPLATE_TRUE@  format-inst.lo\n>>>  @GLIBCXX_HOSTED_TRUE@am_libc__20convenience_la_OBJECTS =  \\\n>>>  @GLIBCXX_HOSTED_TRUE@  $(am__objects_1) $(am__objects_2)\n>>>  libc__20convenience_la_OBJECTS = $(am_libc__20convenience_la_OBJECTS)\n>>> @@ -433,7 +434,8 @@ headers =\n>>>\n>>>  # XTEMPLATE_FLAGS = -fno-implicit-templates\n>>>  @ENABLE_EXTERN_TEMPLATE_TRUE@inst_sources = \\\n>>> -@ENABLE_EXTERN_TEMPLATE_TRUE@  sstream-inst.cc\n>>> +@ENABLE_EXTERN_TEMPLATE_TRUE@  sstream-inst.cc \\\n>>> +@ENABLE_EXTERN_TEMPLATE_TRUE@  format-inst.cc\n>>>\n>>>  sources = tzdb.cc format.cc atomic.cc clock.cc syncbuf.cc\n>>>  @GLIBCXX_HOSTED_FALSE@libc__20convenience_la_SOURCES =\n>>> diff --git a/libstdc++-v3/src/c++20/format-inst.cc\n>>> b/libstdc++-v3/src/c++20/format-inst.cc\n>>> new file mode 100644\n>>> index 00000000000..1904de35f7b\n>>> --- /dev/null\n>>> +++ b/libstdc++-v3/src/c++20/format-inst.cc\n>>> @@ -0,0 +1,46 @@\n>>> +// Definitions for <chrono> formatting -*- C++ -*-\n>>> +\n>>> +// Copyright The GNU Toolchain Authors.\n>>> +//\n>>> +// This file is part of the GNU ISO C++ Library.  This library is free\n>>> +// software; you can redistribute it and/or modify it under the\n>>> +// terms of the GNU General Public License as published by the\n>>> +// Free Software Foundation; either version 3, or (at your option)\n>>> +// any later version.\n>>> +\n>>> +// This library is distributed in the hope that it will be useful,\n>>> +// but WITHOUT ANY WARRANTY; without even the implied warranty of\n>>> +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n>>> +// GNU General Public License for more details.\n>>> +\n>>> +// Under Section 7 of GPL version 3, you are granted additional\n>>> +// permissions described in the GCC Runtime Library Exception, version\n>>> +// 3.1, as published by the Free Software Foundation.\n>>> +\n>>> +// You should have received a copy of the GNU General Public License and\n>>> +// a copy of the GCC Runtime Library Exception along with this program;\n>>> +// see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see\n>>> +// <http://www.gnu.org/licenses/>.\n>>> +\n>>> +#include <format>\n>>> +#include <chrono>\n>>> +\n>>> +namespace std\n>>> +{\n>>> +_GLIBCXX_BEGIN_NAMESPACE_VERSION\n>>> +namespace __format\n>>> +{\n>>> +\n>>> + template _Sink_iter<char>\n>>> +   __do_vformat_to(_Sink_iter<char>, string_view,\n>>> +                  const format_args&, const locale*);\n>>> +\n>>> +# ifdef _GLIBCXX_USE_WCHAR_T\n>>> + template _Sink_iter<wchar_t>\n>>> +   __do_vformat_to(_Sink_iter<wchar_t>, wstring_view,\n>>> +                  const wformat_args&, const locale*);\n>>> +# endif\n>>> +\n>>> +} // namespace __format\n>>> +_GLIBCXX_END_NAMESPACE_VERSION\n>>> +} // namespace std\n>>> --\n>>> 2.53.0\n>>>\n>>>","headers":{"Return-Path":"<gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org>","X-Original-To":["incoming@patchwork.ozlabs.org","gcc-patches@gcc.gnu.org"],"Delivered-To":["patchwork-incoming@legolas.ozlabs.org","gcc-patches@gcc.gnu.org"],"Authentication-Results":["legolas.ozlabs.org;\n\tdkim=pass (1024-bit key;\n unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256\n header.s=mimecast20190719 header.b=NLi+PM8/;\n\tdkim-atps=neutral","legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org\n (client-ip=2620:52:6:3111::32; helo=vm01.sourceware.org;\n envelope-from=gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org;\n receiver=patchwork.ozlabs.org)","sourceware.org;\n\tdkim=pass (1024-bit key,\n unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256\n header.s=mimecast20190719 header.b=NLi+PM8/","sourceware.org; dmarc=pass (p=quarantine dis=none)\n header.from=redhat.com","sourceware.org; spf=pass smtp.mailfrom=redhat.com","server2.sourceware.org;\n arc=none smtp.remote-ip=170.10.129.124"],"Received":["from vm01.sourceware.org (vm01.sourceware.org\n [IPv6:2620:52:6:3111::32])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519 server-signature ECDSA (secp384r1) server-digest SHA384)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4fnN5L3yStz1yCt\n\tfor <incoming@patchwork.ozlabs.org>; Sat, 04 Apr 2026 02:32:38 +1100 (AEDT)","from vm01.sourceware.org (localhost [127.0.0.1])\n\tby sourceware.org (Postfix) with ESMTP id 740DF4BA2E27\n\tfor <incoming@patchwork.ozlabs.org>; Fri,  3 Apr 2026 15:32:36 +0000 (GMT)","from us-smtp-delivery-124.mimecast.com\n (us-smtp-delivery-124.mimecast.com [170.10.129.124])\n by sourceware.org (Postfix) with ESMTP id 800524BA2E19\n for <gcc-patches@gcc.gnu.org>; Fri,  3 Apr 2026 15:31:23 +0000 (GMT)","from mail-yw1-f199.google.com (mail-yw1-f199.google.com\n [209.85.128.199]) by relay.mimecast.com with ESMTP with STARTTLS\n (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id\n us-mta-139-4Bgr54E8MqGAdIk7WGoUXg-1; Fri, 03 Apr 2026 11:31:19 -0400","by mail-yw1-f199.google.com with SMTP id\n 00721157ae682-798531a0f58so42277337b3.0\n for <gcc-patches@gcc.gnu.org>; Fri, 03 Apr 2026 08:31:19 -0700 (PDT)"],"DKIM-Filter":["OpenDKIM Filter v2.11.0 sourceware.org 740DF4BA2E27","OpenDKIM Filter v2.11.0 sourceware.org 800524BA2E19"],"DMARC-Filter":"OpenDMARC Filter v1.4.2 sourceware.org 800524BA2E19","ARC-Filter":"OpenARC Filter v1.0.0 sourceware.org 800524BA2E19","ARC-Seal":"i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1775230283; cv=none;\n b=Mn/bvtLdWF0RwdhmUo9u+gBMwT7It8FjOHaIax12RFmGj4f4gbltLHJfSvr54y7/OgDjfrKBCurlc6hZt3alqT3y5s15pSovooDwntlM9czodtYeqBAxTYt7bajPK7B5/45ikHcyf5bX8M1uJoIlekOeDSQ0z54P+CPMh3VQXgg=","ARC-Message-Signature":"i=1; a=rsa-sha256; d=sourceware.org; s=key;\n t=1775230283; c=relaxed/simple;\n bh=006wFkOM3bVK7GZVCEfUpQieAC+keAakqZC0ByOXP7E=;\n h=DKIM-Signature:MIME-Version:From:Date:Message-ID:Subject:To;\n b=hWaFfL5oaH3zPei6lQUZ6BBiBrkJiDtZImFLWSKrdFldgZT4CmRFXZP/ux73zLxiWsHJgXC5TLlP1PfU5z8jW8fQGdp2X1zo6oaEqp2Gwrz9oQ1ya6ThdP96GH7eoslPVw6x9qBfjd1Vv7Fa5KeYjYWOEtDvVTwebw7kLg0xzjM=","ARC-Authentication-Results":"i=1; server2.sourceware.org","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;\n s=mimecast20190719; t=1775230283;\n h=from:from:reply-to:subject:subject:date:date:message-id:message-id:\n to:to:cc:cc:mime-version:mime-version:content-type:content-type:\n in-reply-to:in-reply-to:references:references;\n bh=op9zsKSVPpnfVpOo7CCsJmd5eJqtQNXvawOYgkCRtEw=;\n b=NLi+PM8/2N+/J/cdOSjFnxywNzCN7H/nWjVLE4CDFVC7D/rslwhyGUpaW1jing+/G3iada\n Ql22sN23NhWCCfjRy1QOfVxcAHHDBrK5M1r2RAy8pHZjSnkBez94gZtidQVE5jFzTQ3cWb\n Fp3HCoOK9wbtITphLy7ErPs/fQCzvBI=","X-MC-Unique":"4Bgr54E8MqGAdIk7WGoUXg-1","X-Mimecast-MFC-AGG-ID":"4Bgr54E8MqGAdIk7WGoUXg_1775230279","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20251104; t=1775230279; x=1775835079;\n h=cc:to:subject:message-id:date:from:in-reply-to:references\n :mime-version:x-gm-gg:x-gm-message-state:from:to:cc:subject:date\n :message-id:reply-to;\n bh=op9zsKSVPpnfVpOo7CCsJmd5eJqtQNXvawOYgkCRtEw=;\n b=kcZxN6E1ATCXxMjTYRQTuDJlCtTakd1VKKN/6uBrsNVWIOLeVvRiBnmAcXRCrB4R2x\n RMjJg+IL/pSima5CXHmsJ5Mosg6584BYSxG09TkqCeEd5dZUSDgkRwdorJLJFs/uvFFF\n NU8HTqw+hsAN14hBk0PeCMxuOMaRC1pMmzCqFMzZfP8NlReXkHaqADrnRSgY7TAmNqC7\n ex3l39KUDFJkyncP654DAa4B+Qpv3AOpKonw6EiZ7UjByy1W9At1vGQ620FgM02rwlvl\n mfm4uJLS658FCwcXNlJsPsFK/Q++JXv6F4dnH/FjPGnwczJIZEq2S0gyLf7kiCo12d4e\n ZKhg==","X-Forwarded-Encrypted":"i=1;\n AJvYcCWlpxRkpeEtDqRGAaD6vLubN++VQD9OagtapF2p/R+wTeeM0QC6CNDPhDfveY6sWDc5EgQJdm0FOLmEsQ==@gcc.gnu.org","X-Gm-Message-State":"AOJu0YwdU1PM02VzXQG7x6WO/bjb8ARdMPx0Qe5EzZ7MsSclTid1xLHw\n Y2l+XkkfjMmHMxuS27jTlOHlmAp6sufK+qpLQg+4QeBANhn0ftdbyZnPcDC88gov3Y6ixvGq1rr\n 8q0tlgWDePmoGDP3cPfyyNEiJg5P3q2ZSTsuJC1a+RMpVRM5jQBgYs6sCE9/g2pmNfFwpUwUURR\n mT+aPt4q2gBWKT6B+EDdbJ6CYPJj/HXLBDjA==","X-Gm-Gg":"AeBDieswrEsHcym1viapqCTd/qOn8aMUroqloFe7v9pNUeacsKL8ljomTezqBdawzLC\n JU+dZk1xciSnNKqoca4/7Ql0NbAZGsedp1xqRlQ0q3hiOQjjNXuCli6PTklzVSdnt6ZhSFR7w5D\n umKBF3zwWJ6HRleOZLlY0aZinsbUzdVjMtDNbA4tyGGpXepF/zeSkRB79rEuEDGB2LBSKnEjDOG\n kuNM4cOIQZHpWyk5vtlokLsFjJKWvSMzeSeuqlZAiTQXCz/D2Tm6d78xvPgPgUTSvIj","X-Received":["by 2002:a05:690c:110:b0:7a4:80ce:825e with SMTP id\n 00721157ae682-7a4d41b66d1mr35185387b3.25.1775230278800;\n Fri, 03 Apr 2026 08:31:18 -0700 (PDT)","by 2002:a05:690c:110:b0:7a4:80ce:825e with SMTP id\n 00721157ae682-7a4d41b66d1mr35185077b3.25.1775230278263; Fri, 03 Apr 2026\n 08:31:18 -0700 (PDT)"],"MIME-Version":"1.0","References":"<20260403114721.110965-1-tkaminsk@redhat.com>\n <CAKvuMXDKTKfe0h6AfC6ei42AL3av+zdaMmKVxgbn02pWyPHsHg@mail.gmail.com>\n <CAH6eHdRi0T7Z=ciLQ6_sA6LyOdh+f8mDPY75sBu1NVDChm1O5g@mail.gmail.com>","In-Reply-To":"\n <CAH6eHdRi0T7Z=ciLQ6_sA6LyOdh+f8mDPY75sBu1NVDChm1O5g@mail.gmail.com>","From":"Tomasz Kaminski <tkaminsk@redhat.com>","Date":"Fri, 3 Apr 2026 17:31:07 +0200","X-Gm-Features":"AQROBzD8-7-7xyVSkc8iGNGzXjaKYLKtRfT83OAjQFMGaiEHkVQjCzDunsqaop4","Message-ID":"\n <CAKvuMXDhuRJdhWSZo+jaaLUnRMtDzBQB3jhJUz3hyA+TTM30mQ@mail.gmail.com>","Subject":"Re: [PATCH] libstdc++: Export explicit instantiations of\n __format::__do_vformat_to.","To":"Jonathan Wakely <jwakely.gcc@gmail.com>","Cc":"\"libstdc++\" <libstdc++@gcc.gnu.org>, gcc-patches <gcc-patches@gcc.gnu.org>","X-Mimecast-Spam-Score":"0","X-Mimecast-MFC-PROC-ID":"nU1OJxBISHKnakv9wtIs3rPRjhdfcgOlK3ZLdF9e_hE_1775230279","X-Mimecast-Originator":"redhat.com","Content-Type":"multipart/alternative; boundary=\"00000000000021c19c064e9002ad\"","X-BeenThere":"gcc-patches@gcc.gnu.org","X-Mailman-Version":"2.1.30","Precedence":"list","List-Id":"Gcc-patches mailing list <gcc-patches.gcc.gnu.org>","List-Unsubscribe":"<https://gcc.gnu.org/mailman/options/gcc-patches>,\n <mailto:gcc-patches-request@gcc.gnu.org?subject=unsubscribe>","List-Archive":"<https://gcc.gnu.org/pipermail/gcc-patches/>","List-Post":"<mailto:gcc-patches@gcc.gnu.org>","List-Help":"<mailto:gcc-patches-request@gcc.gnu.org?subject=help>","List-Subscribe":"<https://gcc.gnu.org/mailman/listinfo/gcc-patches>,\n <mailto:gcc-patches-request@gcc.gnu.org?subject=subscribe>","Errors-To":"gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org"}},{"id":3673208,"web_url":"http://patchwork.ozlabs.org/comment/3673208/","msgid":"<CAH6eHdRTf8fE6rrSR9eGNRCvhPsuU0BDd+PGVwHSoc0H_=HJvQ@mail.gmail.com>","list_archive_url":null,"date":"2026-04-03T16:25:35","subject":"Re: [PATCH] libstdc++: Export explicit instantiations of\n __format::__do_vformat_to.","submitter":{"id":4329,"url":"http://patchwork.ozlabs.org/api/people/4329/","name":"Jonathan Wakely","email":"jwakely.gcc@gmail.com"},"content":"On Fri, 3 Apr 2026, 16:31 Tomasz Kaminski, <tkaminsk@redhat.com> wrote:\n\n>\n>\n> On Fri, Apr 3, 2026 at 5:21 PM Jonathan Wakely <jwakely.gcc@gmail.com>\n> wrote:\n>\n>>\n>>\n>> On Fri, 3 Apr 2026, 12:50 Tomasz Kaminski, <tkaminsk@redhat.com> wrote:\n>>\n>>>\n>>>\n>>> On Fri, Apr 3, 2026 at 1:48 PM Tomasz Kamiński <tkaminsk@redhat.com>\n>>> wrote:\n>>>\n>>>> This patch exports instantiations of __format::__do_vformat_to\n>>>> for _Sink_iter and char/wchar_t. As every format function is\n>>>> implementing as delegating the one of these overloads, this\n>>>> significantly reduces the compliation time.\n>>>>\n>>>> Instantiating __format::__do_vformat_to triggers specializations\n>>>> of formatters for types stored in handle direclty (arithmetic\n>>>> types, strings), however we do not export any of their symbols.\n>>>> This keeps the interface boundary minimal. This file should\n>>>> be recompiled in later mode, when it is called stable.\n>>>>\n>>>> libstdc++-v3/ChangeLog:\n>>>>\n>>>>         * config/abi/pre/gnu.ver (GLIBCXX_3.4): Exclude exports\n>>>>         of std::basic_fo* (matching basic_format_context).\n>>>>         (GLIBCXX_3.4.35): Export __format::__do_vformat_to\n>>>>         specializations for _Sink_iter and char/wchar_t.\n>>>>         * include/std/format: (__format::__do_vformat_to):\n>>>>         Remove inline and declare extern instantiation\n>>>>         of __format::__do_vformat_to _Sink_iter and char/wchar_t.\n>>>>         * src/c++20/Makefile.am: Add format-inst.cc.\n>>>>         * src/c++20/Makefile.in: Regenerate.\n>>>>         * src/c++20/format-inst.cc: New file defining explicit\n>>>>         instantiation.\n>>>> ---\n>>>> From simple test on files from testsuite/std/format/functions/, the\n>>>> results looks very promising:\n>>>>\n>>>>                 Before  After\n>>>> format.cc       24.203s 10.846s\n>>>> format_to.cc    18.475s 2.844s\n>>>> format_to_n.cc  18.677s 3.074s\n>>>> vformat_to.cc   17.281s 2.246s\n>>>>\n>>>> However, I am a bit concerned if the approach works, as\n>>>> libstdc++.so will always contains weak simbol for __do_vformat_to\n>>>> for _Sink_iter<char>, that supports only C++20 specifiers.\n>>>> Should we instead compile the format-inst in latest mode, and\n>>>> always provide extern defintion?\n>>>> Note that the same problem will also be present for the print function,\n>>>> but I haven not realized it then.\n>>>>\n>>> The scenarios like that are not only teoreticall, debug support (?) for\n>>> string and char was recently added.\n>>>\n>>\n>> Yes, I think we should instantiate the latest definition.\n>>\n>> Before C++26 there's no way to use those new format specifiers anyway,\n>> because the format string is always parsed as a consteval format_string and\n>> so only C++20 or C++23 formats will be recognized.\n>>\n> You can observe this by calling vformat_to, and we have a test checking if\n> vformat_to(\"{:?}\", string) works or not,\n> so we will end up in unfortunae situation when ? is supported for dynamic\n> formatting, but not for static one.\n>\n> I am experimenting with adding _M_ftm member to basic_format_context and\n> basic_format_parse_context,\n> and using it to decide if given format specifier should be rejected.\n>\n\nThe explicit instantiation is only declared for C++20:\n\n+#if __cplusplus <= 202002L\n\n(That should be just == not <= since format was new in C++20)\n\nSo if the instantiation only knows about C++20 specifiers that's ok, it\nwon't be used by C++23 and C++26 code.\n\nWe can figure out how to export different versions at a future date (maybe\nusing an abi_tag attribute to distinguish the instantiations).\n\n\n\n\n\n>>\n>>>>","headers":{"Return-Path":"<gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org>","X-Original-To":["incoming@patchwork.ozlabs.org","gcc-patches@gcc.gnu.org"],"Delivered-To":["patchwork-incoming@legolas.ozlabs.org","gcc-patches@gcc.gnu.org"],"Authentication-Results":["legolas.ozlabs.org;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256\n header.s=20251104 header.b=OEtr8+G3;\n\tdkim-atps=neutral","legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org\n (client-ip=2620:52:6:3111::32; helo=vm01.sourceware.org;\n envelope-from=gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org;\n receiver=patchwork.ozlabs.org)","sourceware.org;\n\tdkim=pass (2048-bit key,\n unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256\n header.s=20251104 header.b=OEtr8+G3","sourceware.org;\n dmarc=pass (p=none dis=none) header.from=gmail.com","sourceware.org; spf=pass smtp.mailfrom=gmail.com","server2.sourceware.org;\n arc=pass smtp.remote-ip=209.85.208.182"],"Received":["from vm01.sourceware.org (vm01.sourceware.org\n [IPv6:2620:52:6:3111::32])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519 server-signature ECDSA (secp384r1) server-digest SHA384)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4fnPHN2xGqz1xtJ\n\tfor <incoming@patchwork.ozlabs.org>; Sat, 04 Apr 2026 03:26:24 +1100 (AEDT)","from vm01.sourceware.org (localhost [127.0.0.1])\n\tby sourceware.org (Postfix) with ESMTP id 47B194BA23E5\n\tfor <incoming@patchwork.ozlabs.org>; Fri,  3 Apr 2026 16:26:22 +0000 (GMT)","from mail-lj1-f182.google.com (mail-lj1-f182.google.com\n [209.85.208.182])\n by sourceware.org (Postfix) with ESMTPS id 0753F4BA2E36\n for <gcc-patches@gcc.gnu.org>; Fri,  3 Apr 2026 16:25:48 +0000 (GMT)","by mail-lj1-f182.google.com with SMTP id\n 38308e7fff4ca-3878de20527so18067411fa.3\n for <gcc-patches@gcc.gnu.org>; Fri, 03 Apr 2026 09:25:47 -0700 (PDT)"],"DKIM-Filter":["OpenDKIM Filter v2.11.0 sourceware.org 47B194BA23E5","OpenDKIM Filter v2.11.0 sourceware.org 0753F4BA2E36"],"DMARC-Filter":"OpenDMARC Filter v1.4.2 sourceware.org 0753F4BA2E36","ARC-Filter":"OpenARC Filter v1.0.0 sourceware.org 0753F4BA2E36","ARC-Seal":["i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1775233548; cv=pass;\n b=EzQVtrtSaVD8w50KVudSKr61492+afHsdBhNguNkJcwhVGSRZFkHSiqarWxOni/HAkcm56z/u/TVRrYMobvyjFiyWdmqRKfJYkb2zGBMvFAJyfvYlUIPwMo6OBi9vgy39It+dU2R7oWjs6TeHnYaAfnlQIf78zT2950W6pPDxOs=","i=1; a=rsa-sha256; t=1775233547; cv=none;\n d=google.com; s=arc-20240605;\n b=Gc6AwDiZLiZoy3e9YoeSh2s5kxM3gUztRvkMmdKM9v3E17l2QVSWALx/qnqrF8qByp\n JPyskaIrBB/b5bwn6H6hgyBv1tU+Lluf9CUNoaAQ1fABBMgeN/LjyToVz6FT9Gs7sp8v\n oVAXmdI3qaP+VEAZ9lGlInOEMOoLvu15D+kcAwVu1EOuAscyAOVDKih8Bwt4RPJE6IBC\n DlSZlg39ZpM3zvyZQ2a1g6TxICA0yAb44YUqktQ3YKrYPRMGJi1ixwGn+qea1nkPwwuJ\n tSXzlvKbItlLBXlg2S1kflByOFyuflx4dwQmUcGehaw43u5KcrGEtK8PK9tWyclkyszw\n BUog=="],"ARC-Message-Signature":["i=2; a=rsa-sha256; d=sourceware.org; s=key;\n t=1775233548; c=relaxed/simple;\n bh=ak27ej5Frs/m06xPTHMmD5VBn1it4eB+JnNje1Gp4pE=;\n h=DKIM-Signature:MIME-Version:From:Date:Message-ID:Subject:To;\n b=WajWF235Jyi41lZkYAbMCvMXfvbQ+9YtqUV+xsv0YsMZ5oMalIIe4BR3o5L7ZZYaWzyESxqlPnS2cAP7ZCRsOfD61M5nPqcDGiNCIluLECutMrHopy+I9PMTTqjaSK2xIaLcFKyEIOvLXJ8WlMr9Gx+Eo3d4JxCa2NCDqNBQHuI=","i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com;\n s=arc-20240605;\n h=cc:to:subject:message-id:date:from:in-reply-to:references\n :mime-version:dkim-signature;\n bh=9k0po/fJBFlKBnaTzEg5V6FXNH7CBrPkt7jrdhL+Bdo=;\n fh=RnFH3iJrIQJqjv3BzAGmazRikNx7eZYt4wDTuw3En+w=;\n b=GhvaZTVPPTjY2SmDjZw1qNIW1fbAUnQvL52imCsK4AUPNdmum0c+/82g8T+dZBLzWG\n Dx1G2uYY+X5EbuWHibXSEwQNdI3czl3xGB3nJkpzRxlHPp/H7WMqT/b6/1oQfXxp/Kid\n EBBudOBdHHA8rGdWifkzMYa78eQ6ZsbE3JBLkm3Y3qXgfAhKJVKNExkFJTCV93m010aj\n zWyzn1guIsiDAhV91Xm77EQRH9C7tTtcevpZ2r07QUN7xXPo8QMVLvA1aHPvulKFgqFQ\n UQupVM6Kw1O4CV4mEj8MwXr7byx9nFR5ctSIoPi32pHibZBRTbk1cqGLdV51od7ptX6r\n CXgg==; darn=gcc.gnu.org"],"ARC-Authentication-Results":["i=2; server2.sourceware.org","i=1; mx.google.com; arc=none"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=gmail.com; s=20251104; t=1775233547; x=1775838347; darn=gcc.gnu.org;\n h=cc:to:subject:message-id:date:from:in-reply-to:references\n :mime-version:from:to:cc:subject:date:message-id:reply-to;\n bh=9k0po/fJBFlKBnaTzEg5V6FXNH7CBrPkt7jrdhL+Bdo=;\n b=OEtr8+G36BhAIdtmH7jmf5B0apQaGlC1m6aNHXH6TkivhVgVrsgX0KsibUJRb6X2OG\n 4hpTIQhSQ+IPCGvgzVL4aooWfWQehCuWsPHzYtYHYoyxo8UKeMRRm3uy/vtIQ8kImuBa\n y4wp0yfEyhgbvEnBHgb0FkSJqyNUEn/pHUqVBEJnkc3oDire8f34TC73OPW/Tn6Gb8LU\n Njwugci2SNkgy+308vvQy5sssA2Wos5EGswhi3gX0MBC2iQ/l0ZLBJcnHomkoLACranT\n sQJ4hUn9FZwHO9H7g8btBiyTC6iPD9nlILrsDJ6NH/sBpisAWPJ+g+FIXVzX1xLXZAdn\n /e7w==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20251104; t=1775233547; x=1775838347;\n h=cc:to:subject:message-id:date:from:in-reply-to:references\n :mime-version:x-gm-gg:x-gm-message-state:from:to:cc:subject:date\n :message-id:reply-to;\n bh=9k0po/fJBFlKBnaTzEg5V6FXNH7CBrPkt7jrdhL+Bdo=;\n b=AjXRCW+Kq7t6C6CldGpiqj3CmUsiRIIi1QYaCd7+4agbCz+DG4y/AqayHOKWsp0xp1\n GObWkeaMh0qbFIkCu8YWZSogUb8IaBvoqLXImcC51ul9lOcO9AQ/2OqTjxBCgYEpzPS+\n cvIah1fnnh/BS384OtdJnpNnEJhc+b7hKQiDHLe/rjdN9SrEldnb/T6Ae3XvkpIu6Ytf\n XaXuntZPTLBfft9YDYIPy3ItVrzJgVKJW3E3wdGb6nztQtA/ZZ8DvVTydJG1elO+IW2V\n lFOAAGsOFvLahV5+WJnERgSjH1POlh5gec64aU0w0iHptQ0iXwnNKm6fNacRBA4oZ2vU\n hdgg==","X-Forwarded-Encrypted":"i=1;\n AJvYcCVHGubhXMhVm/AmXOoTTte5LBPVkLytyEGBygmjlRWxKIWllVbe+FgsJKGNoQF9dwCyxbS4SSEiTDHBhw==@gcc.gnu.org","X-Gm-Message-State":"AOJu0YzyX1OuFe3JNtnDZdYsSV2iEUXCsjdeuYExTx3LHvKOCXlEDINQ\n Y8iOpzAqd0MNRi5YJ4J1wCHtKKVwsZSNZo1L52SUin335hIheUIwj0xxKr4n9sP9bRF1+6l7K0A\n moU2spGRnCIlJiK80a7OY5KpI7Sf/438=","X-Gm-Gg":"AeBDies2vehM7Lh96/6KUaLBmQUrFq0xYjE/YMlwtkAfF+5Ii4QrOpo6XCZ7Dq71fXU\n 3WhsWoiUS1+8xPpVYVOpcNkgi3OhbS+GzmaFzdtykf1V5MtAi6fjI22LkiAfeihrlH5vMe6gVl1\n vIzkvnDrbsUeX2Iu5zR28m5d1q0Y95kT5ktGFgtNb78aP3WABzQ18KQaBYYZk9BE7ZSJdcHFdsx\n IXFZDqyr4oFpeFlLTHT7MIaXhIZgc/c9jhCFAWftaZcsZpTdXQ9NvfUhpudFJHA5KqFb2aKzd7m\n lnyMIVXWSKOy5bjLpEth5aIIn4MktWDDrPuzC0vyJjmLD2iTcWxrBdVBo8XrtobW3s0kkPZHDq6\n Ar9M94amIPByBhNn3wdHIe4AC8sA=","X-Received":"by 2002:a2e:8a96:0:b0:37f:8332:6ae0 with SMTP id\n 38308e7fff4ca-38d9d43c9d3mr10449891fa.33.1775233546352; Fri, 03 Apr 2026\n 09:25:46 -0700 (PDT)","MIME-Version":"1.0","References":"<20260403114721.110965-1-tkaminsk@redhat.com>\n <CAKvuMXDKTKfe0h6AfC6ei42AL3av+zdaMmKVxgbn02pWyPHsHg@mail.gmail.com>\n <CAH6eHdRi0T7Z=ciLQ6_sA6LyOdh+f8mDPY75sBu1NVDChm1O5g@mail.gmail.com>\n <CAKvuMXDhuRJdhWSZo+jaaLUnRMtDzBQB3jhJUz3hyA+TTM30mQ@mail.gmail.com>","In-Reply-To":"\n <CAKvuMXDhuRJdhWSZo+jaaLUnRMtDzBQB3jhJUz3hyA+TTM30mQ@mail.gmail.com>","From":"Jonathan Wakely <jwakely.gcc@gmail.com>","Date":"Fri, 3 Apr 2026 17:25:35 +0100","X-Gm-Features":"AQROBzB-HEJ9f8FDTZH2RVy0TAxyUsgSAHESD_keEE8gF_JYnRfR_SI7TXlo9SY","Message-ID":"\n <CAH6eHdRTf8fE6rrSR9eGNRCvhPsuU0BDd+PGVwHSoc0H_=HJvQ@mail.gmail.com>","Subject":"Re: [PATCH] libstdc++: Export explicit instantiations of\n __format::__do_vformat_to.","To":"Tomasz Kaminski <tkaminsk@redhat.com>","Cc":"\"libstdc++\" <libstdc++@gcc.gnu.org>, gcc-patches <gcc-patches@gcc.gnu.org>","Content-Type":"multipart/alternative; boundary=\"000000000000ec7c3f064e90c47e\"","X-BeenThere":"gcc-patches@gcc.gnu.org","X-Mailman-Version":"2.1.30","Precedence":"list","List-Id":"Gcc-patches mailing list <gcc-patches.gcc.gnu.org>","List-Unsubscribe":"<https://gcc.gnu.org/mailman/options/gcc-patches>,\n <mailto:gcc-patches-request@gcc.gnu.org?subject=unsubscribe>","List-Archive":"<https://gcc.gnu.org/pipermail/gcc-patches/>","List-Post":"<mailto:gcc-patches@gcc.gnu.org>","List-Help":"<mailto:gcc-patches-request@gcc.gnu.org?subject=help>","List-Subscribe":"<https://gcc.gnu.org/mailman/listinfo/gcc-patches>,\n <mailto:gcc-patches-request@gcc.gnu.org?subject=subscribe>","Errors-To":"gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org"}},{"id":3673223,"web_url":"http://patchwork.ozlabs.org/comment/3673223/","msgid":"<CAKvuMXAicpvpLJvr9_BSrFK-jfnz-Y3YM7SP=H7XhZa7v=sCPg@mail.gmail.com>","list_archive_url":null,"date":"2026-04-03T16:44:10","subject":"Re: [PATCH] libstdc++: Export explicit instantiations of\n __format::__do_vformat_to.","submitter":{"id":90409,"url":"http://patchwork.ozlabs.org/api/people/90409/","name":"Tomasz Kamiński","email":"tkaminsk@redhat.com"},"content":"On Fri, Apr 3, 2026 at 6:25 PM Jonathan Wakely <jwakely.gcc@gmail.com>\nwrote:\n\n>\n>\n> On Fri, 3 Apr 2026, 16:31 Tomasz Kaminski, <tkaminsk@redhat.com> wrote:\n>\n>>\n>>\n>> On Fri, Apr 3, 2026 at 5:21 PM Jonathan Wakely <jwakely.gcc@gmail.com>\n>> wrote:\n>>\n>>>\n>>>\n>>> On Fri, 3 Apr 2026, 12:50 Tomasz Kaminski, <tkaminsk@redhat.com> wrote:\n>>>\n>>>>\n>>>>\n>>>> On Fri, Apr 3, 2026 at 1:48 PM Tomasz Kamiński <tkaminsk@redhat.com>\n>>>> wrote:\n>>>>\n>>>>> This patch exports instantiations of __format::__do_vformat_to\n>>>>> for _Sink_iter and char/wchar_t. As every format function is\n>>>>> implementing as delegating the one of these overloads, this\n>>>>> significantly reduces the compliation time.\n>>>>>\n>>>>> Instantiating __format::__do_vformat_to triggers specializations\n>>>>> of formatters for types stored in handle direclty (arithmetic\n>>>>> types, strings), however we do not export any of their symbols.\n>>>>> This keeps the interface boundary minimal. This file should\n>>>>> be recompiled in later mode, when it is called stable.\n>>>>>\n>>>>> libstdc++-v3/ChangeLog:\n>>>>>\n>>>>>         * config/abi/pre/gnu.ver (GLIBCXX_3.4): Exclude exports\n>>>>>         of std::basic_fo* (matching basic_format_context).\n>>>>>         (GLIBCXX_3.4.35): Export __format::__do_vformat_to\n>>>>>         specializations for _Sink_iter and char/wchar_t.\n>>>>>         * include/std/format: (__format::__do_vformat_to):\n>>>>>         Remove inline and declare extern instantiation\n>>>>>         of __format::__do_vformat_to _Sink_iter and char/wchar_t.\n>>>>>         * src/c++20/Makefile.am: Add format-inst.cc.\n>>>>>         * src/c++20/Makefile.in: Regenerate.\n>>>>>         * src/c++20/format-inst.cc: New file defining explicit\n>>>>>         instantiation.\n>>>>> ---\n>>>>> From simple test on files from testsuite/std/format/functions/, the\n>>>>> results looks very promising:\n>>>>>\n>>>>>                 Before  After\n>>>>> format.cc       24.203s 10.846s\n>>>>> format_to.cc    18.475s 2.844s\n>>>>> format_to_n.cc  18.677s 3.074s\n>>>>> vformat_to.cc   17.281s 2.246s\n>>>>>\n>>>>> However, I am a bit concerned if the approach works, as\n>>>>> libstdc++.so will always contains weak simbol for __do_vformat_to\n>>>>> for _Sink_iter<char>, that supports only C++20 specifiers.\n>>>>> Should we instead compile the format-inst in latest mode, and\n>>>>> always provide extern defintion?\n>>>>> Note that the same problem will also be present for the print function,\n>>>>> but I haven not realized it then.\n>>>>>\n>>>> The scenarios like that are not only teoreticall, debug support (?) for\n>>>> string and char was recently added.\n>>>>\n>>>\n>>> Yes, I think we should instantiate the latest definition.\n>>>\n>>> Before C++26 there's no way to use those new format specifiers anyway,\n>>> because the format string is always parsed as a consteval format_string and\n>>> so only C++20 or C++23 formats will be recognized.\n>>>\n>> You can observe this by calling vformat_to, and we have a test checking\n>> if vformat_to(\"{:?}\", string) works or not,\n>> so we will end up in unfortunae situation when ? is supported for dynamic\n>> formatting, but not for static one.\n>>\n>> I am experimenting with adding _M_ftm member to basic_format_context and\n>> basic_format_parse_context,\n>> and using it to decide if given format specifier should be rejected.\n>>\n>\n> The explicit instantiation is only declared for C++20:\n>\n> +#if __cplusplus <= 202002L\n>\n> (That should be just == not <= since format was new in C++20)\n>\n> So if the instantiation only knows about C++20 specifiers that's ok, it\n> won't be used by C++23 and C++26 code.\n>\nYes, I have discussed that with Jason and he confirmed that this is indeed\nthe case, i.e. the weak symbol from\n.so will not be picked over program defined one for C++23 (for this version\nwe do not provide explicit specialization).\n\nBut then if you mix program using TUs compiled with differnt TUs, you will\nget only one behavior currently.\nThe same applies to __formatter_int specializations, one parse/format\nmethod is selected for whole program, and they\nmay not match - i.e. parse may allow more than format can handle.\n\nMy ftm based solution works (requires additional field inside the\nbasic_format_parse_context), however now I have noticed\nthat for the debug format, we need to select how to treat encoding type as\nruntime, as libstdc++.so may be compiled with\ndifferent literal encoding than program is, and thus require string to be\nencoded differently. I think resonable solution\nhere would be to put literal for char encoding indicator inside format\ncontext, and we have last chance to do it.\n\n\n\n>  We can figure out how to export different versions at a future date\n> (maybe using an abi_tag attribute to distinguish the instantiations).\n>\nJason suggested adding a non-type template argument defaulted to feature\ntest macro (I would preffer to use __cplusplus version).","headers":{"Return-Path":"<gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org>","X-Original-To":["incoming@patchwork.ozlabs.org","gcc-patches@gcc.gnu.org"],"Delivered-To":["patchwork-incoming@legolas.ozlabs.org","gcc-patches@gcc.gnu.org"],"Authentication-Results":["legolas.ozlabs.org;\n\tdkim=pass (1024-bit key;\n unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256\n header.s=mimecast20190719 header.b=W3RAcW+7;\n\tdkim-atps=neutral","legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org\n (client-ip=38.145.34.32; helo=vm01.sourceware.org;\n envelope-from=gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org;\n receiver=patchwork.ozlabs.org)","sourceware.org;\n\tdkim=pass (1024-bit key,\n unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256\n header.s=mimecast20190719 header.b=W3RAcW+7","sourceware.org; dmarc=pass (p=quarantine dis=none)\n header.from=redhat.com","sourceware.org; spf=pass smtp.mailfrom=redhat.com","server2.sourceware.org;\n arc=none smtp.remote-ip=170.10.129.124"],"Received":["from vm01.sourceware.org (vm01.sourceware.org [38.145.34.32])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519 server-signature ECDSA (secp384r1) server-digest SHA384)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4fnPj36Nylz1yCt\n\tfor <incoming@patchwork.ozlabs.org>; Sat, 04 Apr 2026 03:45:11 +1100 (AEDT)","from vm01.sourceware.org (localhost [127.0.0.1])\n\tby sourceware.org (Postfix) with ESMTP id D8C724BA23F2\n\tfor <incoming@patchwork.ozlabs.org>; Fri,  3 Apr 2026 16:45:09 +0000 (GMT)","from us-smtp-delivery-124.mimecast.com\n (us-smtp-delivery-124.mimecast.com [170.10.129.124])\n by sourceware.org (Postfix) with ESMTP id 5ED4A4BA23D3\n for <gcc-patches@gcc.gnu.org>; Fri,  3 Apr 2026 16:44:24 +0000 (GMT)","from mail-yw1-f198.google.com (mail-yw1-f198.google.com\n [209.85.128.198]) by relay.mimecast.com with ESMTP with STARTTLS\n (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id\n us-mta-575-AGGFYNPNPdSXWOaMMvArJg-1; Fri, 03 Apr 2026 12:44:22 -0400","by mail-yw1-f198.google.com with SMTP id\n 00721157ae682-790afc07667so22038107b3.0\n for <gcc-patches@gcc.gnu.org>; Fri, 03 Apr 2026 09:44:22 -0700 (PDT)"],"DKIM-Filter":["OpenDKIM Filter v2.11.0 sourceware.org D8C724BA23F2","OpenDKIM Filter v2.11.0 sourceware.org 5ED4A4BA23D3"],"DMARC-Filter":"OpenDMARC Filter v1.4.2 sourceware.org 5ED4A4BA23D3","ARC-Filter":"OpenARC Filter v1.0.0 sourceware.org 5ED4A4BA23D3","ARC-Seal":"i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1775234664; cv=none;\n b=bpWfONH9ImRpzWM0DllXQs3zNtSP3t20wfTntWr0PPIxmh1kh3x7LX0iq3HLB2219E7BhdAnjXzABZFOo0J2aoDw5z5PvMXKxd/su0cuBpfUEY/pY9Crfo+hcTUW90m5DrRO78yPT6ASmmpPQfue6j5ayg+hV5c7mgDRu51O2f8=","ARC-Message-Signature":"i=1; a=rsa-sha256; d=sourceware.org; s=key;\n t=1775234664; c=relaxed/simple;\n bh=08Nyhv1JIt1g8IPQezbbES4r1WRt2c2FVxjoLNiLYCU=;\n h=DKIM-Signature:MIME-Version:From:Date:Message-ID:Subject:To;\n b=B8hZfd40bJLCLWjoDiczg9Do8UCKAONLNN6BEfgfhELBaldyK0lsIsIK9clm4byoOYv//eKStY3Pr8c0GtMwo6I2SH7rv4behU9VME0S6gju9iVlM0Di+2o3N8K+PisSZt08oEFA1KYr3hjwFRx8Wi+wsl7D4d7QqPKUZQBBzWM=","ARC-Authentication-Results":"i=1; server2.sourceware.org","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;\n s=mimecast20190719; t=1775234664;\n h=from:from:reply-to:subject:subject:date:date:message-id:message-id:\n to:to:cc:cc:mime-version:mime-version:content-type:content-type:\n in-reply-to:in-reply-to:references:references;\n bh=fGnmdPHUsoZq7/ulbdr/54oUKBPAF1lChezlNUpDyTk=;\n b=W3RAcW+7JAZiQ1RaKpPYb/YEIGjm5yqjU+xdBi7laaMQFNmNP1qy9NZrHSwHQckjzeK5td\n tSU9PJFxk36JBNAMq+/SRWY3SVU3y/8OuTZM4HlAkXdf3IEHuJHukEiIejlo64v11RyfAQ\n Ckdxt8JDQIdtc9py2geQKTI4i6bePqY=","X-MC-Unique":"AGGFYNPNPdSXWOaMMvArJg-1","X-Mimecast-MFC-AGG-ID":"AGGFYNPNPdSXWOaMMvArJg_1775234662","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20251104; t=1775234662; x=1775839462;\n h=cc:to:subject:message-id:date:from:in-reply-to:references\n :mime-version:x-gm-gg:x-gm-message-state:from:to:cc:subject:date\n :message-id:reply-to;\n bh=fGnmdPHUsoZq7/ulbdr/54oUKBPAF1lChezlNUpDyTk=;\n b=USmmzRc4GwKj1aqnCKaSvs5r/4rcD5zEa3lD9qepx62IxsJvrvMTSGuc13aiPgPDM8\n 6ci4+2i8nfqDLktW+SGoqEjN7MvrL6cXlvyyQilspb3w38K1w5pdjLCAZupEaaFpBW9H\n Pd7cXPk6JrLFJxm4FApaSmUyIPHlGMRQAMZGzbXlXylzFZdqZphqmEJBPkEN8P/U9bSD\n B67XTFcWSTaAgWi2NDrasVStjY+8GNvrrH0Ar1/YBo7c/58nQFnUhTrtdBub4RRLLy0M\n pVDWpqzDxPfTQIFZNqZcXLlGYH1YZIk4m7Fu7r5tWsESM3zIICzoEIyaHprc/P7uwbHY\n /7eQ==","X-Forwarded-Encrypted":"i=1;\n AJvYcCUDndCVzXBSO4vbUCW901Lu3BhhAfffuCDSQB3FXG3Fcaf5fgv2uBvh5BCP/Na5r22SwcFND4/v4BHQRA==@gcc.gnu.org","X-Gm-Message-State":"AOJu0Yy6H4uYvKvf/74be2Z6peZLwneE9y8vYronWmIiHT1Hi5W6le82\n SjK51+Z2U75RowS26Kth66XSCIvtNfHViZuh58xBeyX/wL0sp7H849iDh6nY/cWzDgslMMO5iP4\n hmQSo/bv8GFSvx2CxjRAjyvcyIEPvVwwIj/vRx93EQBjdlbXKhsji7xRWLdXEpczD5vZnz63vwC\n PrRVyZ634PhYqxTANrw+WhEo+XoX/UBetcpQ==","X-Gm-Gg":"AeBDieuZDbuC2rNduZjug+OWG+wKtqZHXiE0dD/PirUOhCuzuDfSDLBdDG5gxislbzx\n APmmQntDeF00ghP7k//DeVIcrzHqMG75iJXm2dVTkBodUSaazkNeIORmz7gLGXYQZCo6Z1tHHUv\n KOJac6KhF2MQ0NODPt1v5fmpt8AKlkUFwJ/CN2SkhxiGAXCAtjAG3EBcnLXYIEQppyluM6oSQhD\n /LDJtuKAWSE8kg8uWJEntrfaoEg2BOHW2avITsXTJRsxSVdO3BwZlHLexEf7WauahxM","X-Received":["by 2002:a05:690c:101:b0:7a4:e4e5:3910 with SMTP id\n 00721157ae682-7a4e4e54243mr32788857b3.50.1775234662058;\n Fri, 03 Apr 2026 09:44:22 -0700 (PDT)","by 2002:a05:690c:101:b0:7a4:e4e5:3910 with SMTP id\n 00721157ae682-7a4e4e54243mr32788507b3.50.1775234661610; Fri, 03 Apr 2026\n 09:44:21 -0700 (PDT)"],"MIME-Version":"1.0","References":"<20260403114721.110965-1-tkaminsk@redhat.com>\n <CAKvuMXDKTKfe0h6AfC6ei42AL3av+zdaMmKVxgbn02pWyPHsHg@mail.gmail.com>\n <CAH6eHdRi0T7Z=ciLQ6_sA6LyOdh+f8mDPY75sBu1NVDChm1O5g@mail.gmail.com>\n <CAKvuMXDhuRJdhWSZo+jaaLUnRMtDzBQB3jhJUz3hyA+TTM30mQ@mail.gmail.com>\n <CAH6eHdRTf8fE6rrSR9eGNRCvhPsuU0BDd+PGVwHSoc0H_=HJvQ@mail.gmail.com>","In-Reply-To":"\n <CAH6eHdRTf8fE6rrSR9eGNRCvhPsuU0BDd+PGVwHSoc0H_=HJvQ@mail.gmail.com>","From":"Tomasz Kaminski <tkaminsk@redhat.com>","Date":"Fri, 3 Apr 2026 18:44:10 +0200","X-Gm-Features":"AQROBzAsabX2wNjKXcMh02Ar4WG202ZAG_huHab0IzpnQMK6tqk09JLQ5is_MXY","Message-ID":"\n <CAKvuMXAicpvpLJvr9_BSrFK-jfnz-Y3YM7SP=H7XhZa7v=sCPg@mail.gmail.com>","Subject":"Re: [PATCH] libstdc++: Export explicit instantiations of\n __format::__do_vformat_to.","To":"Jonathan Wakely <jwakely.gcc@gmail.com>","Cc":"\"libstdc++\" <libstdc++@gcc.gnu.org>, gcc-patches <gcc-patches@gcc.gnu.org>","X-Mimecast-Spam-Score":"0","X-Mimecast-MFC-PROC-ID":"26nB4t1uXq9CW-yBFs6kAAf1Lqb5BzKVxaaPYcvr4ME_1775234662","X-Mimecast-Originator":"redhat.com","Content-Type":"multipart/alternative; boundary=\"000000000000661cae064e91077f\"","X-BeenThere":"gcc-patches@gcc.gnu.org","X-Mailman-Version":"2.1.30","Precedence":"list","List-Id":"Gcc-patches mailing list <gcc-patches.gcc.gnu.org>","List-Unsubscribe":"<https://gcc.gnu.org/mailman/options/gcc-patches>,\n <mailto:gcc-patches-request@gcc.gnu.org?subject=unsubscribe>","List-Archive":"<https://gcc.gnu.org/pipermail/gcc-patches/>","List-Post":"<mailto:gcc-patches@gcc.gnu.org>","List-Help":"<mailto:gcc-patches-request@gcc.gnu.org?subject=help>","List-Subscribe":"<https://gcc.gnu.org/mailman/listinfo/gcc-patches>,\n <mailto:gcc-patches-request@gcc.gnu.org?subject=subscribe>","Errors-To":"gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org"}},{"id":3673240,"web_url":"http://patchwork.ozlabs.org/comment/3673240/","msgid":"<CAKvuMXDSKWYLGwCa_GRCeYcfkgD=v68Fq_hVWJg1=KF2Ehjt=A@mail.gmail.com>","list_archive_url":null,"date":"2026-04-03T17:25:02","subject":"Re: [PATCH] libstdc++: Export explicit instantiations of\n __format::__do_vformat_to.","submitter":{"id":90409,"url":"http://patchwork.ozlabs.org/api/people/90409/","name":"Tomasz Kamiński","email":"tkaminsk@redhat.com"},"content":"On Fri, Apr 3, 2026 at 6:44 PM Tomasz Kaminski <tkaminsk@redhat.com> wrote:\n\n>\n>\n> On Fri, Apr 3, 2026 at 6:25 PM Jonathan Wakely <jwakely.gcc@gmail.com>\n> wrote:\n>\n>>\n>>\n>> On Fri, 3 Apr 2026, 16:31 Tomasz Kaminski, <tkaminsk@redhat.com> wrote:\n>>\n>>>\n>>>\n>>> On Fri, Apr 3, 2026 at 5:21 PM Jonathan Wakely <jwakely.gcc@gmail.com>\n>>> wrote:\n>>>\n>>>>\n>>>>\n>>>> On Fri, 3 Apr 2026, 12:50 Tomasz Kaminski, <tkaminsk@redhat.com> wrote:\n>>>>\n>>>>>\n>>>>>\n>>>>> On Fri, Apr 3, 2026 at 1:48 PM Tomasz Kamiński <tkaminsk@redhat.com>\n>>>>> wrote:\n>>>>>\n>>>>>> This patch exports instantiations of __format::__do_vformat_to\n>>>>>> for _Sink_iter and char/wchar_t. As every format function is\n>>>>>> implementing as delegating the one of these overloads, this\n>>>>>> significantly reduces the compliation time.\n>>>>>>\n>>>>>> Instantiating __format::__do_vformat_to triggers specializations\n>>>>>> of formatters for types stored in handle direclty (arithmetic\n>>>>>> types, strings), however we do not export any of their symbols.\n>>>>>> This keeps the interface boundary minimal. This file should\n>>>>>> be recompiled in later mode, when it is called stable.\n>>>>>>\n>>>>>> libstdc++-v3/ChangeLog:\n>>>>>>\n>>>>>>         * config/abi/pre/gnu.ver (GLIBCXX_3.4): Exclude exports\n>>>>>>         of std::basic_fo* (matching basic_format_context).\n>>>>>>         (GLIBCXX_3.4.35): Export __format::__do_vformat_to\n>>>>>>         specializations for _Sink_iter and char/wchar_t.\n>>>>>>         * include/std/format: (__format::__do_vformat_to):\n>>>>>>         Remove inline and declare extern instantiation\n>>>>>>         of __format::__do_vformat_to _Sink_iter and char/wchar_t.\n>>>>>>         * src/c++20/Makefile.am: Add format-inst.cc.\n>>>>>>         * src/c++20/Makefile.in: Regenerate.\n>>>>>>         * src/c++20/format-inst.cc: New file defining explicit\n>>>>>>         instantiation.\n>>>>>> ---\n>>>>>> From simple test on files from testsuite/std/format/functions/, the\n>>>>>> results looks very promising:\n>>>>>>\n>>>>>>                 Before  After\n>>>>>> format.cc       24.203s 10.846s\n>>>>>> format_to.cc    18.475s 2.844s\n>>>>>> format_to_n.cc  18.677s 3.074s\n>>>>>> vformat_to.cc   17.281s 2.246s\n>>>>>>\n>>>>>> However, I am a bit concerned if the approach works, as\n>>>>>> libstdc++.so will always contains weak simbol for __do_vformat_to\n>>>>>> for _Sink_iter<char>, that supports only C++20 specifiers.\n>>>>>> Should we instead compile the format-inst in latest mode, and\n>>>>>> always provide extern defintion?\n>>>>>> Note that the same problem will also be present for the print\n>>>>>> function,\n>>>>>> but I haven not realized it then.\n>>>>>>\n>>>>> The scenarios like that are not only teoreticall, debug support (?) for\n>>>>> string and char was recently added.\n>>>>>\n>>>>\n>>>> Yes, I think we should instantiate the latest definition.\n>>>>\n>>>> Before C++26 there's no way to use those new format specifiers anyway,\n>>>> because the format string is always parsed as a consteval format_string and\n>>>> so only C++20 or C++23 formats will be recognized.\n>>>>\n>>> You can observe this by calling vformat_to, and we have a test checking\n>>> if vformat_to(\"{:?}\", string) works or not,\n>>> so we will end up in unfortunae situation when ? is supported for\n>>> dynamic formatting, but not for static one.\n>>>\n>>> I am experimenting with adding _M_ftm member to basic_format_context and\n>>> basic_format_parse_context,\n>>> and using it to decide if given format specifier should be rejected.\n>>>\n>>\n>> The explicit instantiation is only declared for C++20:\n>>\n>> +#if __cplusplus <= 202002L\n>>\n>> (That should be just == not <= since format was new in C++20)\n>>\n>> So if the instantiation only knows about C++20 specifiers that's ok, it\n>> won't be used by C++23 and C++26 code.\n>>\n> Yes, I have discussed that with Jason and he confirmed that this is indeed\n> the case, i.e. the weak symbol from\n> .so will not be picked over program defined one for C++23 (for this\n> version we do not provide explicit specialization).\n>\n> But then if you mix program using TUs compiled with differnt TUs, you will\n> get only one behavior currently.\n> The same applies to __formatter_int specializations, one parse/format\n> method is selected for whole program, and they\n> may not match - i.e. parse may allow more than format can handle.\n>\n> My ftm based solution works (requires additional field inside the\n> basic_format_parse_context), however now I have noticed\n> that for the debug format, we need to select how to treat encoding type as\n> runtime, as libstdc++.so may be compiled with\n> different literal encoding than program is, and thus require string to be\n> encoded differently. I think resonable solution\n> here would be to put literal for char encoding indicator inside format\n> context, and we have last chance to do it.\n>\nThis problem also exists for C++20 chrono, where we transcode output for\nlocalized formatting.\n\n>\n>\n>\n>>  We can figure out how to export different versions at a future date\n>> (maybe using an abi_tag attribute to distinguish the instantiations).\n>>\n> Jason suggested adding a non-type template argument defaulted to feature\n> test macro (I would preffer to use __cplusplus version).\n>","headers":{"Return-Path":"<gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org>","X-Original-To":["incoming@patchwork.ozlabs.org","gcc-patches@gcc.gnu.org"],"Delivered-To":["patchwork-incoming@legolas.ozlabs.org","gcc-patches@gcc.gnu.org"],"Authentication-Results":["legolas.ozlabs.org;\n\tdkim=pass (1024-bit key;\n unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256\n header.s=mimecast20190719 header.b=D54/vjO6;\n\tdkim-atps=neutral","legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org\n (client-ip=38.145.34.32; helo=vm01.sourceware.org;\n envelope-from=gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org;\n receiver=patchwork.ozlabs.org)","sourceware.org;\n\tdkim=pass (1024-bit key,\n unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256\n header.s=mimecast20190719 header.b=D54/vjO6","sourceware.org; dmarc=pass (p=quarantine dis=none)\n header.from=redhat.com","sourceware.org; spf=pass smtp.mailfrom=redhat.com","server2.sourceware.org;\n arc=none smtp.remote-ip=170.10.133.124"],"Received":["from vm01.sourceware.org (vm01.sourceware.org [38.145.34.32])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519 server-signature ECDSA (secp384r1) server-digest SHA384)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4fnQcR0d84z1xtJ\n\tfor <incoming@patchwork.ozlabs.org>; Sat, 04 Apr 2026 04:26:15 +1100 (AEDT)","from vm01.sourceware.org (localhost [127.0.0.1])\n\tby sourceware.org (Postfix) with ESMTP id 027E54BA9006\n\tfor <incoming@patchwork.ozlabs.org>; Fri,  3 Apr 2026 17:26:13 +0000 (GMT)","from us-smtp-delivery-124.mimecast.com\n (us-smtp-delivery-124.mimecast.com [170.10.133.124])\n by sourceware.org (Postfix) with ESMTP id 5976B4BA2E15\n for <gcc-patches@gcc.gnu.org>; Fri,  3 Apr 2026 17:25:17 +0000 (GMT)","from mail-yw1-f199.google.com (mail-yw1-f199.google.com\n [209.85.128.199]) by relay.mimecast.com with ESMTP with STARTTLS\n (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id\n us-mta-486-_SPshO4LNJWPGubIrOMPCg-1; Fri, 03 Apr 2026 13:25:15 -0400","by mail-yw1-f199.google.com with SMTP id\n 00721157ae682-79cfec4344cso36111977b3.2\n for <gcc-patches@gcc.gnu.org>; Fri, 03 Apr 2026 10:25:15 -0700 (PDT)"],"DKIM-Filter":["OpenDKIM Filter v2.11.0 sourceware.org 027E54BA9006","OpenDKIM Filter v2.11.0 sourceware.org 5976B4BA2E15"],"DMARC-Filter":"OpenDMARC Filter v1.4.2 sourceware.org 5976B4BA2E15","ARC-Filter":"OpenARC Filter v1.0.0 sourceware.org 5976B4BA2E15","ARC-Seal":"i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1775237122; cv=none;\n b=AANy6fwfbal5tO1BS+L2GDPl0HdAWHA06cGVUnXHeWa41LyZ9Sq3yanVCP9IY57tbk6616PQYgz6ABAbvZQL/nA/Dk0Nh0YhNY0Ke7RIr4kozdmFoeyHyfkBTMG6vKE+hOHrSyZYLlc92X9TjZH1YWgdlcZ7n8qJaTbQIGxcFiI=","ARC-Message-Signature":"i=1; a=rsa-sha256; d=sourceware.org; s=key;\n t=1775237122; c=relaxed/simple;\n bh=vsNeJj8Qx++N7o+D7uLnpZ3w5IMFJ1/Lc8y5XruqA9w=;\n h=DKIM-Signature:MIME-Version:From:Date:Message-ID:Subject:To;\n b=DDCqFCPINHjXEseHvWIF05hn0o7A5GaFbwxxcDj0yB5pmBZXc2WLQuKctDSW+YAgoJJceOc84BSN5ttY0Mf1WFCZLlTS5vvoQRfbsJq3reo4cDjPbReFWjBfQB0NlZTfSMxZ6NHPA6s2vIdvB56WtBnZfuSGVmVKwtR7tSagFT4=","ARC-Authentication-Results":"i=1; server2.sourceware.org","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;\n s=mimecast20190719; t=1775237117;\n h=from:from:reply-to:subject:subject:date:date:message-id:message-id:\n to:to:cc:cc:mime-version:mime-version:content-type:content-type:\n in-reply-to:in-reply-to:references:references;\n bh=NGslldK+T6/xnHaCu1Xl3FHvJBPxzI0PolMLzuzt8XQ=;\n b=D54/vjO6ukIS2cVMR2L5vu1j7zkEZ0s5XQmh4nxZTF5f3+wpE368NEF6uJbIs2/QEmnx6x\n yBasgVzHTkX4o6kGecVun3oHlBWLaHiqB/bnyVWOhnsljZpJXLxWCbbL+lvocDlzpyHcwa\n vdeacOOMZ3qtnaWyNoJWEC0jYzXbRbg=","X-MC-Unique":"_SPshO4LNJWPGubIrOMPCg-1","X-Mimecast-MFC-AGG-ID":"_SPshO4LNJWPGubIrOMPCg_1775237115","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20251104; t=1775237115; x=1775841915;\n h=cc:to:subject:message-id:date:from:in-reply-to:references\n :mime-version:x-gm-gg:x-gm-message-state:from:to:cc:subject:date\n :message-id:reply-to;\n bh=NGslldK+T6/xnHaCu1Xl3FHvJBPxzI0PolMLzuzt8XQ=;\n b=P7XrV76EVtFf8Kezjt1UH7neyh7J57QzW6CHmaC8v/bpdR2y+RDKufMPhnrRLNrOlX\n qQV0immXndOsEmCX0zMW92LhLpKMv4yGvt1F4j00cq0FYCjeotqKf5SiWWqF71wO9EA2\n HZPSkSODSzcIpOT24fo/vmZOFh66onQ5ctO8YnOfZhMrjVZ9Hs7qchyK7lKGnJeqMzL3\n TaelWhj1vGxfPcpi6+KkP/mkzcIWXiMGSQhVVn7RLhhnD9FRlwDcNJzdh9F4pNlkzgiq\n OS8eBWeJS9TS0bYcpFPSUtjtzKHXW/120kw7MBxISOmX20hzUo5Rb58DfMP06E5vgN86\n kHzg==","X-Forwarded-Encrypted":"i=1;\n AJvYcCXjdvVRk26MPGbX2+Hx/EcU3ZE/1iA79w4hvrB0uGGiozb4QpkGwPOlL7rKnyJp0zKGOKbi1TkGH2LcXA==@gcc.gnu.org","X-Gm-Message-State":"AOJu0YwYd4uo5dP9c4F18Io1CnpWy+xCosK4AHwFLOBV5QPnq4e5Dr4A\n L+bnHty+ErqTTWiQ6YpuYWDmmlzydoo5NKmq1+0XHJDRHSv28t32iDSLqhBbU+bGb9+bLBj5Nvw\n GExYVeNaHif5gCKPYhkJh60ea+j4uNX3HkE+g23XGuWDTTqSbZnsSHeeHq3th4yJh+KLieZVGE0\n VRMBBUfQP3BtNljgAmSdyHleYKEU02/EDM7vIWKkDUdA==","X-Gm-Gg":"AeBDieu2sA+XyKaNW17oJnrovynes3Hs3AD1ziVchI0puuwNFZH9bVRR+BF0CvOhbxo\n PFHFhB7WZE7/W0YHIfZJFbvrEm6cAro6KjMWJbew/q6Z87T6A431jI4BDtY2n5H0LYqYoTskQSv\n Ko/mHIyMA8HpfUqRSs0oeWl7uXNr8gqZenBoIJZgQQgELddnk+NaC9eI5G6gJ1ugJ9++HD7fLUQ\n SMStRXXhnpmNqlb86aaM4jrRR/yB7d0f7xcI+ebD1GCNaDAQLNW1VQw/YV48utItlZw","X-Received":["by 2002:a05:690c:c183:b0:79a:b118:4386 with SMTP id\n 00721157ae682-7a4d60557fdmr33403027b3.48.1775237115013;\n Fri, 03 Apr 2026 10:25:15 -0700 (PDT)","by 2002:a05:690c:c183:b0:79a:b118:4386 with SMTP id\n 00721157ae682-7a4d60557fdmr33402857b3.48.1775237114535; Fri, 03 Apr 2026\n 10:25:14 -0700 (PDT)"],"MIME-Version":"1.0","References":"<20260403114721.110965-1-tkaminsk@redhat.com>\n <CAKvuMXDKTKfe0h6AfC6ei42AL3av+zdaMmKVxgbn02pWyPHsHg@mail.gmail.com>\n <CAH6eHdRi0T7Z=ciLQ6_sA6LyOdh+f8mDPY75sBu1NVDChm1O5g@mail.gmail.com>\n <CAKvuMXDhuRJdhWSZo+jaaLUnRMtDzBQB3jhJUz3hyA+TTM30mQ@mail.gmail.com>\n <CAH6eHdRTf8fE6rrSR9eGNRCvhPsuU0BDd+PGVwHSoc0H_=HJvQ@mail.gmail.com>\n <CAKvuMXAicpvpLJvr9_BSrFK-jfnz-Y3YM7SP=H7XhZa7v=sCPg@mail.gmail.com>","In-Reply-To":"\n <CAKvuMXAicpvpLJvr9_BSrFK-jfnz-Y3YM7SP=H7XhZa7v=sCPg@mail.gmail.com>","From":"Tomasz Kaminski <tkaminsk@redhat.com>","Date":"Fri, 3 Apr 2026 19:25:02 +0200","X-Gm-Features":"AQROBzDKzoDQxsBEDEFSJWV2cPT5By0WT8VIBKTsBHFqleHbsD_DFB-EQrI4DoE","Message-ID":"\n <CAKvuMXDSKWYLGwCa_GRCeYcfkgD=v68Fq_hVWJg1=KF2Ehjt=A@mail.gmail.com>","Subject":"Re: [PATCH] libstdc++: Export explicit instantiations of\n __format::__do_vformat_to.","To":"Jonathan Wakely <jwakely.gcc@gmail.com>","Cc":"\"libstdc++\" <libstdc++@gcc.gnu.org>, gcc-patches <gcc-patches@gcc.gnu.org>","X-Mimecast-Spam-Score":"0","X-Mimecast-MFC-PROC-ID":"hjztRkB9B5qGaLpeO_1at30spC01MDK_T1FDMxwUhbg_1775237115","X-Mimecast-Originator":"redhat.com","Content-Type":"multipart/alternative; boundary=\"0000000000009ac274064e919989\"","X-BeenThere":"gcc-patches@gcc.gnu.org","X-Mailman-Version":"2.1.30","Precedence":"list","List-Id":"Gcc-patches mailing list <gcc-patches.gcc.gnu.org>","List-Unsubscribe":"<https://gcc.gnu.org/mailman/options/gcc-patches>,\n <mailto:gcc-patches-request@gcc.gnu.org?subject=unsubscribe>","List-Archive":"<https://gcc.gnu.org/pipermail/gcc-patches/>","List-Post":"<mailto:gcc-patches@gcc.gnu.org>","List-Help":"<mailto:gcc-patches-request@gcc.gnu.org?subject=help>","List-Subscribe":"<https://gcc.gnu.org/mailman/listinfo/gcc-patches>,\n <mailto:gcc-patches-request@gcc.gnu.org?subject=subscribe>","Errors-To":"gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org"}}]