зеркало из https://github.com/microsoft/clang-1.git
Don't warn when matching %p to nullptr.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@118344 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Родитель
3030eb8259
Коммит
6242599844
|
@ -296,8 +296,8 @@ bool ArgTypeResult::matchesType(ASTContext &C, QualType argTy) const {
|
||||||
}
|
}
|
||||||
|
|
||||||
case CPointerTy:
|
case CPointerTy:
|
||||||
return argTy->getAs<PointerType>() != NULL ||
|
return argTy->isPointerType() || argTy->isObjCObjectPointerType() ||
|
||||||
argTy->getAs<ObjCObjectPointerType>() != NULL;
|
argTy->isNullPtrType();
|
||||||
|
|
||||||
case ObjCPointerTy:
|
case ObjCPointerTy:
|
||||||
return argTy->getAs<ObjCObjectPointerType>() != NULL;
|
return argTy->getAs<ObjCObjectPointerType>() != NULL;
|
||||||
|
|
|
@ -93,3 +93,12 @@ namespace test2 {
|
||||||
f(10, nullptr);
|
f(10, nullptr);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
namespace test3 {
|
||||||
|
void f(const char*, ...) __attribute__((format(printf, 1, 2)));
|
||||||
|
|
||||||
|
void g() {
|
||||||
|
// Don't warn when using nullptr with %p.
|
||||||
|
f("%p", nullptr);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
Загрузка…
Ссылка в новой задаче