This matches how libc++ does it in all other C++ headers (that is, headers not ending in ".h").
We need to include <cstring> if we want to use _VSTD::memmove instead of unqualified ADL memmove. Even though ADL doesn't physically matter in <charconv>'s specific case, I'm trying to migrate libc++ to using _VSTD::memmove for all cases (because some of them do matter, and this way it's easier to grep for outliers).
Details
Details
- Reviewers
ldionne lichray - Group Reviewers
Restricted Project - Commits
- rGb12ea0652129: [libc++] Include C++ headers, not C headers, in <charconv>.
Diff Detail
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
libcxx/include/charconv | ||
---|---|---|
429 | For the record: It might be nice if all of these function calls were also _VSTD-ed, but I decided that I didn't want to be that invasive right now. I am 99% confident that none of these function calls (including the memmove/memcpy ones that I am changing) can possibly be hijacked by ADL, because to_chars and from_chars are not templates and therefore no user-defined or even non-primitive types can possibly leak into these codepaths which are reachable only via the "bottleneck" of those non-template functions. |
For the record: It might be nice if all of these function calls were also _VSTD-ed, but I decided that I didn't want to be that invasive right now. I am 99% confident that none of these function calls (including the memmove/memcpy ones that I am changing) can possibly be hijacked by ADL, because to_chars and from_chars are not templates and therefore no user-defined or even non-primitive types can possibly leak into these codepaths which are reachable only via the "bottleneck" of those non-template functions.