From e540b6a266a5998951bf42e1646e41d6993805db Mon Sep 17 00:00:00 2001 From: Hyxogen <8938732+Hyxogen@users.noreply.github.com> Date: Tue, 13 Feb 2024 14:17:56 +0100 Subject: [PATCH] sema: don't emit warning for unprefixed attribute in C --- clang/lib/Sema/SemaDeclAttr.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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(); }