diff options
author | Jonathan Wakely <jwakely@redhat.com> | 2025-06-11 11:11:52 +0100 |
---|---|---|
committer | Jonathan Wakely <redi@gcc.gnu.org> | 2025-06-12 13:59:34 +0100 |
commit | bbe9ec92138b1dfc7c61a3d8db7351ee57586388 (patch) | |
tree | 48e1063c7a6562dee1d5fe4dd80bd0a87082799b /gcc | |
parent | f5fc1c6a169bfa6ebe569c701f293b55e5a3490e (diff) | |
download | gcc-bbe9ec92138b1dfc7c61a3d8db7351ee57586388.zip gcc-bbe9ec92138b1dfc7c61a3d8db7351ee57586388.tar.gz gcc-bbe9ec92138b1dfc7c61a3d8db7351ee57586388.tar.bz2 |
libstdc++: Do not specialize std::formatter for incomplete type [PR120625]
Using an incomplete type as the template argument for std::formatter
specializations causes problems for program-defined specializations of
std::formatter which have constraints. When the compiler has to find
which specialization of std::formatter to use for the incomplete type it
considers the program-defined specializations and checks to see if their
constraints are satisfied, which can give errors if the constraints
cannot be checked for incomplete types.
This replaces the base class of the disabled specializations with a
concrete class __formatter_disabled, so there is no need to match a
specialization and no more incomplete type.
libstdc++-v3/ChangeLog:
PR libstdc++/120625
* include/std/format (__format::__disabled): Remove.
(__formatter_disabled): New type.
(formatter<char*, wchar_t>, formatter<const char*, wchar_t>)
(formatter<char[N], wchar_t>, formatter<string, wchar_t>)
(formatter<string_view, wchar_t>): Use __formatter_disabled as
base class instead of formatter<__disabled, wchar_t>.
* testsuite/std/format/formatter/120625.cc: New test.
Reviewed-by: Tomasz KamiĆski <tkaminsk@redhat.com>
(cherry picked from commit 76bf78d32c683af3bf88f4aef595048edbd82372)
Diffstat (limited to 'gcc')
0 files changed, 0 insertions, 0 deletions