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: http://ce.steveire.com/z/VDTi_g) When I do this locally with a build with assertions, I get an assertion failure at https://github.com/llvm/llvm-project/blob/bca56ab073a00cdec8e0995e3119baf25cf775b8/clang/lib/ASTMatchers/ASTMatchersInternal.cpp#L540, so I think the problem is that matchesNodeFullFast does not correctly handle extern "C" functions.
Got a patch in the work https://reviews.llvm.org/D75202. Added bonus it doesn't fire off those assertions too.
Fixed in https://reviews.llvm.org/rG16cabf278fc8c14d415e677ce0bc40d46a6de30d As this causes a crash I'll mark it as a release blocker, probably wont make it in time though
(In reply to Nathan James from comment #2) > Fixed in https://reviews.llvm.org/rG16cabf278fc8c14d415e677ce0bc40d46a6de30d > > As this causes a crash I'll mark it as a release blocker, probably wont make > it in time though It looks like a very safe change though. Pushed to 10.x as 8f2858eb07085e13544316abfd3c0e90cef3eb93.