[cfe-dev] AST matcher for C++11 [[attributes]]

Andrzej Krzemienski via cfe-dev cfe-dev at lists.llvm.org
Mon Jan 23 03:13:58 PST 2017


Hi everyone,
I am not sure of this is the right list. I have an issue with clang-tidy's
predefined AST Matchers. The documentation for using clang-tidy (
http://clang.llvm.org/extra/clang-tidy/) suggests that one should first try
to use of predefined matchers listed in
http://clang.llvm.org/docs/LibASTMatchersReference.html.

But there is no matcher for C++11 [[attributes]]. There is matcher hasAttr,
but it only works for predefined GCC __attribute__((s)). Now, I quess, I
will have to write my own matcher, but don't you think it would be useful
to have a ready-to-use matcher for c++11 [[attributes]] ?

I need them to implement checks with fewer false positives. For instance
one of the checks is clang-tidy is "warn upon converting constructors",
which is not an ideal, because sometimes I do want to implement a
conversion. Instead, I would like to provide an alternative: "warn upon
converting constructors not annotated as converting". But I cannot do that
easily today.

Is there any reason that such matcher should not be included in the
predefined AST matchers?

Regards,
&rzej;
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20170123/c285c783/attachment.html>


More information about the cfe-dev mailing list