Repository navigation
P1467R9: Extended floating-point types and standard names #105196
Description
Activity
- addedlibc++libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi.libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi.wg21-paperIssues representing the implementation of a WG21 paperIssues representing the implementation of a WG21 paper
on Aug 20, 2024 - marked [libc++] Add missing C++23 <stdfloat> header to libc++ #165005 as a duplicate of this issue
on Oct 27, 2025 @philnik777 Hi I've just started working on this issue for both clang and libc++ parts, could you please assign me?
Reacted by Jan Piotrowicz and A. Jiang@philnik777 Hi I've just started working on this issue for both clang and libc++ parts, could you please assign me?
Sorry about that, just found out that compiler project I've just joined was cancelled, thus I won't be able to work on that full time, as I've planned.
clang/lib/Frontend/InitPreprocessor.cpp needs to be updated to define the
__STDCPP_FLOAT16_T__macro in C++23 or later modes if _Float16 is available.In addition, the
std::float16_ttypedef needs to be added to<stdfloat>header if the__STDCPP_FLOAT16_T__macro is defined.libstdc++ actually defines std::float16_t as a typedef for _Float16 in C++23 or later mode if the
__STDCPP_FLOAT16_T__macro is defined.Also need to implement
std::numeric_limits<_Float16>,std::from_chars(const char*, const char*, _Float16&, std::chars_format),std::to_chars(char*, char*, _Float16, std::chars_format),std::to_chars(char*, char*, _Float16, std::chars_format, int), and the functions in<cmath>for _Float16 in C++23 and later modes if the _Float16 type is available.Also need to add support for
std::formatter<_Float16, CharT>in C++23 and later modes.@philnik777 I'm interested in taking a
libc++-only part of this, at least initially:- Add a
<stdfloat>header inlibc++that exposes the aliases when the corresponding__STDCPP_FLOAT*macros are available - Remove
<stdfloat>fromheaders_not_availableinheader_information.pyand regenerate module inputs - Add some
libc++tests for header availability
I would not touch Clang predefined macros or
__cpp_lib_stdfloatin this patch. Is this a reasonable decomposition?- Add a
Also need to implement
std::numeric_limits<_Float16>,std::from_chars(const char*, const char*, _Float16&, std::chars_format),std::to_chars(char*, char*, _Float16, std::chars_format),std::to_chars(char*, char*, _Float16, std::chars_format, int), and the functions in<cmath>for _Float16 in C++23 and later modes if the _Float16 type is available.Also need to add support for
std::formatter<_Float16, CharT>in C++23 and later modes.I think it's conforming to backport all additions except for new typedef names.
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsTodo
Link: https://wg21.link/P1467R9