summaryrefslogtreecommitdiff
path: root/lib/AST/FormatString.cpp
diff options
context:
space:
mode:
authorNathan Huckleberry <nhuck@google.com>2019-08-23 18:01:57 +0000
committerNathan Huckleberry <nhuck@google.com>2019-08-23 18:01:57 +0000
commitb57bde6263b4190a5d4e464dc982f624fc34da46 (patch)
treeeff2e28599b39bf61f423f090d81b7f72227e2bc /lib/AST/FormatString.cpp
parent2bdc54ffe368bc4b9e8cfc04abd20fa1a6e1a114 (diff)
downloadclang-b57bde6263b4190a5d4e464dc982f624fc34da46.tar.gz
[Sema] Don't warn on printf('%hd', [char]) (PR41467)
Summary: Link: https://bugs.llvm.org/show_bug.cgi?id=41467 Reviewers: rsmith, nickdesaulniers, aaron.ballman, lebedev.ri Reviewed By: nickdesaulniers, aaron.ballman, lebedev.ri Subscribers: lebedev.ri, nickdesaulniers, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D66186 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@369791 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST/FormatString.cpp')
-rw-r--r--lib/AST/FormatString.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/AST/FormatString.cpp b/lib/AST/FormatString.cpp
index 578d5bc567..ff439f9921 100644
--- a/lib/AST/FormatString.cpp
+++ b/lib/AST/FormatString.cpp
@@ -386,6 +386,8 @@ ArgType::matchesType(ASTContext &C, QualType argTy) const {
case BuiltinType::SChar:
case BuiltinType::Char_U:
case BuiltinType::UChar:
+ if (T == C.UnsignedShortTy || T == C.ShortTy)
+ return NoMatchPedantic;
return T == C.UnsignedCharTy || T == C.SignedCharTy ? Match
: NoMatch;
case BuiltinType::Short: