[cfe-dev] AST matchers -> functionDecl finds definitions of structs

Julian Mueller via cfe-dev cfe-dev at lists.llvm.org
Thu Nov 1 07:52:41 PDT 2018


Hello, I have a rather confusing problem.
As the email's subject says, I happen to match record definitions with the
matcher *functionDecl*.

Using clang-query on simple example test files works perfectly, unless
there is an include file involved. As soon, as clang-query (or my own tool)
constructs an AST for a source, that refers to an include file, the matcher
*functionDecl* will match on ANY record that is defined in the include file
- not matching any defined in the cpp file.

The AST Matcher Reference on *functionDecl* is rather simple:
"*Matches function declarations.*

*
Example matches f *

*  void f();*"

No mentions of other node types, so how is this possible - any ideas to
what i am doing wrong?

Thanks in advance!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20181101/f90f31ec/attachment.html>


More information about the cfe-dev mailing list