Author: echristo Date: Thu Aug 13 16:34:35 2015 New Revision: 244959 URL: http://llvm.org/viewvc/llvm-project?rev=244959&view=rev Log: Fix some coding standard issues and delete a dead conditional.
Modified: cfe/trunk/lib/Sema/SemaDeclAttr.cpp Modified: cfe/trunk/lib/Sema/SemaDeclAttr.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaDeclAttr.cpp?rev=244959&r1=244958&r2=244959&view=diff ============================================================================== --- cfe/trunk/lib/Sema/SemaDeclAttr.cpp (original) +++ cfe/trunk/lib/Sema/SemaDeclAttr.cpp Thu Aug 13 16:34:35 2015 @@ -2491,17 +2491,17 @@ static void handleFormatArgAttr(Sema &S, if (!checkFunctionOrMethodParameterIndex(S, D, Attr, 1, IdxExpr, Idx)) return; - // make sure the format string is really a string + // Make sure the format string is really a string. QualType Ty = getFunctionOrMethodParamType(D, Idx); - bool not_nsstring_type = !isNSStringType(Ty, S.Context); - if (not_nsstring_type && + bool NotNSStringTy = !isNSStringType(Ty, S.Context); + if (NotNSStringTy && !isCFStringType(Ty, S.Context) && (!Ty->isPointerType() || !Ty->getAs<PointerType>()->getPointeeType()->isCharType())) { S.Diag(Attr.getLoc(), diag::err_format_attribute_not) - << (not_nsstring_type ? "a string type" : "an NSString") - << IdxExpr->getSourceRange() << getFunctionOrMethodParamRange(D, 0); + << "a string type" << IdxExpr->getSourceRange() + << getFunctionOrMethodParamRange(D, 0); return; } Ty = getFunctionOrMethodResultType(D); @@ -2510,7 +2510,7 @@ static void handleFormatArgAttr(Sema &S, (!Ty->isPointerType() || !Ty->getAs<PointerType>()->getPointeeType()->isCharType())) { S.Diag(Attr.getLoc(), diag::err_format_attribute_result_not) - << (not_nsstring_type ? "string type" : "NSString") + << (NotNSStringTy ? "string type" : "NSString") << IdxExpr->getSourceRange() << getFunctionOrMethodParamRange(D, 0); return; } _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits