<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/86422>86422</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
ParsedAttr plugins with AS_Microsoft spellings are never matched.
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
apache-hb
</td>
</tr>
</table>
<pre>
this example plugin should match the provided sample code, but doesnt.
```cpp
struct ExampleAttrInfo : public ParsedAttrInfo {
ExampleAttrInfo() {
static constexpr Spelling S[] = {
{ParsedAttr::AS_Microsoft, "example"}
};
Spellings = S;
}
bool diagAppertainsToDecl(Sema &S, const ParsedAttr &Attr, const Decl *D) const override {
return true;
}
AttrHandling handleDeclAttribute(Sema &S, Decl *D, const ParsedAttr &Attr) const override {
S.Diag(Attr.getLoc(), diag::warn_attribute_ignored) << "example";
return AttributeApplied;
}
};
static ParsedAttrInfoRegistry::Add<ExampleAttrInfo> Y("example", "");
```
```cpp
[example]
class Hello {};
```
This appears to be because [non-standard microsoft attributes are purposefully ignored](https://github.com/llvm/llvm-project/blob/main/clang/lib/Parse/ParseDeclCXX.cpp#L5064-L5067) but attributes registered via plugins are not handled by `ParsedAttr::getParsedKind`.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyUVVGPozYQ_jXmZbQITEjggQeyXHRVr1LV3MP1aWXsWXDl2JZtsrf_vjKEJJvT9VSEAhozM998882EeS8HjdiQck_KLmFTGI1rmGV8xKexT3oj3pswSg_4nZ2sQrBqGqQGP5pJCTixwEcII4J15iwFCvDLd9wIJPQZ-imAMOh1SEnWkawl22y5ubWLxQc38QCflgxtCO43_WqAFC3YqVeSw5_MeRS3k91-8QSARzdCK0Lrj5_EywcWJAdutA_43To4WlRK6gGOS_FAiu5Ht3iR3f4GgBQtKdr2-PKH5M548xpilYTSC0GEUrLrLkHiW_EQcc3r54THD-dXz5upN0aBkGxorUUXmNT-q-mQK0KrI54YELo9RghzZXdMxYMZ8PUsegGhbRcJWkzmjM5JgT8W7jBMTkNwE_4KYszymWkxsznGF4ypoln2U8BHpHc4_gv2rzEe006ygdAqOqQDhi-GL_2PkSNpS7femNMvbIXzIgdtHIpZJsUzKR7b99ixCxXXelprlUTxE1ruWr7Ke1beRw3_hYP0wb1f5CQEKZ4flVx8gr_ncu7BLWKb7_qWaJ2pn40YKfdrjPIClCvmPXxGpZaBusf9MdzXOP_MWmTOQzDQI_TI2eQRSLnXRj_5wLRgTsBpHQq40u2BOQQ7OWs8vk5KvcPagLIjtBpDsD7SQA-EHgYZxqlPuTkRelDqvD6erDP_IA-EHnplekIPJyY1oQeumB7iRzIaZ5LXZ9TZ87dvaWSBFl_KbLt5ir-72Pm4l-4wurkf6FDAWbLLllugaxMuqhbQvwPZZo_bYMCwmH6XWpBtliaiKURd1CzBJt_lOd3meV0nY1PRsqor3HHKMN9yVlQbluWbHeWi3nGRJbKhGd1kBd1k27wu6zTr65K_FhQzVtf5JiebDE9MqjSykho3JNL7CZtqu6E0UaxH5ed1TqnGN5gPo1rKLnHNzGQ_DZ5sMiV98LcoQQaFzd0crhS8yTDC_b4Df91gMz14Rrf8EaBIk8mp5n-3dEbpCT3MVfwbAAD__4yPBQI">