Building KDevelop/KDevPlatform with clang?

Andreas Pakulat apaku at gmx.de
Fri Jan 10 23:33:18 UTC 2014


Hi,

since I recall Milian bringing up one or two problems with the KDE cmake
scripts and clang I'm wondering wether those are resolved for KDE 4.113
already? I happened to try out clang just earlier today and instantly ran
into multiple problems in kdevplatform (while kate built just fine):

n file included from /usr/include//c++/4.8/bits/stl_tree.h:66:
/usr/include//c++/4.8/bits/alloc_traits.h:57:35: error: in-class
initializer for static data member is not a constant expression
      static const bool __value = _S_chk<_Alloc, _Tp>(nullptr);
                                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include//c++/4.8/bits/alloc_traits.h:64:19: note: in instantiation of
template class
'std::__alloctr_rebind_helper<std::allocator<KDevelop::TopDUContext *>,
KDevelop::TopDUContext *>' requested here
           bool = __alloctr_rebind_helper<_Alloc, _Tp>::__value>
                  ^
/usr/include//c++/4.8/bits/alloc_traits.h:202:9: note: in instantiation of
default argument for
'__alloctr_rebind<std::allocator<KDevelop::TopDUContext *>,
KDevelop::TopDUContext *>' required here
        using rebind_alloc = typename __alloctr_rebind<_Alloc, _Tp>::__type;
        ^~~~~
/usr/include//c++/4.8/ext/alloc_traits.h:196:47: note: in instantiation of
template type alias 'rebind_alloc' requested here
      { typedef typename _Base_type::template rebind_alloc<_Tp> other; };
                                              ^
/usr/include//c++/4.8/bits/stl_vector.h:74:59: note: in instantiation of
template class
'__gnu_cxx::__alloc_traits<std::allocator<KDevelop::TopDUContext *>
>::rebind<KDevelop::TopDUContext *>' requested here
      typedef typename __gnu_cxx::__alloc_traits<_Alloc>::template
                                                          ^
/usr/include//c++/4.8/bits/stl_vector.h:210:30: note: in instantiation of
template class 'std::_Vector_base<KDevelop::TopDUContext *,
std::allocator<KDevelop::TopDUContext *> >' requested here
    class vector : protected _Vector_base<_Tp, _Alloc>
                             ^
/home/andreas/src/kdevplatform/language/duchain/duchain.h:177:23: note: in
instantiation of template class 'std::vector<KDevelop::TopDUContext *,
std::allocator<KDevelop::TopDUContext *> >' requested here
      if(chainsByIndex.size() > index)

And also

In file included from
/home/andreas/src/kdevplatform/language/backgroundparser/parsejob.cpp:44:
/home/andreas/src/kdevplatform/language/duchain/duchain.h:179:23: error:
cannot initialize a variable of type 'KDevelop::TopDUContext *' with an
lvalue of type 'value_type' (aka 'int')
        TopDUContext* top = chainsByIndex[index];
                      ^     ~~~~~~~~~~~~~~~~~~~~


So I'm just wondering wether this is supposed to work and these really are
genuine problems in the codebase (which gcc accepts for whatever reason) or
there's still some general issue with using clang for KDE projects (at
least for kdevplatform)?

Andreas

PS: Could this be triggered/caused by using ccache with clang? I believe I
read such comments somewhere, but since other (non-KDE) projects work fine
since quite some time now I thought that might have been FUD.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kdevelop-devel/attachments/20140111/ccd03160/attachment.html>


More information about the KDevelop-devel mailing list