summaryrefslogtreecommitdiff
path: root/lib/AST/ASTDiagnostic.cpp
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2010-09-17 15:54:40 +0000
committerDimitry Andric <dim@FreeBSD.org>2010-09-17 15:54:40 +0000
commit3d1dcd9bfdb15c49ee34d576a065079ac5c4d29f (patch)
tree0bbe07708f7571f8b5291f6d7b96c102b7c99dee /lib/AST/ASTDiagnostic.cpp
parenta0482fa4e7fa27b01184f938097f0666b78016dd (diff)
Diffstat (limited to 'lib/AST/ASTDiagnostic.cpp')
-rw-r--r--lib/AST/ASTDiagnostic.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/lib/AST/ASTDiagnostic.cpp b/lib/AST/ASTDiagnostic.cpp
index 0d609bfa6d39f..23f323d0286a6 100644
--- a/lib/AST/ASTDiagnostic.cpp
+++ b/lib/AST/ASTDiagnostic.cpp
@@ -151,10 +151,13 @@ ConvertTypeToDiagnosticString(ASTContext &Context, QualType Ty,
bool ShouldAKA = false;
QualType DesugaredTy = Desugar(Context, Ty, ShouldAKA);
if (ShouldAKA) {
- S = "'"+S+"' (aka '";
- S += DesugaredTy.getAsString(Context.PrintingPolicy);
- S += "')";
- return S;
+ std::string D = DesugaredTy.getAsString(Context.PrintingPolicy);
+ if (D != S) {
+ S = "'" + S + "' (aka '";
+ S += D;
+ S += "')";
+ return S;
+ }
}
}