diff options
author | Arthur O'Dwyer <arthur.j.odwyer@gmail.com> | 2020-12-07 21:50:15 -0500 |
---|---|---|
committer | Arthur O'Dwyer <arthur.j.odwyer@gmail.com> | 2020-12-10 22:03:12 -0500 |
commit | 3696227c10f5e5841223c2a2fb63fdd1d50a7930 (patch) | |
tree | 5fc26839ee101f7bcbe0e77d3d20f07dcd50640a /clang/lib/Frontend/CompilerInvocation.cpp | |
parent | b12ea0652129da3b42642a0b76adbfab8833db53 (diff) | |
download | llvm-3696227c10f5e5841223c2a2fb63fdd1d50a7930.zip llvm-3696227c10f5e5841223c2a2fb63fdd1d50a7930.tar.gz llvm-3696227c10f5e5841223c2a2fb63fdd1d50a7930.tar.bz2 |
[libc++] ADL-proof by adding _VSTD:: qualifications to memmove etc.
Generally these calls aren't vulnerable to ADL because they involve only
primitive types. The ones in <list> and <vector> drag in namespace std
but that's OK; the ones in <fstream> and <strstream> are vulnerable
iff `CharT` is an enum type, which seems far-fetched.
But absolutely zero of them *need* ADL to happen; so in my opinion
they should all be consistently qualified, just like calls to any
other (non-user-customizable) functions in namespace std.
Also: Include <cstring> and <cwchar> in <__string>.
We seemed to be getting lucky that <memory> included <iterator>
included <iosfwd> included <wchar.h>. That gave us the
global-namespace `wmemmove`, but not `_VSTD::wmemmove`.
This is now fixed.
I didn't touch these headers:
<ext/__hash> uses strlen, safely
<support/ibm/locale_mgmt_aix.h> uses memcpy, safely
<string.h> uses memchr and strchr, safely
<wchar.h> uses wcschr, safely
<__bsd_locale_fallbacks.h> uses wcsnrtombs, safely
Differential Revision: https://reviews.llvm.org/D93061
Diffstat (limited to 'clang/lib/Frontend/CompilerInvocation.cpp')
0 files changed, 0 insertions, 0 deletions