mirror of
https://github.com/llvm/llvm-project.git
synced 2025-05-02 05:56:07 +00:00
Don't warn when matching %p to nullptr.
llvm-svn: 118344
This commit is contained in:
parent
63abc84630
commit
3fd50319d3
@ -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);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user