Commit ecb3efb
committed
src: constrain MaybeStackBuffer::ToString and ToStringView to standard char types
On newer libc++ (shipped with macOS Xcode 16+), std::char_traits<T> for
T not equal to char, wchar_t, char8_t, char16_t, or char32_t is
deprecated and will be removed in a future release. When
MaybeStackBuffer is instantiated with unsigned char or uint8_t (e.g. in
test/cctest/test_util.cc), the ToString() and ToStringView() methods
trigger this deprecation warning because they reference
std::basic_string<unsigned char> and std::basic_string_view<unsigned
char>, even though these methods are never actually called for those
types.
Add C++20 requires clauses to constrain ToString() and ToStringView()
to only be available for standard character types, preventing the
deprecated std::char_traits<unsigned char> from being instantiated.
This is consistent with the existing use of C++20 concepts elsewhere
in the same file (e.g. the is_callable concept).1 parent d9645d7 commit ecb3efb
1 file changed
+12
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
503 | 503 | | |
504 | 504 | | |
505 | 505 | | |
506 | | - | |
507 | | - | |
| 506 | + | |
| 507 | + | |
| 508 | + | |
| 509 | + | |
| 510 | + | |
| 511 | + | |
| 512 | + | |
| 513 | + | |
| 514 | + | |
| 515 | + | |
| 516 | + | |
| 517 | + | |
508 | 518 | | |
509 | 519 | | |
510 | 520 | | |
| |||
0 commit comments