From: Tomasz Kamiński Date: Tue, 23 Jun 2026 17:12:01 +0000 (+0200) Subject: libstdc++: Correct export checks for _GLIBCXX_EXTERN_TEMPLATE X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=6ac3a6c8aa22dc78f68eb3c99e2c600ca3e57904;p=thirdparty%2Fgcc.git libstdc++: Correct export checks for _GLIBCXX_EXTERN_TEMPLATE 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 Signed-off-by: Tomasz Kamiński --- diff --git a/libstdc++-v3/include/std/format b/libstdc++-v3/include/std/format index 4a517b70889..db226ecb0c8 100644 --- a/libstdc++-v3/include/std/format +++ b/libstdc++-v3/include/std/format @@ -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 __do_vformat_to(_Sink_iter, string_view, format_context&);