Fix typo in PrintfConversionSpecifier::isDoubleArg()

This makes the printf diagnostics issue warnigns for %a, %A, %e, etc.
when used with the wrong argument.

llvm-svn: 150370
This commit is contained in:
Hans Wennborg 2012-02-13 10:32:27 +00:00
parent 8427eda045
commit f81b9d172a
2 changed files with 3 additions and 1 deletions

View File

@ -368,7 +368,7 @@ public:
bool isObjCArg() const { return kind >= ObjCBeg && kind <= ObjCEnd; }
bool isIntArg() const { return kind >= IntArgBeg && kind <= IntArgEnd; }
bool isDoubleArg() const { return kind >= DoubleArgBeg &&
kind <= DoubleArgBeg; }
kind <= DoubleArgEnd; }
unsigned getLength() const {
// Conversion specifiers currently only are represented by
// single characters, but we be flexible.

View File

@ -471,6 +471,8 @@ void pr9751() {
const char kFormat17[] = "%hu"; // expected-note{{format string is defined here}}}
printf(kFormat17, (int[]){0}); // expected-warning{{format specifies type 'unsigned short' but the argument}}
printf("%a", (long double)0); // expected-warning{{format specifies type 'double' but the argument has type 'long double'}}
}
// PR 9466: clang: doesn't know about %Lu, %Ld, and %Lx