From 192ed0b7eebcdf7905f595591496c22ced5a7042 Mon Sep 17 00:00:00 2001 From: Ted Kremenek Date: Tue, 14 Jun 2011 22:56:51 +0000 Subject: [format strings] correctly suggest correct type for '%@' specifiers. Fixes . llvm-svn: 133024 --- clang/lib/Analysis/FormatString.cpp | 3 ++- clang/lib/Analysis/PrintfFormatString.cpp | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) (limited to 'clang/lib/Analysis') diff --git a/clang/lib/Analysis/FormatString.cpp b/clang/lib/Analysis/FormatString.cpp index c1b5ea8a652..be214e0d86d 100644 --- a/clang/lib/Analysis/FormatString.cpp +++ b/clang/lib/Analysis/FormatString.cpp @@ -300,7 +300,8 @@ bool ArgTypeResult::matchesType(ASTContext &C, QualType argTy) const { argTy->isNullPtrType(); case ObjCPointerTy: - return argTy->getAs() != NULL; + return argTy->getAs() != NULL || + argTy->getAs() != 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 00b0b279e4a..270308a08f2 100644 --- a/clang/lib/Analysis/PrintfFormatString.cpp +++ b/clang/lib/Analysis/PrintfFormatString.cpp @@ -348,6 +348,8 @@ ArgTypeResult PrintfSpecifier::getArgType(ASTContext &Ctx) const { return Ctx.WCharTy; case ConversionSpecifier::pArg: return ArgTypeResult::CPointerTy; + case ConversionSpecifier::ObjCObjArg: + return ArgTypeResult::ObjCPointerTy; default: break; } -- cgit v1.2.3