lib/Sema/SemaDeclAttr.cpp
static void handleDelayedForbiddenType(Sema &S, DelayedDiagnostic &DD,
                                       Decl *D) {
  auto Reason = UnavailableAttr::IR_None;
  if (D && isForbiddenTypeAllowed(S, D, DD, Reason)) {
    assert(Reason && "didn't set reason?");
    D->addAttr(UnavailableAttr::CreateImplicit(S.Context, "", Reason, DD.Loc));
    return;
  }
  if (S.getLangOpts().ObjCAutoRefCount)
    if (const auto *FD = dyn_cast<FunctionDecl>(D)) {
      // FIXME: we may want to suppress diagnostics for all
      // kind of forbidden type messages on unavailable functions.
      if (FD->hasAttr<UnavailableAttr>() &&
          DD.getForbiddenTypeDiagnostic() ==
              diag::err_arc_array_param_no_ownership) {
        DD.Triggered = true;
        return;
      }
    }

  S.Diag(DD.Loc, DD.getForbiddenTypeDiagnostic())
      << DD.getForbiddenTypeOperand() << DD.getForbiddenTypeArgument();
  DD.Triggered = true;
}
/// Handle a delayed forbidden-type diagnostic.
Handle a delayed forbidden-type diagnostic.
Handle a delayed forbidden - type diagnostic .
static void handleDelayedForbiddenType(Sema &S, DelayedDiagnostic &DD,
                                       Decl *D) {
  auto Reason = UnavailableAttr::IR_None;
  if (D && isForbiddenTypeAllowed(S, D, DD, Reason)) {
    assert(Reason && "didn't set reason?");
    D->addAttr(UnavailableAttr::CreateImplicit(S.Context, "", Reason, DD.Loc));
    return;
  }
  if (S.getLangOpts().ObjCAutoRefCount)
    if (const auto *FD = dyn_cast<FunctionDecl>(D)) {
      if (FD->hasAttr<UnavailableAttr>() &&
          DD.getForbiddenTypeDiagnostic() ==
              diag::err_arc_array_param_no_ownership) {
        DD.Triggered = true;
        return;
      }
    }
  S.Diag(DD.Loc, DD.getForbiddenTypeDiagnostic())
      << DD.getForbiddenTypeOperand() << DD.getForbiddenTypeArgument();
  DD.Triggered = true;
}
static void handleDelayedForbiddenType ( Sema & S , DelayedDiagnostic & DD , Decl * D ) { auto Reason = UnavailableAttr :: IR_None ; if ( D && isForbiddenTypeAllowed ( S , D , DD , Reason ) ) { assert ( Reason && " " ) ; D -> addAttr ( UnavailableAttr :: CreateImplicit ( S . Context , " " , Reason , DD . Loc ) ) ; return ; } if ( S . getLangOpts ( ) . ObjCAutoRefCount ) if ( const auto * FD = dyn_cast < FunctionDecl > ( D ) ) { if ( FD -> hasAttr < UnavailableAttr > ( ) && DD . getForbiddenTypeDiagnostic ( ) == diag :: err_arc_array_param_no_ownership ) { DD . Triggered = true ; return ; } } S . Diag ( DD . Loc , DD . getForbiddenTypeDiagnostic ( ) ) << DD . getForbiddenTypeOperand ( ) << DD . getForbiddenTypeArgument ( ) ; DD . Triggered = true ; }
Handle a delayed forbidden-type diagnostic.
Handle a delayed forbidden - type diagnostic .
// FIXME: we may want to suppress diagnostics for all // kind of forbidden type messages on unavailable functions.