From: Gabor Greif Date: Sat, 28 Aug 2010 10:40:52 +0000 (+0000) Subject: suppress annoying textual repetition as 'aka' X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=d52787433142ee5957fc84fe7c3d3d1218a80556;p=clang suppress annoying textual repetition as 'aka' git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112365 91177308-0d34-0410-b5e6-96231b3b80d8 --- 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