diff options
author | Fariborz Jahanian <fjahanian@apple.com> | 2011-10-03 22:11:57 +0000 |
---|---|---|
committer | Fariborz Jahanian <fjahanian@apple.com> | 2011-10-03 22:11:57 +0000 |
commit | 175fb1070be0ee24a75064b118f0e13fbe354200 (patch) | |
tree | 8a3811bb94c1d63667348147d335f69c98b5d90d /lib/Sema/SemaDeclAttr.cpp | |
parent | 1e9775d36de8edbc665c0f0bf4dae1400e3d2112 (diff) |
objc arc: Suppress certain arc diagnostics on unavailable
functions. // rdar://10186536
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@141037 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaDeclAttr.cpp')
-rw-r--r-- | lib/Sema/SemaDeclAttr.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/Sema/SemaDeclAttr.cpp b/lib/Sema/SemaDeclAttr.cpp index 79afbe538d..940f5a86a6 100644 --- a/lib/Sema/SemaDeclAttr.cpp +++ b/lib/Sema/SemaDeclAttr.cpp @@ -3904,6 +3904,17 @@ static void handleDelayedForbiddenType(Sema &S, DelayedDiagnostic &diag, "this system declaration uses an unsupported type")); return; } + if (S.getLangOptions().ObjCAutoRefCount) + if (const FunctionDecl *FD = dyn_cast<FunctionDecl>(decl)) { + // FIXME. we may want to supress diagnostics for all + // kind of forbidden type messages on unavailable functions. + if (FD->hasAttr<UnavailableAttr>() && + diag.getForbiddenTypeDiagnostic() == + diag::err_arc_array_param_no_ownership) { + diag.Triggered = true; + return; + } + } S.Diag(diag.Loc, diag.getForbiddenTypeDiagnostic()) << diag.getForbiddenTypeOperand() << diag.getForbiddenTypeArgument(); |