In std::basic_format_arg::_S_to_arg_type, replace the bfloat16 normalization 
check that uses decltype(0.0bf16) with __gnu_cxx::__bfloat16_t.

This preserves existing behavior (normalizing to float) while avoiding a direct 
bf16 literal-based type check in <format>.

Signed-off-by: Jakit Liang <[email protected]>
---
 libstdc++-v3/include/std/format | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libstdc++-v3/include/std/format b/libstdc++-v3/include/std/format
index ada62c26bca..52136c9fd76 100644
--- a/libstdc++-v3/include/std/format
+++ b/libstdc++-v3/include/std/format
@@ -3373,7 +3373,7 @@ namespace __format
 #endif
 
 #if defined(__BFLT16_DIG__) && defined(_GLIBCXX_FLOAT_IS_IEEE_BINARY32)
-         else if constexpr (is_same_v<_Td, decltype(0.0bf16)>)
+         else if constexpr (is_same_v<_Td, __gnu_cxx::__bfloat16_t>)
            return type_identity<float>();
 #endif
 
-- 
2.47.3

Reply via email to