lib/Sema/SemaDeclAttr.cpp
static void checkUnusedDeclAttributes(Sema &S, const ParsedAttributesView &A) {
  for (const ParsedAttr &AL : A) {
    // Only warn if the attribute is an unignored, non-type attribute.
    if (AL.isUsedAsTypeAttr() || AL.isInvalid())
      continue;
    if (AL.getKind() == ParsedAttr::IgnoredAttribute)
      continue;

    if (AL.getKind() == ParsedAttr::UnknownAttribute) {
      S.Diag(AL.getLoc(), diag::warn_unknown_attribute_ignored)
          << AL << AL.getRange();
    } else {
      S.Diag(AL.getLoc(), diag::warn_attribute_not_on_decl) << AL
                                                            << AL.getRange();
    }
  }
}
/// checkUnusedDeclAttributes - Check a list of attributes to see if it
/// contains any decl attributes that we should warn about.
Check a list of attributes to see if it
contains any decl attributes that we should warn about.
Check a list of attributes to see if it contains any decl attributes that we should warn about .
static void checkUnusedDeclAttributes(Sema &S, const ParsedAttributesView &A) {
  for (const ParsedAttr &AL : A) {
    if (AL.isUsedAsTypeAttr() || AL.isInvalid())
      continue;
    if (AL.getKind() == ParsedAttr::IgnoredAttribute)
      continue;
    if (AL.getKind() == ParsedAttr::UnknownAttribute) {
      S.Diag(AL.getLoc(), diag::warn_unknown_attribute_ignored)
          << AL << AL.getRange();
    } else {
      S.Diag(AL.getLoc(), diag::warn_attribute_not_on_decl) << AL
                                                            << AL.getRange();
    }
  }
}
static void checkUnusedDeclAttributes ( Sema & S , const ParsedAttributesView & A ) { for ( const ParsedAttr & AL : A ) { if ( AL . isUsedAsTypeAttr ( ) || AL . isInvalid ( ) ) continue ; if ( AL . getKind ( ) == ParsedAttr :: IgnoredAttribute ) continue ; if ( AL . getKind ( ) == ParsedAttr :: UnknownAttribute ) { S . Diag ( AL . getLoc ( ) , diag :: warn_unknown_attribute_ignored ) << AL << AL . getRange ( ) ; } else { S . Diag ( AL . getLoc ( ) , diag :: warn_attribute_not_on_decl ) << AL << AL . getRange ( ) ; } } }
checkUnusedDeclAttributes - Check a list of attributes to see if it
contains any decl attributes that we should warn about.
checkUnusedDeclAttributes - Check a list of attributes to see if it contains any decl attributes that we should warn about .
// Only warn if the attribute is an unignored, non-type attribute.