util: Replace std::basic_string<unsigned> with std::basic_string<char32_t> #8559
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes build with libc++19 that fails with the error:
Motivation for the change: std::basic_string requires that
T implements std::char_traits and standard library provides specializations only
for the following types: char, char16_t, char32_t, wchar_t as per [1].
Note that this has been pointed out during a review previously [2], but made its
way back into the code in other places.
libc++19 has dropped implementations of std::char_traits for types not required
by the standard [3].
[1] N4713, 24.2.1 Character traits [char.traits] (C++17)
[2] https://www.github.com/diffblue/cbmc/pull/5277#discussion_r396609205
[3] https://libcxx.llvm.org/ReleaseNotes/19.html#deprecations-and-removals
Discovered when building cbmc for darwin with clang-19 NixOS/nixpkgs#371275 (comment).
This change should be basically an NFC related to portability, so no tests and documentation updates seem to be necessary.