abstract syntax tree - Error when Compiling Clang Tool RecursiveASTVisitor : error: conflicting return type CreateASTConsumer -



abstract syntax tree - Error when Compiling Clang Tool RecursiveASTVisitor : error: conflicting return type CreateASTConsumer -

i larn clang tool how write recursiveastvisitor based astfrontendactions. followed illustration in documentation , compile illustration code, , there 1 error. don't know why have error , how solve it. didn't find solution of related problem. don't know whether meet same problem , solved it.

/home/sun/project/clang-llvm/llvm/tools/clang/tools/extra/find-class-decls/findclassdecls.cpp:44:31: error: conflicting homecoming type specified ‘virtual clang::astconsumer* findnamedclassaction::createastconsumer(clang::compilerinstance&, llvm::stringref)’ in file included /home/sun/project/clang-llvm/llvm/tools/clang/tools/extra/find-class-decls/findclassdecls.cpp:4:0: /home/sun/project/clang-llvm/llvm/tools/clang/include/clang/frontend/frontendaction.h:64:40: error: overriding ‘virtual std::unique_ptr clang::frontendaction::createastconsumer(clang::compilerinstance&, llvm::stringref)’ ninja: build stopped: subcommand failed.

thanks!

oops. i've updated documentation rest of way. should have read:

class findnamedclassaction : public clang::astfrontendaction { public: virtual std::unique_ptr<clang::astconsumer> createastconsumer( clang::compilerinstance &compiler, llvm::stringref infile) { homecoming std::unique_ptr<clang::astconsumer>( new findnamedclassconsumer(&compiler.getastcontext())); } };

clang abstract-syntax-tree

Comments

Popular posts from this blog

Delphi change the assembly code of a running process -

json - Hibernate and Jackson (java.lang.IllegalStateException: Cannot call sendError() after the response has been committed) -

C++ 11 "class" keyword -