<div dir="ltr">This seems to be an old libc++ bug. It was fixed in r229696 (<a href="http://reviews.llvm.org/D7573">http://reviews.llvm.org/D7573</a>).<div>The relevant bug report is <a href="http://llvm.org/PR20084">http://llvm.org/PR20084</a>.</div><div><br></div><div>I would suggest upgrading your libc++ version. You can find more information about building and using libc++ here: <a href="http://libcxx.llvm.org/docs/#getting-started-with-libc">http://libcxx.llvm.org/docs/#getting-started-with-libc</a></div><div><br></div><div>/Eric</div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Nov 6, 2015 at 1:25 PM, JVApen via cfe-dev <span dir="ltr"><<a href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@lists.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small;color:rgb(0,0,0)">​Hi all,</div><div class="gmail_default" style="font-family:verdana,sans-serif;color:rgb(0,0,0)"><br>I don't know what has happened, though a few days ago I've noticed that clang-trunk no longer compiles on my system.<br>Since the error is in system headers, I guess it has to do with my system.<br>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.<br><br>I barely have any changes and the ones I do have are to work around CMake issues or build problems:</div><div class="gmail_default"><ul><li><font color="#000000" face="verdana, sans-serif">Replace #include <cstddef> by #include <stddef.h>  Otherwise  offsetof is not known</font></li><li><font color="#000000" face="verdana, sans-serif">Remove LLVM_IS_FINAL define in type_traits since it just does not work</font></li><li><font color="#000000" face="verdana, sans-serif">Define GTEST_HAS_RTTI as 0, cause gtest-port.h gives issues</font></li></ul><div><font color="#000000" face="verdana, sans-serif">I doubt any of these have anything to do with this, though especially the first one looks suspicious.</font></div><div><br></div><div>Can anyone tell me what I have to change to get this fixed, or just fix it in trunk?</div><br><font color="#000000" face="verdana, sans-serif">JVApen</font></div><div class="gmail_default" style="font-family:verdana,sans-serif;color:rgb(0,0,0)">----------------------------------------------------------</div><div class="gmail_default" style="font-family:verdana,sans-serif;color:rgb(0,0,0)"><br></div><div class="gmail_default" style="font-family:verdana,sans-serif;color:rgb(0,0,0)"><div class="gmail_default">[ 28%] Building CXX object lib/Transforms/Scalar/CMakeFiles/LLVMScalarOpts.dir/LoopLoadElimination.cpp.o</div><div class="gmail_default">In file included from /llvm/src/lib/Transforms/Scalar/LoopLoadElimination.cpp:23:</div><div class="gmail_default">In file included from /llvm/src/include/llvm/ADT/Statistic.h:29:</div><div class="gmail_default">In file included from /llvm/src/include/llvm/Support/Atomic.h:17:</div><div class="gmail_default">In file included from /llvm/cmake/include/llvm/Support/DataTypes.h:35:</div><div class="gmail_default">In file included from /usr/include/c++/v1/cmath:302:</div><div class="gmail_default">/usr/include/c++/v1/type_traits:433:83: error: no matching function for call to '__source'</div><div class="gmail_default">    : public integral_constant<bool, sizeof(__libcpp_is_function_imp::__test<_Tp>(__libcpp_is_function_imp::__source<_Tp>())) == 1></div><div class="gmail_default">                                                                                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~</div><div class="gmail_default">/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</div><div class="gmail_default">    : public __libcpp_is_function<_Tp> {};</div><div class="gmail_default">             ^</div><div class="gmail_default">/usr/include/c++/v1/type_traits:443:97: note: in instantiation of template class 'std::__1::is_function<llvm::Value *() const>' requested here</div><div class="gmail_default">template <class _Tp, class _Up> struct __libcpp_is_member_function_pointer<_Tp _Up::*> : public is_function<_Tp> {};</div><div class="gmail_default">                                                                                                ^</div><div class="gmail_default">/usr/include/c++/v1/type_traits:446:14: note: in instantiation of template class 'std::__1::__libcpp_is_member_function_pointer<llvm::Value *((anonymous</div><div class="gmail_default">      namespace)::StoreToLoadForwardingCandidate::*)() const>' requested here</div><div class="gmail_default">    : public __libcpp_is_member_function_pointer<typename remove_cv<_Tp>::type> {};</div><div class="gmail_default">             ^</div><div class="gmail_default">/usr/include/c++/v1/type_traits:460:38: note: in instantiation of template class 'std::__1::is_member_function_pointer<llvm::Value *((anonymous</div><div class="gmail_default">      namespace)::StoreToLoadForwardingCandidate::*)() const>' requested here</div><div class="gmail_default">                                    !is_member_function_pointer<_Tp>::value> {};</div><div class="gmail_default">                                     ^</div><div class="gmail_default">/usr/include/c++/v1/type_traits:3122:17: note: in instantiation of template class 'std::__1::is_member_object_pointer<llvm::Value *((anonymous</div><div class="gmail_default">      namespace)::StoreToLoadForwardingCandidate::*)() const>' requested here</div><div class="gmail_default">                is_member_object_pointer<typename remove_reference<_Fp>::type>::value &&</div><div class="gmail_default">                ^</div><div class="gmail_default">/usr/include/c++/v1/__functional_base:399:1: note: in instantiation of default argument for '__invoke<llvm::Value *((anonymous</div><div class="gmail_default">      namespace)::StoreToLoadForwardingCandidate::*)() const, const (anonymous namespace)::StoreToLoadForwardingCandidate &>' required here</div><div class="gmail_default">__invoke(_Fp&& __f, _A0&& __a0)</div><div class="gmail_default">^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~</div><div class="gmail_default">/usr/include/c++/v1/__functional_base:419:22: note: while substituting deduced template arguments into function template '__invoke' [with _Fp = llvm::Value *((anonymous</div><div class="gmail_default">      namespace)::StoreToLoadForwardingCandidate::*)() const, _A0 = const (anonymous namespace)::StoreToLoadForwardingCandidate &, $2 = (no value)]</div><div class="gmail_default">    typedef decltype(__invoke(_VSTD::declval<_Tp>(), _VSTD::declval<_Args>()...)) type;</div><div class="gmail_default">                     ^</div><div class="gmail_default">/usr/include/c++/v1/functional:1223:17: note: in instantiation of template class 'std::__1::__invoke_return<llvm::Value *((anonymous</div><div class="gmail_default">      namespace)::StoreToLoadForwardingCandidate::*)() const, const (anonymous namespace)::StoreToLoadForwardingCandidate &>' requested here</div><div class="gmail_default">       typename __invoke_return<type, _ArgTypes...>::type</div><div class="gmail_default">                ^</div><div class="gmail_default">/usr/include/c++/v1/algorithm:1925:21: note: while substituting deduced template arguments into function template 'operator()' [with _ArgTypes = <const</div><div class="gmail_default">      (anonymous namespace)::StoreToLoadForwardingCandidate &>]</div><div class="gmail_default">        *__result = __op(*__first);</div><div class="gmail_default">                    ^</div><div class="gmail_default">/llvm/src/lib/Transforms/Scalar/LoopLoadElimination.cpp:325:10: note: in instantiation of function template specialization</div><div class="gmail_default">      'std::__1::transform<const (anonymous namespace)::StoreToLoadForwardingCandidate *, std::__1::insert_iterator<std::__1::set<llvm::Value *,</div><div class="gmail_default">      std::__1::less<llvm::Value *>, std::__1::allocator<llvm::Value *> > >, std::__1::__mem_fn<llvm::Value *((anonymous namespace)::StoreToLoadForwardingCandidate::*)()</div><div class="gmail_default">      const> >' requested here</div><div class="gmail_default">    std::transform(Candidates.begin(), Candidates.end(),</div><div class="gmail_default">         ^</div><div class="gmail_default">/usr/include/c++/v1/type_traits:424:28: note: candidate template ignored: substitution failure [with _Tp = llvm::Value *() const]: reference to function type</div><div class="gmail_default">      'llvm::Value *() const' cannot have 'const' qualifier</div><div class="gmail_default">template <class _Tp> _Tp&  __source();</div><div class="gmail_default">                     ~~~   ^</div><div class="gmail_default">In file included from /llvm/src/lib/Transforms/Scalar/LoopLoadElimination.cpp:24:</div><div class="gmail_default">In file included from /llvm/src/include/llvm/Analysis/LoopAccessAnalysis.h:18:</div><div class="gmail_default">In file included from /llvm/src/include/llvm/ADT/EquivalenceClasses.h:21:</div><div class="gmail_default">In file included from /usr/include/c++/v1/set:387:</div><div class="gmail_default">In file included from /usr/include/c++/v1/__tree:18:</div><div class="gmail_default">/usr/include/c++/v1/algorithm:1925:21: error: attempt to use a deleted function</div><div class="gmail_default">        *__result = __op(*__first);</div><div class="gmail_default">                    ^</div><div class="gmail_default">/llvm/src/lib/Transforms/Scalar/LoopLoadElimination.cpp:325:10: note: in instantiation of function template specialization</div><div class="gmail_default">      'std::__1::transform<const (anonymous namespace)::StoreToLoadForwardingCandidate *, std::__1::insert_iterator<std::__1::set<llvm::Value *,</div><div class="gmail_default">      std::__1::less<llvm::Value *>, std::__1::allocator<llvm::Value *> > >, std::__1::__mem_fn<llvm::Value *((anonymous namespace)::StoreToLoadForwardingCandidate::*)()</div><div class="gmail_default">      const> >' requested here</div><div class="gmail_default">    std::transform(Candidates.begin(), Candidates.end(),</div><div class="gmail_default">         ^</div><div class="gmail_default">/usr/include/c++/v1/type_traits:1001:5: note: '~__nat' has been explicitly marked deleted here</div><div class="gmail_default">    ~__nat() = delete;</div><div class="gmail_default">    ^</div><div class="gmail_default">In file included from /llvm/src/lib/Transforms/Scalar/LoopLoadElimination.cpp:24:</div><div class="gmail_default">In file included from /llvm/src/include/llvm/Analysis/LoopAccessAnalysis.h:18:</div><div class="gmail_default">In file included from /llvm/src/include/llvm/ADT/EquivalenceClasses.h:21:</div><div class="gmail_default">In file included from /usr/include/c++/v1/set:388:</div><div class="gmail_default">/usr/include/c++/v1/functional:1226:22: error: attempt to use a deleted function</div><div class="gmail_default">              return __invoke(__f_, _VSTD::forward<_ArgTypes>(__args)...);</div><div class="gmail_default">                     ^</div><div class="gmail_default">/usr/include/c++/v1/algorithm:1925:21: note: in instantiation of function template specialization 'std::__1::__mem_fn<llvm::Value *((anonymous</div><div class="gmail_default">      namespace)::StoreToLoadForwardingCandidate::*)() const>::operator()<const (anonymous namespace)::StoreToLoadForwardingCandidate &>' requested here</div><div class="gmail_default">        *__result = __op(*__first);</div><div class="gmail_default">                    ^</div><div class="gmail_default">/llvm/src/lib/Transforms/Scalar/LoopLoadElimination.cpp:325:10: note: in instantiation of function template specialization</div><div class="gmail_default">      'std::__1::transform<const (anonymous namespace)::StoreToLoadForwardingCandidate *, std::__1::insert_iterator<std::__1::set<llvm::Value *,</div><div class="gmail_default">      std::__1::less<llvm::Value *>, std::__1::allocator<llvm::Value *> > >, std::__1::__mem_fn<llvm::Value *((anonymous namespace)::StoreToLoadForwardingCandidate::*)()</div><div class="gmail_default">      const> >' requested here</div><div class="gmail_default">    std::transform(Candidates.begin(), Candidates.end(),</div><div class="gmail_default">         ^</div><div class="gmail_default">/usr/include/c++/v1/type_traits:1001:5: note: '~__nat' has been explicitly marked deleted here</div><div class="gmail_default">    ~__nat() = delete;</div><div class="gmail_default">    ^</div><div class="gmail_default">3 errors generated.</div><div class="gmail_default">make[3]: *** [lib/Transforms/Scalar/CMakeFiles/LLVMScalarOpts.dir/LoopLoadElimination.cpp.o] Error 1</div><div class="gmail_default">make[2]: *** [lib/Transforms/Scalar/CMakeFiles/LLVMScalarOpts.dir/all] Error 2</div><div class="gmail_default">make[1]: *** [tools/clang/tools/driver/CMakeFiles/clang.dir/rule] Error 2</div><div class="gmail_default">make: *** [clang] Error 2</div></div><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small;color:rgb(0,0,0)">​</div></div>
<br>_______________________________________________<br>
cfe-dev mailing list<br>
<a href="mailto:cfe-dev@lists.llvm.org">cfe-dev@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev</a><br>
<br></blockquote></div><br></div>