From c6af8c606dae9a9b728d5099d5964ea6540dc22c Mon Sep 17 00:00:00 2001 From: John McCall Date: Wed, 28 Oct 2015 05:03:19 +0000 Subject: Refine r251469 to give better (and more localizable) diagnostics for all the reasons that ARC makes things implicitly unavailable. llvm-svn: 251496 --- clang/lib/Sema/SemaDecl.cpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'clang/lib/Sema/SemaDecl.cpp') diff --git a/clang/lib/Sema/SemaDecl.cpp b/clang/lib/Sema/SemaDecl.cpp index f9e75893bf3..43fe9947840 100644 --- a/clang/lib/Sema/SemaDecl.cpp +++ b/clang/lib/Sema/SemaDecl.cpp @@ -13076,9 +13076,8 @@ bool Sema::CheckNontrivialField(FieldDecl *FD) { SourceLocation Loc = FD->getLocation(); if (getSourceManager().isInSystemHeader(Loc)) { if (!FD->hasAttr()) - FD->addAttr(UnavailableAttr::CreateImplicit(Context, - "this system field has retaining ownership", - Loc)); + FD->addAttr(UnavailableAttr::CreateImplicit(Context, "", + UnavailableAttr::IR_ARCFieldWithOwnership, Loc)); return false; } } @@ -13447,9 +13446,8 @@ void Sema::ActOnFields(Scope *S, SourceLocation RecLoc, Decl *EnclosingDecl, SourceLocation loc = FD->getLocation(); if (getSourceManager().isInSystemHeader(loc)) { if (!FD->hasAttr()) { - FD->addAttr(UnavailableAttr::CreateImplicit(Context, - "this system field has retaining ownership", - loc)); + FD->addAttr(UnavailableAttr::CreateImplicit(Context, "", + UnavailableAttr::IR_ARCFieldWithOwnership, loc)); } } else { Diag(FD->getLocation(), diag::err_arc_objc_object_in_tag) -- cgit v1.2.3