================ @@ -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())) { ---------------- AaronBallman wrote:
Yeah, something seems off here. If the plugin registers the attribute properly, I think the attribute kind won't be `UnknownAttribute` (IIRC it defaults to `NoSemaHandlerAttribute` unless you specify your own kind) so I would have expected to enter this block anyway. 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