diff options
author | Hans Wennborg <hans@hanshq.net> | 2011-12-09 10:51:29 +0000 |
---|---|---|
committer | Hans Wennborg <hans@hanshq.net> | 2011-12-09 10:51:29 +0000 |
commit | 117348caf0a8f91782e9e32e32a8689576f394d7 (patch) | |
tree | a2701bd614d6de247c3c2bd93e416c7cf97319c6 /lib/Analysis/PrintfFormatString.cpp | |
parent | 4b45c111f0ac43441c475aca4ecc1d62499e0cb8 (diff) |
fix format specifier fixit for printf("%ld", "foo");
It should reset the length modifier (unless it's a wchar_t string).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146252 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/PrintfFormatString.cpp')
-rw-r--r-- | lib/Analysis/PrintfFormatString.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/Analysis/PrintfFormatString.cpp b/lib/Analysis/PrintfFormatString.cpp index e14c952292..097cc62a6c 100644 --- a/lib/Analysis/PrintfFormatString.cpp +++ b/lib/Analysis/PrintfFormatString.cpp @@ -366,6 +366,8 @@ bool PrintfSpecifier::fixType(QualType QT, const LangOptions &LangOpt) { // Set the long length modifier for wide characters if (QT->getPointeeType()->isWideCharType()) LM.setKind(LengthModifier::AsWideChar); + else + LM.setKind(LengthModifier::None); return true; } |