diff options
author | Hans Wennborg <hans@hanshq.net> | 2012-01-31 14:59:59 +0000 |
---|---|---|
committer | Hans Wennborg <hans@hanshq.net> | 2012-01-31 14:59:59 +0000 |
commit | 27a59958bdfc24d58f32d45d6e1df75a08ee87ce (patch) | |
tree | 848da457fe4dd7575924c4d44e66b0b0d2547a7b /clang/lib | |
parent | 1d348673e0c5f53e522841769b77fe2e9435ce46 (diff) | |
download | bcm5719-llvm-27a59958bdfc24d58f32d45d6e1df75a08ee87ce.tar.gz bcm5719-llvm-27a59958bdfc24d58f32d45d6e1df75a08ee87ce.zip |
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).
llvm-svn: 149387
Diffstat (limited to 'clang/lib')
-rw-r--r-- | clang/lib/Analysis/FormatString.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/lib/Analysis/FormatString.cpp b/clang/lib/Analysis/FormatString.cpp index a0633c80d3c..30bfe4bf884 100644 --- a/clang/lib/Analysis/FormatString.cpp +++ b/clang/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 + "'"; } |