I can\'t tell from the C++11 Standard if nullptr_t has a default constructor. In other words, is the following valid?:
nullptr_t n;
GCC and VC
While nullptr
is a new addition to the language itself, std::nullptr_t
is just an alias of an unnamed type, the alias declared in cstddef
like this:
typedef decltype(nullptr) nullptr_t;
While nullptr_t
, being a typedef and not a language keyword, is not listed as a fundamental type, it is specified to behave as a fundamental type (and not, for example, as a pointer type or a class type). Therefore it does not have a default constructor, but you can still declare a variable like you have done. Your variable is not initialized and I wonder what its use could be and what error message you exactly got from clang
.
See also here.