forked from OSchip/llvm-project
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:
parent
8427eda045
commit
f81b9d172a
|
@ -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.
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue