Fix nullptr value printing (ROOT-7092).

This commit is contained in:
Axel Naumann 2015-02-21 22:19:30 +01:00 committed by sftnight
parent 0e1c818da1
commit 69234ce153
2 changed files with 7 additions and 0 deletions

View File

@ -318,6 +318,7 @@ namespace {
else if (desugaredTy->isIntegralOrEnumerationType() else if (desugaredTy->isIntegralOrEnumerationType()
|| desugaredTy->isReferenceType() || desugaredTy->isReferenceType()
|| desugaredTy->isPointerType() || desugaredTy->isPointerType()
|| desugaredTy->isNullPtrType()
|| desugaredTy->isFloatingType()) { || desugaredTy->isFloatingType()) {
if (desugaredTy->isIntegralOrEnumerationType()) { if (desugaredTy->isIntegralOrEnumerationType()) {
// 1) enum, integral, float, double, referece, pointer types : // 1) enum, integral, float, double, referece, pointer types :
@ -349,6 +350,10 @@ namespace {
= m_Sema->BuildCStyleCastExpr(noLoc, TSI, noLoc, E).get(); = m_Sema->BuildCStyleCastExpr(noLoc, TSI, noLoc, E).get();
CallArgs.push_back(castedE); CallArgs.push_back(castedE);
} }
else if (desugaredTy->isNullPtrType()) {
// nullptr should decay to void* just fine.
CallArgs.push_back(E);
}
else if (desugaredTy->isFloatingType()) { else if (desugaredTy->isFloatingType()) {
// floats and double will fall naturally in the correct // floats and double will fall naturally in the correct
// case, because of the overload resolution. // case, because of the overload resolution.

View File

@ -46,3 +46,5 @@ q // CHECK: (const int *) 0x123
// PR ROOT-5467 // PR ROOT-5467
&A::someFunc // CHECK: (int (class A::*)(float)) @0x{{[0-9a-f]+}} &A::someFunc // CHECK: (int (class A::*)(float)) @0x{{[0-9a-f]+}}
nullptr // CHECK: (nullptr_t) @0x0