Landing: 4b6ce501c4f1

Project / Subsystem

gcc / libstdc++

Date

2026-08-13

Author

Tomasz Kamiński

Commit

4b6ce501c4f1db06c8084170a68796622266b671

Source

github

Perf win

No

Breaking

No

All attributes

project
gcc
subsystem
libstdc++
patch_id
—
commit_hash
4b6ce501c4f1db06c8084170a68796622266b671
source_type
github
headline
libstdc++: Format std::float16_t and std::bfloat16_t correctly
tldr
Formatting of float16_t and bfloat16_t now uses their dedicated to_chars overloads, fixing incorrect formatting that cast to float.
author
Tomasz Kamiński
outcome
committed
performance_win
false
breaking_change
false
series_id
—
series_parts
[]
tags
  • • libstdc++
  • • formatting
  • • float16
  • • bfloat16
discussion_id_link
—
bugzilla_pr
—
date
2026-08-13T00:00:00.000Z

The libstdc++ formatting library has been updated to correctly format std::float16_t and std::bfloat16_t types. Previously, these types were incorrectly formatted by casting them to float, leading to potential precision loss and incorrect output. This patch removes the specialized formatters for these types, allowing the generic floating-point specialization to utilize their dedicated std::to_chars overloads, ensuring accurate representation.