Commit b42db3d
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 b42db3d
1 file changed
+15
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
390 | 390 | | |
391 | 391 | | |
392 | 392 | | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
393 | 402 | | |
394 | 403 | | |
395 | 404 | | |
| |||
503 | 512 | | |
504 | 513 | | |
505 | 514 | | |
506 | | - | |
507 | | - | |
| 515 | + | |
| 516 | + | |
| 517 | + | |
| 518 | + | |
| 519 | + | |
| 520 | + | |
508 | 521 | | |
509 | 522 | | |
510 | 523 | | |
| |||
0 commit comments