opmock doesn't seem to compile with clang++-10:
amoolenaar@bankdev:~/repos/opmock/trunk/opmock2$ clang++ --version
clang version 10.0.0 (https://github.com/llvm/llvm-project.git 799c96693f6860a8ccc1224129952d2307296a45)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /usr/local/bin
/usr/local/bin/clang++ -fno-rtti -static -g -c -o opmock2.o opmock2.cpp
opmock2.cpp:366:80: error: too many arguments to function call, expected 3, have 4
clang::CompilerInvocation::CreateFromArgs ( CI, Args.begin(), Args.end(), DiagsRef );
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^~~~~~~~~
/usr/local/include/clang/Frontend/CompilerInvocation.h:157:3: note: 'CreateFromArgs' declared here
static bool CreateFromArgs(CompilerInvocation &Res,
^
opmock2.cpp:369:62: error: no viable conversion from 'clang::CompilerInvocation ' to 'std::shared_ptr<compilerinvocation>'
AST = clang::ASTUnit::LoadFromCompilerInvocationAction ( CI, PCH, DiagsRef );
^~
/usr/lib/gcc/x86_64-linux-gnu/5.4.0/../../../../include/c++/5.4.0/bits/shared_ptr.h:107:7: note: candidate constructor not viable: no known conversion from 'clang::CompilerInvocation </compilerinvocation>' to 'const std::shared_ptr<clang::compilerinvocation> &' for 1st argument
shared_ptr(const shared_ptr&) noexcept = default;
^
/usr/lib/gcc/x86_64-linux-gnu/5.4.0/../../../../include/c++/5.4.0/bits/shared_ptr.h:229:7: note: candidate constructor not viable: no known conversion from 'clang::CompilerInvocation ' to 'std::shared_ptr<clang::compilerinvocation> &&' for 1st argument
shared_ptr(shared_ptr&& __r) noexcept
^
/usr/lib/gcc/x86_64-linux-gnu/5.4.0/../../../../include/c++/5.4.0/bits/shared_ptr.h:269:17: note: candidate constructor not viable: no known conversion from 'clang::CompilerInvocation </clang::compilerinvocation>' to 'std::nullptr_t' (aka 'nullptr_t') for 1st argument
constexpr shared_ptr(nullptr_t) noexcept : shared_ptr() { }
^
/usr/lib/gcc/x86_64-linux-gnu/5.4.0/../../../../include/c++/5.4.0/bits/shared_ptr.h:221:2: note: candidate template ignored: could not match 'shared_ptr<type-parameter-0-0>' against 'clang::CompilerInvocation '
shared_ptr(const shared_ptr<_Tp1>& __r) noexcept
^
/usr/lib/gcc/x86_64-linux-gnu/5.4.0/../../../../include/c++/5.4.0/bits/shared_ptr.h:238:2: note: candidate template ignored: could not match 'shared_ptr<type-parameter-0-0>' against 'clang::CompilerInvocation </type-parameter-0-0>'
shared_ptr(shared_ptr<_Tp1>&& __r) noexcept
^
/usr/lib/gcc/x86_64-linux-gnu/5.4.0/../../../../include/c++/5.4.0/bits/shared_ptr.h:255:2: note: candidate template ignored: could not match 'auto_ptr<type-parameter-0-0>' against 'clang::CompilerInvocation '
shared_ptr(std::auto_ptr<_Tp1>&& __r);
^
/usr/lib/gcc/x86_64-linux-gnu/5.4.0/../../../../include/c++/5.4.0/bits/shared_ptr.h:262:2: note: candidate template ignored: could not match 'unique_ptr<type-parameter-0-0, type-parameter-0-1="">' against 'clang::CompilerInvocation </type-parameter-0-0,>'
shared_ptr(std::unique_ptr<_Tp1, _Del>&& __r)
^
/usr/local/include/clang/Frontend/ASTUnit.h:750:43: note: passing argument to parameter 'CI' here
std::shared_ptr<compilerinvocation> CI,
^
2 errors generated.
<builtin>: recipe for target 'opmock2.o' failed
make: *** [opmock2.o] Error 1</builtin></compilerinvocation></type-parameter-0-0></type-parameter-0-0></clang::compilerinvocation>
Anonymous
For LLVM-10, part of the solution is to change this in opmock2.cpp:
but you must also include the abstract data type library:
and a simple -lclangADT didn't work.
Hi,
Thank you for reporting. I'll try to have a look this week to this bug and come back to you here.
Pascal