[libcxx-commits] [PATCH] D109331: [libc++] Fix std::to_address(arr)
Mark de Wever via Phabricator via libcxx-commits
libcxx-commits at lists.llvm.org
Mon Sep 6 12:14:13 PDT 2021
Mordante added a comment.
> Maybe we should disable it for function types too? Those are supposed not to work, but it'd affect the wording of the error message we gave.
I think that would be an Quality of Implementation improvement, so I would like to see that change. But not a blocker to land the current fix. LGTM, provided the build passes.
================
Comment at: libcxx/include/__memory/pointer_traits.h:171
_Tp* __to_address(_Tp* __p) _NOEXCEPT {
static_assert(!is_function<_Tp>::value, "_Tp is a function type");
return __p;
----------------
Looking at this static assert I feel it's intended this assertion's error message should be shown when a function pointer is used.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D109331/new/
https://reviews.llvm.org/D109331
More information about the libcxx-commits
mailing list