[libcxx-commits] [PATCH] D93153: [libc++] Consistently replace `::new(__p) T` with `::new ((void*)__p) T`. NFCI
Arthur O'Dwyer via Phabricator via libcxx-commits
libcxx-commits at lists.llvm.org
Fri Dec 11 18:08:15 PST 2020
Quuxplusone created this revision.
Quuxplusone added a reviewer: ldionne.
Quuxplusone added a project: libc++.
Herald added a subscriber: mgrang.
Quuxplusone requested review of this revision.
Herald added a subscriber: libcxx-commits.
Herald added a reviewer: libc++.
Everywhere, normalize the whitespace to `::new (EXPR) T`.
Everywhere, normalize the spelling of the cast to `(void*)EXPR`.
Without the cast to `(void*)`, the expression triggers ADL on GCC.
(I think this is a GCC bug: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98249)
Even if it doesn't trigger ADL, it still seems incorrect to use any argument that's not exactly `(void*)` because that opens the possibility of overload resolution picking a user-defined overload of `operator new`, which would be wrong.
(I admit this is nitpicky and code-churny, but it's also cleanup. I'm particularly interested to see if buildkite will tell me exactly why `__voidify` was needed for the constexpr `construct_at` stuff; that's the one slightly scary change hiding in this PR.)
rG LLVM Github Monorepo
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 34399 bytes
Desc: not available
More information about the libcxx-commits