Commit 9f3892d
committed
src: fix MaybeStackBuffer char_traits deprecation warning
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 their return types reference
std::basic_string<unsigned char> and std::basic_string_view<unsigned
char>, even though these methods are never actually called for those
types.
Convert ToString() and ToStringView() into member function templates
with a constrained default template parameter, so the return type is
only instantiated when the function is actually called. Extract the
type list into a reusable standard_char_type concept.1 parent d9645d7 commit 9f3892d
1 file changed
+14
-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 | + | |
393 | 401 | | |
394 | 402 | | |
395 | 403 | | |
| |||
503 | 511 | | |
504 | 512 | | |
505 | 513 | | |
506 | | - | |
507 | | - | |
| 514 | + | |
| 515 | + | |
| 516 | + | |
| 517 | + | |
| 518 | + | |
| 519 | + | |
508 | 520 | | |
509 | 521 | | |
510 | 522 | | |
| |||
0 commit comments