[cfe-dev] Building clang-trunk fails

Eric Fiselier via cfe-dev cfe-dev at lists.llvm.org
Fri Dec 11 12:09:22 PST 2015


This seems to be an old libc++ bug. It was fixed in r229696 (
http://reviews.llvm.org/D7573).
The relevant bug report is http://llvm.org/PR20084.

I would suggest upgrading your libc++ version. You can find more
information about building and using libc++ here:
http://libcxx.llvm.org/docs/#getting-started-with-libc

/Eric


On Fri, Nov 6, 2015 at 1:25 PM, JVApen via cfe-dev <cfe-dev at lists.llvm.org>
wrote:

> ​Hi all,
>
> I don't know what has happened, though a few days ago I've noticed that
> clang-trunk no longer compiles on my system.
> Since the error is in system headers, I guess it has to do with my system.
> I'm building clang-trunk on an Ubuntu 14.04 (64bit), making use of
> clang-3.6 and I'm using the distributed libc++. As build system I'm using
> CMake.
>
> I barely have any changes and the ones I do have are to work around CMake
> issues or build problems:
>
>    - Replace #include <cstddef> by #include <stddef.h>
>     Otherwise  offsetof is not known
>    - Remove LLVM_IS_FINAL define in type_traits since it just does not
>    work
>    - Define GTEST_HAS_RTTI as 0, cause gtest-port.h gives issues
>
> I doubt any of these have anything to do with this, though especially the
> first one looks suspicious.
>
> Can anyone tell me what I have to change to get this fixed, or just fix it
> in trunk?
>
> JVApen
> ----------------------------------------------------------
>
> [ 28%] Building CXX object
> lib/Transforms/Scalar/CMakeFiles/LLVMScalarOpts.dir/LoopLoadElimination.cpp.o
> In file included from
> /llvm/src/lib/Transforms/Scalar/LoopLoadElimination.cpp:23:
> In file included from /llvm/src/include/llvm/ADT/Statistic.h:29:
> In file included from /llvm/src/include/llvm/Support/Atomic.h:17:
> In file included from /llvm/cmake/include/llvm/Support/DataTypes.h:35:
> In file included from /usr/include/c++/v1/cmath:302:
> /usr/include/c++/v1/type_traits:433:83: error: no matching function for
> call to '__source'
>     : public integral_constant<bool,
> sizeof(__libcpp_is_function_imp::__test<_Tp>(__libcpp_is_function_imp::__source<_Tp>()))
> == 1>
>
>         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> /usr/include/c++/v1/type_traits:438:14: note: in instantiation of template
> class 'std::__1::__libcpp_is_function<llvm::Value *() const, false>'
> requested here
>     : public __libcpp_is_function<_Tp> {};
>              ^
> /usr/include/c++/v1/type_traits:443:97: note: in instantiation of template
> class 'std::__1::is_function<llvm::Value *() const>' requested here
> template <class _Tp, class _Up> struct
> __libcpp_is_member_function_pointer<_Tp _Up::*> : public is_function<_Tp>
> {};
>
>                       ^
> /usr/include/c++/v1/type_traits:446:14: note: in instantiation of template
> class 'std::__1::__libcpp_is_member_function_pointer<llvm::Value
> *((anonymous
>       namespace)::StoreToLoadForwardingCandidate::*)() const>' requested
> here
>     : public __libcpp_is_member_function_pointer<typename
> remove_cv<_Tp>::type> {};
>              ^
> /usr/include/c++/v1/type_traits:460:38: note: in instantiation of template
> class 'std::__1::is_member_function_pointer<llvm::Value *((anonymous
>       namespace)::StoreToLoadForwardingCandidate::*)() const>' requested
> here
>
> !is_member_function_pointer<_Tp>::value> {};
>                                      ^
> /usr/include/c++/v1/type_traits:3122:17: note: in instantiation of
> template class 'std::__1::is_member_object_pointer<llvm::Value *((anonymous
>       namespace)::StoreToLoadForwardingCandidate::*)() const>' requested
> here
>                 is_member_object_pointer<typename
> remove_reference<_Fp>::type>::value &&
>                 ^
> /usr/include/c++/v1/__functional_base:399:1: note: in instantiation of
> default argument for '__invoke<llvm::Value *((anonymous
>       namespace)::StoreToLoadForwardingCandidate::*)() const, const
> (anonymous namespace)::StoreToLoadForwardingCandidate &>' required here
> __invoke(_Fp&& __f, _A0&& __a0)
> ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> /usr/include/c++/v1/__functional_base:419:22: note: while substituting
> deduced template arguments into function template '__invoke' [with _Fp =
> llvm::Value *((anonymous
>       namespace)::StoreToLoadForwardingCandidate::*)() const, _A0 = const
> (anonymous namespace)::StoreToLoadForwardingCandidate &, $2 = (no value)]
>     typedef decltype(__invoke(_VSTD::declval<_Tp>(),
> _VSTD::declval<_Args>()...)) type;
>                      ^
> /usr/include/c++/v1/functional:1223:17: note: in instantiation of template
> class 'std::__1::__invoke_return<llvm::Value *((anonymous
>       namespace)::StoreToLoadForwardingCandidate::*)() const, const
> (anonymous namespace)::StoreToLoadForwardingCandidate &>' requested here
>        typename __invoke_return<type, _ArgTypes...>::type
>                 ^
> /usr/include/c++/v1/algorithm:1925:21: note: while substituting deduced
> template arguments into function template 'operator()' [with _ArgTypes =
> <const
>       (anonymous namespace)::StoreToLoadForwardingCandidate &>]
>         *__result = __op(*__first);
>                     ^
> /llvm/src/lib/Transforms/Scalar/LoopLoadElimination.cpp:325:10: note: in
> instantiation of function template specialization
>       'std::__1::transform<const (anonymous
> namespace)::StoreToLoadForwardingCandidate *,
> std::__1::insert_iterator<std::__1::set<llvm::Value *,
>       std::__1::less<llvm::Value *>, std::__1::allocator<llvm::Value *> >
> >, std::__1::__mem_fn<llvm::Value *((anonymous
> namespace)::StoreToLoadForwardingCandidate::*)()
>       const> >' requested here
>     std::transform(Candidates.begin(), Candidates.end(),
>          ^
> /usr/include/c++/v1/type_traits:424:28: note: candidate template ignored:
> substitution failure [with _Tp = llvm::Value *() const]: reference to
> function type
>       'llvm::Value *() const' cannot have 'const' qualifier
> template <class _Tp> _Tp&  __source();
>                      ~~~   ^
> In file included from
> /llvm/src/lib/Transforms/Scalar/LoopLoadElimination.cpp:24:
> In file included from
> /llvm/src/include/llvm/Analysis/LoopAccessAnalysis.h:18:
> In file included from /llvm/src/include/llvm/ADT/EquivalenceClasses.h:21:
> In file included from /usr/include/c++/v1/set:387:
> In file included from /usr/include/c++/v1/__tree:18:
> /usr/include/c++/v1/algorithm:1925:21: error: attempt to use a deleted
> function
>         *__result = __op(*__first);
>                     ^
> /llvm/src/lib/Transforms/Scalar/LoopLoadElimination.cpp:325:10: note: in
> instantiation of function template specialization
>       'std::__1::transform<const (anonymous
> namespace)::StoreToLoadForwardingCandidate *,
> std::__1::insert_iterator<std::__1::set<llvm::Value *,
>       std::__1::less<llvm::Value *>, std::__1::allocator<llvm::Value *> >
> >, std::__1::__mem_fn<llvm::Value *((anonymous
> namespace)::StoreToLoadForwardingCandidate::*)()
>       const> >' requested here
>     std::transform(Candidates.begin(), Candidates.end(),
>          ^
> /usr/include/c++/v1/type_traits:1001:5: note: '~__nat' has been explicitly
> marked deleted here
>     ~__nat() = delete;
>     ^
> In file included from
> /llvm/src/lib/Transforms/Scalar/LoopLoadElimination.cpp:24:
> In file included from
> /llvm/src/include/llvm/Analysis/LoopAccessAnalysis.h:18:
> In file included from /llvm/src/include/llvm/ADT/EquivalenceClasses.h:21:
> In file included from /usr/include/c++/v1/set:388:
> /usr/include/c++/v1/functional:1226:22: error: attempt to use a deleted
> function
>               return __invoke(__f_, _VSTD::forward<_ArgTypes>(__args)...);
>                      ^
> /usr/include/c++/v1/algorithm:1925:21: note: in instantiation of function
> template specialization 'std::__1::__mem_fn<llvm::Value *((anonymous
>       namespace)::StoreToLoadForwardingCandidate::*)()
> const>::operator()<const (anonymous
> namespace)::StoreToLoadForwardingCandidate &>' requested here
>         *__result = __op(*__first);
>                     ^
> /llvm/src/lib/Transforms/Scalar/LoopLoadElimination.cpp:325:10: note: in
> instantiation of function template specialization
>       'std::__1::transform<const (anonymous
> namespace)::StoreToLoadForwardingCandidate *,
> std::__1::insert_iterator<std::__1::set<llvm::Value *,
>       std::__1::less<llvm::Value *>, std::__1::allocator<llvm::Value *> >
> >, std::__1::__mem_fn<llvm::Value *((anonymous
> namespace)::StoreToLoadForwardingCandidate::*)()
>       const> >' requested here
>     std::transform(Candidates.begin(), Candidates.end(),
>          ^
> /usr/include/c++/v1/type_traits:1001:5: note: '~__nat' has been explicitly
> marked deleted here
>     ~__nat() = delete;
>     ^
> 3 errors generated.
> make[3]: ***
> [lib/Transforms/Scalar/CMakeFiles/LLVMScalarOpts.dir/LoopLoadElimination.cpp.o]
> Error 1
> make[2]: *** [lib/Transforms/Scalar/CMakeFiles/LLVMScalarOpts.dir/all]
> Error 2
> make[1]: *** [tools/clang/tools/driver/CMakeFiles/clang.dir/rule] Error 2
> make: *** [clang] Error 2
>>
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20151211/fd4f9d75/attachment.html>


More information about the cfe-dev mailing list