Revert r133024, "[format strings] correctly suggest correct type for '%@'

specifiers.  Fixes <rdar://problem/9607158>." because it causes false positives
on some code that uses CF toll free bridging.
 - I'll let Doug or Ted figure out the right fix here, possibly just to accept
   any pointer type.

llvm-svn: 134041
This commit is contained in:
Daniel Dunbar 2011-06-28 23:33:55 +00:00
parent dedd7d6ed6
commit 421bb42c9f
3 changed files with 1 additions and 5 deletions

View File

@ -300,8 +300,7 @@ bool ArgTypeResult::matchesType(ASTContext &C, QualType argTy) const {
argTy->isNullPtrType();
case ObjCPointerTy:
return argTy->getAs<ObjCObjectPointerType>() != NULL ||
argTy->getAs<BlockPointerType>() != NULL;
return argTy->getAs<ObjCObjectPointerType>() != NULL;
}
// FIXME: Should be unreachable, but Clang is currently emitting

View File

@ -348,8 +348,6 @@ ArgTypeResult PrintfSpecifier::getArgType(ASTContext &Ctx) const {
return Ctx.WCharTy;
case ConversionSpecifier::pArg:
return ArgTypeResult::CPointerTy;
case ConversionSpecifier::ObjCObjArg:
return ArgTypeResult::ObjCPointerTy;
default:
break;
}

View File

@ -38,7 +38,6 @@ int printf(const char * restrict, ...) ;
void check_nslog(unsigned k) {
NSLog(@"%d%%", k); // no-warning
NSLog(@"%s%lb%d", "unix", 10,20); // expected-warning {{invalid conversion specifier 'b'}}
NSLog(@"%@", "a"); // expected-warning {{conversion specifies type 'id' but the argument has type 'char *'}}
}
// Check type validation