summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2011-06-28 23:33:55 +0000
committerDaniel Dunbar <daniel@zuster.org>2011-06-28 23:33:55 +0000
commit421bb42c9fc7a786e8263bcff2f09afb4c468bcf (patch)
tree614ad532d77176d1eab2be8a8244b24d43c4784e
parentdedd7d6ed6cc73d0cb1b2ddf3bea8a08262c7051 (diff)
downloadbcm5719-llvm-421bb42c9fc7a786e8263bcff2f09afb4c468bcf.tar.gz
bcm5719-llvm-421bb42c9fc7a786e8263bcff2f09afb4c468bcf.zip
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
-rw-r--r--clang/lib/Analysis/FormatString.cpp3
-rw-r--r--clang/lib/Analysis/PrintfFormatString.cpp2
-rw-r--r--clang/test/SemaObjC/format-strings-objc.m1
3 files changed, 1 insertions, 5 deletions
diff --git a/clang/lib/Analysis/FormatString.cpp b/clang/lib/Analysis/FormatString.cpp
index be214e0d86d..c1b5ea8a652 100644
--- a/clang/lib/Analysis/FormatString.cpp
+++ b/clang/lib/Analysis/FormatString.cpp
@@ -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
diff --git a/clang/lib/Analysis/PrintfFormatString.cpp b/clang/lib/Analysis/PrintfFormatString.cpp
index 270308a08f2..00b0b279e4a 100644
--- a/clang/lib/Analysis/PrintfFormatString.cpp
+++ b/clang/lib/Analysis/PrintfFormatString.cpp
@@ -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;
}
diff --git a/clang/test/SemaObjC/format-strings-objc.m b/clang/test/SemaObjC/format-strings-objc.m
index dd49cf7a936..d89f50afa96 100644
--- a/clang/test/SemaObjC/format-strings-objc.m
+++ b/clang/test/SemaObjC/format-strings-objc.m
@@ -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
OpenPOWER on IntegriCloud