aboutsummaryrefslogtreecommitdiff
path: root/lib/Analysis/FormatString.cpp
diff options
context:
space:
mode:
authorHans Wennborg <hans@hanshq.net>2012-01-31 14:59:59 +0000
committerHans Wennborg <hans@hanshq.net>2012-01-31 14:59:59 +0000
commit7da1f4679332277614b6c583df66c3bfd94ded66 (patch)
tree812b4db6e2292058ed9e1a5f2d2849e787f7c10a /lib/Analysis/FormatString.cpp
parent54a7e3f6778c804d0fe983efb9f62d6d27d86eb4 (diff)
Format string warnings: don't a.k.a. wchar_t with wchar_t.
This fixes the case where Clang would output: error: format specifies type 'wchar_t *' (aka 'wchar_t *') ArgTypeResult::getRepresentativeTypeName needs to take into account that wchar_t can be a built-in type (as opposed to in C, where it is a typedef). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149387 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/FormatString.cpp')
-rw-r--r--lib/Analysis/FormatString.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/Analysis/FormatString.cpp b/lib/Analysis/FormatString.cpp
index a0633c80d3..30bfe4bf88 100644
--- a/lib/Analysis/FormatString.cpp
+++ b/lib/Analysis/FormatString.cpp
@@ -373,7 +373,7 @@ QualType ArgTypeResult::getRepresentativeType(ASTContext &C) const {
std::string ArgTypeResult::getRepresentativeTypeName(ASTContext &C) const {
std::string S = getRepresentativeType(C).getAsString();
- if (Name)
+ if (Name && S != Name)
return std::string("'") + Name + "' (aka '" + S + "')";
return std::string("'") + S + "'";
}