diff --git a/clang/lib/Sema/SemaDeclAttr.cpp b/clang/lib/Sema/SemaDeclAttr.cpp index 43d0a91ca9e2..8867fe430a92 100644 --- a/clang/lib/Sema/SemaDeclAttr.cpp +++ b/clang/lib/Sema/SemaDeclAttr.cpp @@ -8550,7 +8550,7 @@ static bool MustDelayAttributeArguments(const ParsedAttr &AL) { static void checkCheerpUnprefixedDeprecations(Sema &S, const ParsedAttr &Attr) { const IdentifierInfo *scope = Attr.getScopeName(); - if (!scope || scope->getName() != "cheerp") { + if (Attr.isCXX11Attribute() && (!scope || scope->getName() != "cheerp")) { S.Diag(Attr.getLoc(), diag::warn_cheerp_deprecated_attribute) << Attr.getAttrName(); }