diff options
author | Gabor Greif <ggreif@gmail.com> | 2010-08-28 10:40:52 +0000 |
---|---|---|
committer | Gabor Greif <ggreif@gmail.com> | 2010-08-28 10:40:52 +0000 |
commit | d52787433142ee5957fc84fe7c3d3d1218a80556 (patch) | |
tree | 9609f0671793f1ec5b9fcb3dd6ae97f07074bd44 | |
parent | 9996a7f06a3c5b4554692e7177930cf4e8ef09af (diff) |
suppress annoying textual repetition as 'aka'
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112365 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/AST/ASTDiagnostic.cpp | 11 | ||||
-rw-r--r-- | test/SemaObjCXX/message.mm | 2 |
2 files changed, 8 insertions, 5 deletions
diff --git a/lib/AST/ASTDiagnostic.cpp b/lib/AST/ASTDiagnostic.cpp index 0d609bfa6d..23f323d028 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; + } } } diff --git a/test/SemaObjCXX/message.mm b/test/SemaObjCXX/message.mm index 76bde6f57c..f92518ad48 100644 --- a/test/SemaObjCXX/message.mm +++ b/test/SemaObjCXX/message.mm @@ -38,7 +38,7 @@ I2 *operator+(I2_holder, int); return 0; } + (void)method { - [ivar method]; // expected-error{{receiver type 'ivar' (aka 'ivar') is not an Objective-C class}} + [ivar method]; // expected-error{{receiver type 'ivar' is not an Objective-C class}} } @end |