On July 21, 2023 6:09:59 a.m. EDT, "Lénárd Szolnoki via Std-Discussion" <std-discussion@lists.isocpp.org> wrote:
On Fri, 2023-07-21 at 14:48 +0500, language.lawyer--- via Std-
Discussion wrote:
Is a parenthesised integer literal with value zero a null pointer
constant?
The current wording doesn't seem to allow that. [conv.ptr] says
that "a
null pointer constant is an integer literal ([lex.icon]) with value
zero ...", which should exclude (0).
All of gcc, clang and MSVC accept `void * ptr = (0);`.
Thank you, I guess this makes (0) a null pointer constant. I think
[conv.ptr] can be made clearer by adding "(possibly parenthesized)" to
the wording. But this is purely editorial.
Cheers,
Lénárd