Refine r251469 to give better (and more localizable) diagnostics

for all the reasons that ARC makes things implicitly unavailable.

llvm-svn: 251496
This commit is contained in:
John McCall
2015-10-28 05:03:19 +00:00
parent 9b1534df9d
commit c6af8c606d
12 changed files with 122 additions and 71 deletions

View File

@@ -100,9 +100,8 @@ bool Sema::checkInitMethod(ObjCMethodDecl *method,
// If we're in a system header, and this is not a call, just make
// the method unusable.
if (receiverTypeIfCall.isNull() && getSourceManager().isInSystemHeader(loc)) {
method->addAttr(UnavailableAttr::CreateImplicit(Context,
"init method returns a type unrelated to its receiver type",
loc));
method->addAttr(UnavailableAttr::CreateImplicit(Context, "",
UnavailableAttr::IR_ARCInitReturnsUnrelated, loc));
return true;
}