mirror of
https://github.com/intel/llvm.git
synced 2026-01-26 03:56:16 +08:00
Don't warn when matching %p to nullptr.
llvm-svn: 118344
This commit is contained in:
@@ -296,8 +296,8 @@ bool ArgTypeResult::matchesType(ASTContext &C, QualType argTy) const {
|
||||
}
|
||||
|
||||
case CPointerTy:
|
||||
return argTy->getAs<PointerType>() != NULL ||
|
||||
argTy->getAs<ObjCObjectPointerType>() != NULL;
|
||||
return argTy->isPointerType() || argTy->isObjCObjectPointerType() ||
|
||||
argTy->isNullPtrType();
|
||||
|
||||
case ObjCPointerTy:
|
||||
return argTy->getAs<ObjCObjectPointerType>() != NULL;
|
||||
|
||||
@@ -93,3 +93,12 @@ namespace test2 {
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user