This makes the printf diagnostics issue warnigns for %a, %A, %e, etc.
when used with the wrong argument.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150370
91177308-0d34-0410-b5e6-
96231b3b80d8
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.
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