]> granicus.if.org Git - clang/commitdiff
suppress annoying textual repetition as 'aka'
authorGabor Greif <ggreif@gmail.com>
Sat, 28 Aug 2010 10:40:52 +0000 (10:40 +0000)
committerGabor Greif <ggreif@gmail.com>
Sat, 28 Aug 2010 10:40:52 +0000 (10:40 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112365 91177308-0d34-0410-b5e6-96231b3b80d8

lib/AST/ASTDiagnostic.cpp
test/SemaObjCXX/message.mm

index 0d609bfa6d39f44c11ca110ff00c6a74563ca6ed..23f323d0286a6bd4b93a7824d5482543b9f0fd1a 100644 (file)
@@ -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;
+      }
     }
   }
 
index 76bde6f57cab5b6277f249b673f1f08996d41ca1..f92518ad48c1c52b2e1b2f05294511e27f4c9e19 100644 (file)
@@ -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