Open
Description
Bugzilla Link | 47879 |
Version | unspecified |
OS | All |
CC | @AaronBallman |
Extended Description
$ echo "void foo(void) { }" > foo.c
$ clang-query foo.c -c 'match functionDecl(matchesName("^foo"))'
0 matches.
$ clang-query foo.c -c 'match functionDecl(matchesName("^::foo"))'
Match #1:
/tmp/foo.c:1:1: note: "root" binds here
void foo(void) { }
^~~~~~~~~~~~~~~~~~
1 match.
This is clear from the code:
But it's at least unexpected, in particular for C code.
The matcher seems to be correctly used in a few places within the LLVM codebase. If this is the intended behavior, then the documentation is wrong.