Comment #2 on issue 172 by
showard...@gmail.com: forward declares added
I'm getting compiler errors when building from trunk (tags/clang_3.5 builds
fine), building with clang or gcc fails:
/usr/bin/c++ -DIWYU_SVN_REVISION=\"598\" -D__STDC_CONSTANT_MACROS
-D__STDC_LIMIT_MACROS -fno-rtti -std=c++11 -I/usr/lib/llvm-3.5/include
-o CMakeFiles/include-what-you-use.dir/iwyu.cc.o -c
/home/showard/openmw/include-what-you-use/iwyu.cc
/home/showard/openmw/include-what-you-use/iwyu.cc:3786:40: error:
conflicting return type specified for ‘virtual
std::unique_ptr<clang::ASTConsumer>
include_what_you_use::IwyuAction::CreateASTConsumer(clang::CompilerInstance&,
llvm::StringRef)’
virtual std::unique_ptr<ASTConsumer> CreateASTConsumer(
^
In file included from
/home/showard/openmw/include-what-you-use/iwyu.cc:133:0:
/usr/lib/llvm-3.5/include/clang/Frontend/FrontendAction.h:64:24: error:
overriding ‘virtual clang::ASTConsumer*
clang::FrontendAction::CreateASTConsumer(clang::CompilerInstance&,
llvm::StringRef)’
virtual ASTConsumer *CreateASTConsumer(CompilerInstance &CI,
^
/home/showard/openmw/include-what-you-use/iwyu.cc: In member function
‘virtual std::unique_ptr<clang::ASTConsumer>
include_what_you_use::IwyuAction::CreateASTConsumer(clang::CompilerInstance&,
llvm::StringRef)’:
/home/showard/openmw/include-what-you-use/iwyu.cc:3796:60: error: no
matching function for call to
‘clang::Preprocessor::addPPCallbacks(std::unique_ptr<clang::PPCallbacks>)’
std::unique_ptr<PPCallbacks>(preprocessor_consumer));
^
/home/showard/openmw/include-what-you-use/iwyu.cc:3796:60: note: candidate
is:
In file included from
/home/showard/openmw/include-what-you-use/iwyu_preprocessor.h:73:0,
from /home/showard/openmw/include-what-you-use/iwyu.cc:113:
/usr/lib/llvm-3.5/include/clang/Lex/Preprocessor.h:569:8: note: void
clang::Preprocessor::addPPCallbacks(clang::PPCallbacks*)
void addPPCallbacks(PPCallbacks *C) {
^
/usr/lib/llvm-3.5/include/clang/Lex/Preprocessor.h:569:8: note: no known
conversion for argument 1 from ‘std::unique_ptr<clang::PPCallbacks>’ to
‘clang::PPCallbacks*’