This is purely a philosophical question. I assume that there's no reasonable context in which the result will prove to be useful (given nullptr).
According to this - https://en.cppreference.com/w/cpp/language/integer_literal, the type of integral literals is either int, long int, long long int, unsigned int, unsigned long int or unsigned long long int, with possible implementation-specific exceptions if the value of the literal doesn't fit into any of the above.
None of these types are convertible to void *, unless the value of the literal is 0.
Different compilers handle this differently. For example, consider the following conversions:
void g(void * p){}
void f(){
int i = 0;
void * p;
// p = i; // Fails. Also for other integral types.
p = 0; // Works. Also for 00, 0x0 and 0b0. Also when adding `u` and `l` suffixes.
g(0); // Also works.
// g(1); // Fails.
// Amazingly, even this seems to work with gcc, icc and msvc, but not with clang:
void * x = static_cast<int>(0);
// These works for icc and msvc, but fails with gcc and clang
p = static_cast<int>(0);
g(static_cast<int>(0));
}
What happens "under the hood" that enables compilers to perform these int->void * conversions?
Edit: Specifically, the question is what does the standard has to say about this?