diff options
-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 |