[llvm-bugs] [Bug 42193] New: hasName AST matcher is confused by extern "C" in namespace

via llvm-bugs llvm-bugs at lists.llvm.org
Sat Jun 8 02:27:31 PDT 2019


            Bug ID: 42193
           Summary: hasName AST matcher is confused by extern "C" in
           Product: clang
           Version: unspecified
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: normal
          Priority: P
         Component: Frontend
          Assignee: unassignedclangbugs at nondot.org
          Reporter: kpreisert at gmail.com
                CC: llvm-bugs at lists.llvm.org, neeilans at live.com,
                    richard-llvm at metafoo.co.uk

Given the following code:

namespace foo {
    extern "C" void test() {}

... I expect an AST matcher declared as functionDecl(hasName("::foo::test")) to
match the function, but functionDecl(hasName("::test")) should not match.
However, the opposite is the case. (see the example on Compiler Explorer:

When I do this locally with a build with assertions, I get an assertion failure
so I think the problem is that matchesNodeFullFast does not correctly handle
extern "C" functions.

You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20190608/774a3cd7/attachment-0001.html>

More information about the llvm-bugs mailing list