Commit da52b09
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.
PR-URL: #62507
Refs: #62506
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Anna Henningsen <anna@addaleax.net>1 parent ae87597 commit da52b09Copy full SHA for da52b09
1 file changed
+14-2Lines changed: 14 additions & 2 deletions
Expand file treeCollapse file tree
Open diff view settings
Collapse file
+14-2Lines changed: 14 additions & 2 deletions
| 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