DWARF Debugging Standard Wiki |
---|
For detail description of the feature, please refer to:
http://en.wikipedia.org/wiki/C%2B%2B0x#Null_pointer
http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2431.pdf
nullptr
is a literal denoting the null pointer. It does not have int
type. It has a type that is implicitly convertible and comparable to any
pointer type or pointer-to-member type. It is not implicitly convertible
or comparable to integer types. The type of nullptr
is
decltype(nullptr)
#define NULL 0
char *p = NULL; // 0 can still be used as NULL, for backward compatibility
int *q = nullptr; // C++0x nullptr
void f(int);
void f(char*);
f(NULL); // call f(int), undesirable
f(nullptr); // call f(char*)
void g(int);
f(nullptr); // error: nullptr can not implicitly convert to int.
none.
If necessary, use the DW_TAG_unspecified_type to describe the type of nullptr. But we do not expect to see much use of this type in real programs.
To describe the nullptr
:
<1>< xxx> DW_TAG_unspecified_type
DW_AT_name decltype(nullptr)
<1>< ###> DW_TAG_constant
DW_AT_name nullptr
DW_AT_type <xxx>
dwarfstd.org is supported by Sourceware. Contributions are welcome.
All logos and trademarks in this site are property of their respective owner. The comments are property of their posters, all the rest © 2007-2022 by DWARF Standards Committee. |