<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">2017-01-23 15:14 GMT+01:00 Aaron Ballman <span dir="ltr"><<a href="mailto:aaron@aaronballman.com" target="_blank">aaron@aaronballman.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><span class="gmail-">On Mon, Jan 23, 2017 at 6:13 AM, Andrzej Krzemienski via cfe-dev<br>
<<a href="mailto:cfe-dev@lists.llvm.org">cfe-dev@lists.llvm.org</a>> wrote:<br>
> Hi everyone,<br>
> I am not sure of this is the right list. I have an issue with clang-tidy's<br>
> predefined AST Matchers. The documentation for using clang-tidy<br>
> (<a href="http://clang.llvm.org/extra/clang-tidy/" rel="noreferrer" target="_blank">http://clang.llvm.org/extra/<wbr>clang-tidy/</a>) suggests that one should first try<br>
> to use of predefined matchers listed in<br>
> <a href="http://clang.llvm.org/docs/LibASTMatchersReference.html" rel="noreferrer" target="_blank">http://clang.llvm.org/docs/<wbr>LibASTMatchersReference.html</a>.<br>
><br>
> But there is no matcher for C++11 [[attributes]]. There is matcher hasAttr,<br>
> but it only works for predefined GCC __attribute__((s)).<br>
<br>
</span>The hasAttr() matcher works for all attributes based on the Attr::Kind<br>
enumeration. This will not distinguish between different spellings of<br>
the same attribute, but that should (hopefully) be largely irrelevant.<br>
So this matcher should do what you need already.<br></blockquote><div><br></div><div>Aaron, thanks for the reply. However it seams I phrased my question incorrectly. I would like to check the existence of my own unique attribute, say [[ab::cd::my_attribute]]. It is not in the list of any known attributes. hasAttr() appears to only detect the known attributes that are already listed in the long attribute enum. But will not see a new attribute.<br><br></div><div>So my question is, in clang-tidy is it possible to inspect custom attributes, like [[ab::cd::my_attribute]] ?<br><br></div><div>Regards,<br></div><div>&rzej;<br> </div></div><br></div></div>