================ @@ -5061,11 +5061,15 @@ void Parser::ParseMicrosoftAttributes(ParsedAttributes &Attrs) { IdentifierInfo *II = Tok.getIdentifierInfo(); SourceLocation NameLoc = Tok.getLocation(); ConsumeToken(); - ParsedAttr::Kind AttrKind = - ParsedAttr::getParsedKind(II, nullptr, ParsedAttr::AS_Microsoft); + // For HLSL we want to handle all attributes, but for MSVC compat, we // silently ignore unknown Microsoft attributes. - if (getLangOpts().HLSL || AttrKind != ParsedAttr::UnknownAttribute) { + AttributeCommonInfo Info{II, NameLoc, + AttributeCommonInfo::Form::Microsoft()}; + const ParsedAttrInfo &AttrInfo = ParsedAttrInfo::get(Info); + if (getLangOpts().HLSL || + AttrInfo.hasSpelling(AttributeCommonInfo::AS_Microsoft, + II->getName())) { ---------------- Sirraide wrote:
Hmm, I can’t find a place where we’re doing anything like this here for the other syntaxes, so I’m not sure this is the right approach. `hasAttribute()` from `clang/Basic/Attributes.h` seems to do what you’re trying to do here; have you tried using that one? https://github.com/llvm/llvm-project/pull/86426 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits