Format strings: don't ever convert %+d to %lu.

Presumably, if the printf format has the sign explicitly requested, the user
wants to treat the data as signed.

This is a fix-up for r172739, and also includes several test changes that
didn't make it into that commit.

llvm-svn: 172762
This commit is contained in:
Jordan Rose
2013-01-17 22:34:10 +00:00
parent 0015f09877
commit 1eb342920b
5 changed files with 11 additions and 7 deletions

View File

@@ -511,7 +511,7 @@ bool PrintfSpecifier::fixType(QualType QT, const LangOptions &LangOpt,
case ConversionSpecifier::dArg:
case ConversionSpecifier::DArg:
case ConversionSpecifier::iArg:
if (QT->isUnsignedIntegerType())
if (QT->isUnsignedIntegerType() && !HasPlusPrefix)
CS.setKind(clang::analyze_format_string::ConversionSpecifier::uArg);
break;
default: