Libclang fails to parse classes with :: in name

Hi All:
I’m using libclang+python binding to parse the cpp files, but it fails to parse the following class:

class ReadableStreamBytesConsumer::OnFulfilled final : public ScriptFunction {
    static v8::Local<v8::Function> CreateFunction(){}
}

libclang did identify a CursorKind.CLASS_DECL for “ReadableStreamBytesConsumer::OnFulfilled”, but when I use “get_children()” to get the function “CreateFunction()”, it returns nothing, basically no children under this class declaration. But it works well if I eliminate the the “ReadableStreamBytesConsumer::”, any one can help here?

Could you try: clang -Xclang -ast-dump -fsyntax-only test.cc where test.cc is your example?

https://clang.llvm.org/docs/IntroductionToTheClangAST.html

Thanks for your help, I see the function CreateFunction() now, I observe and modify several things here:

  1. The CreateFunction is identified as CXXRecordDecl instead of CXX_METHOD using “clang -Xclang -ast-dump -fsyntax-only”
  2. I use the new version 14.0.5 libclang.so, that may also help.