suppress annoying textual repetition as 'aka'

llvm-svn: 112365
This commit is contained in:
Gabor Greif 2010-08-28 10:40:52 +00:00
parent 2e5c14713c
commit e6523ea915
2 changed files with 8 additions and 5 deletions

View 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;
}
}
}

View 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