https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86471

--- Comment #23 from Matt Bentley <mattreecebentley at gmail dot com> ---

> Actually, don't quote me on that - I may be thinking of the
> 'reinterpret_cast<_Tp>(0)' - one of the two.

Just to confirm, "reinterpret_cast<void *>(__first)" not required in this
context,  either "reinterpret_cast<_Tp>(0)" or "static_cast<_Tp>(0)" *are*
required to avoid warnings in clang when _Tp is a pointer. Either works fine.
I understand that reinterpret_cast isn't allowed inside constexpr, but not why,
and can't find any resources explicitly stating the reasoning.
But __builtin_constant_p allows it, so it's use is a matter of programmer
choice, at least in this context.

Reply via email to