]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
libstdc++: Correct export checks for _GLIBCXX_EXTERN_TEMPLATE
authorTomasz Kamiński <tkaminsk@redhat.com>
Tue, 23 Jun 2026 17:12:01 +0000 (19:12 +0200)
committerTomasz Kamiński <tkaminsk@redhat.com>
Wed, 24 Jun 2026 14:01:55 +0000 (16:01 +0200)
Replace a basic_string specific _GLIBCXX_EXTERN_TEMPLATE > 0 with
simple check for _GLIBCXX_EXTERN_TEMPLATE. This make sure that
extern definition is also use for -O0 (default).
Exported declarations are also important for future extensibility,
as they always pick latest implementation.

libstdc++-v3/ChangeLog:

* include/std/format (__do_vformat_to): Change the preprocessor
check for __do_vformat_to.

Reviewed-by: Jonathan Wakely <jwakely@redhat.com>
Signed-off-by: Tomasz Kamiński <tkaminsk@redhat.com>
libstdc++-v3/include/std/format

index 4a517b70889c4f38b4dd08ecee6e73636f18247a..db226ecb0c843e3b01b4ff59ef7902f0ba3a077f 100644 (file)
@@ -5381,7 +5381,7 @@ namespace __format
 // instantiates formatters for types stored in basic_format_arg, we can
 // support only single encoding, in this case unicode. This should cover
 // most common use cases.
-#if __cplusplus <= 202002L && _GLIBCXX_EXTERN_TEMPLATE > 0
+#if __cplusplus <= 202002L && _GLIBCXX_EXTERN_TEMPLATE
     extern template _Sink_iter<char>
       __do_vformat_to<char, 1>(_Sink_iter<char>, string_view,
                               format_context&);