Bug 177755 - umbrello fails to compile with boost 1.37.0
Summary: umbrello fails to compile with boost 1.37.0
Status: RESOLVED FIXED
Alias: None
Product: umbrello
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: ---
Assignee: Umbrello Development Group
URL:
Keywords:
: 180532 180915 (view as bug list)
Depends on:
Blocks:
 
Reported: 2008-12-14 11:42 UTC by Bernhard Rosenkraenzer
Modified: 2013-11-06 17:31 UTC (History)
9 users (show)

See Also:
Latest Commit:
Version Fixed In: 4.7.4


Attachments
Patch to fix compile issue when using boost 1.37 (1.60 KB, patch)
2009-01-14 20:47 UTC, Gopala Krishna A
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Bernhard Rosenkraenzer 2008-12-14 11:42:35 UTC
Version:            (using Devel)
Compiler:          gcc 4.3.2 
OS:                Linux
Installed from:    Compiled sources

[ 65%] Building CXX object umbrello/umbrello/CMakeFiles/umbrello.dir/codeimport/kdevcppparser/driver.o                                                          
/usr/include/boost/iterator/iterator_adaptor.hpp: In function 'void boost::detail::iterator_adaptor_assert_traversal() [with Tr1 = boost::forward_traversal_tag, Tr2 = boost::random_access_traversal_tag]':                                    
/usr/include/boost/iterator/iterator_adaptor.hpp:353:   instantiated from 'typename boost::detail::iterator_adaptor_base<Derived, Base, Value, Traversal, Reference, Difference>::type::difference_type boost::iterator_adaptor<Derived, Base, Value, Traversal, Reference, Difference>::distance_to(const boost::iterator_adaptor<OtherDerived, OtherIterator, V, C, R, D>&) const [with OtherDerived = boost::spirit::position_iterator<const QChar*, boost::spirit::file_position_base<std::basic_string<QChar, std::char_traits<QChar>, std::allocator<QChar> > >, boost::spirit::nil_t>, OtherIterator = const QChar*, V = const QChar, C = boost::forward_traversal_tag, R = boost::use_default, D = boost::use_default, Derived = boost::spirit::position_iterator<const QChar*, boost::spirit::file_position_base<std::basic_string<QChar, std::char_traits<QChar>, std::allocator<QChar> > >, boost::spirit::nil_t>, Base = const QChar*, Value = const QChar, Traversal = boost::forward_traversal_tag, Reference = boost::use_default, Difference = boost::use_default]'                                                                             
/usr/include/boost/iterator/iterator_facade.hpp:553:   instantiated from 'static typename Facade1::difference_type boost::iterator_core_access::distance_from(const Facade1&, const Facade2&, mpl_::true_) [with Facade1 = boost::spirit::position_iterator<const QChar*, boost::spirit::file_position_base<std::basic_string<QChar, std::char_traits<QChar>, std::allocator<QChar> > >, boost::spirit::nil_t>, Facade2 = boost::spirit::position_iterator<const QChar*, boost::spirit::file_position_base<std::basic_string<QChar, std::char_traits<QChar>, std::allocator<QChar> > >, boost::spirit::nil_t>]'                                                 
/usr/include/boost/iterator/iterator_facade.hpp:842:   instantiated from 'typename boost::detail::enable_if_interoperable<Derived1, Derived2, typename boost::mpl::apply2<boost::detail::always_bool2, Derived1, Derived2>::type>::type boost::operator>=(const boost::iterator_facade<Derived1, V1, TC1, Reference1, Difference1>&, const boost::iterator_facade<Derived2, V2, TC2, Reference2, Difference2>&) [with Derived1 = boost::spirit::position_iterator<const QChar*, boost::spirit::file_position_base<std::basic_string<QChar, std::char_traits<QChar>, std::allocator<QChar> > >, boost::spirit::nil_t>, V1 = const QChar, TC1 = boost::forward_traversal_tag, Reference1 = const QChar&, Difference1 = int, Derived2 = boost::spirit::position_iterator<const QChar*, boost::spirit::file_position_base<std::basic_string<QChar, std::char_traits<QChar>, std::allocator<QChar> > >, boost::spirit::nil_t>, V2 = const QChar, TC2 = boost::forward_traversal_tag, Reference2 = const QChar&, Difference2 = int]'                                                  
/usr/src/ark/BUILD/kdesdk/umbrello/umbrello/codeimport/kdevcppparser/preprocesslexer.h:260:   instantiated from here                                            
/usr/include/boost/iterator/iterator_adaptor.hpp:230: error: invalid application of 'sizeof' to incomplete type 'boost::STATIC_ASSERTION_FAILURE<false>'        
/usr/include/boost/iterator/iterator_adaptor.hpp:230: error: invalid application of 'sizeof' to incomplete type 'boost::STATIC_ASSERTION_FAILURE<false>'        
make[2]: *** [umbrello/umbrello/CMakeFiles/umbrello.dir/codeimport/kdevcppparser/driver.o] Error 1
Comment 1 Andrey V. Panov 2008-12-25 06:02:11 UTC
This issue also occures for kdesdk 4.1.85 and gcc 4.2.4.
Comment 2 Giovanni Venturi 2009-01-10 23:59:20 UTC
I can confirm

[ 69%] Building CXX object umbrello/umbrello/CMakeFiles/umbrello.dir/codeimport/kdevcppparser/driver.o
/usr/include/boost/iterator/iterator_adaptor.hpp: In function 'void boost::detail::iterator_adaptor_assert_traversal() [with Tr1 = boost::forward_traversal_tag, Tr2 = boost::random_access_traversal_tag]':
/usr/include/boost/iterator/iterator_adaptor.hpp:353:   instantiated from 'typename boost::detail::iterator_adaptor_base<Derived, Base, Value, Traversal, Reference, Difference>::type::difference_type boost::iterator_adaptor<Derived, Base, Value, Traversal, Reference, Difference>::distance_to(const boost::iterator_adaptor<OtherDerived, OtherIterator, V, C, R, D>&) const [with OtherDerived = boost::spirit::position_iterator<const QChar*, boost::spirit::file_position_base<std::basic_string<QChar, std::char_traits<QChar>, std::allocator<QChar> > >, boost::spirit::nil_t>, OtherIterator = const QChar*, V = const QChar, C = boost::forward_traversal_tag, R = boost::use_default, D = boost::use_default, Derived = boost::spirit::position_iterator<const QChar*, boost::spirit::file_position_base<std::basic_string<QChar, std::char_traits<QChar>, std::allocator<QChar> > >, boost::spirit::nil_t>, Base = const QChar*, Value = const QChar, Traversal = boost::forward_traversal_tag, Reference = boost::use_default, Difference = boost::use_default]'
/usr/include/boost/iterator/iterator_facade.hpp:553:   instantiated from 'static typename Facade1::difference_type boost::iterator_core_access::distance_from(const Facade1&, constFacade2&, mpl_::true_) [with Facade1 = boost::spirit::position_iterator<const QChar*, boost::spirit::file_position_base<std::basic_string<QChar, std::char_traits<QChar>, std::allocator<QChar> > >, boost::spirit::nil_t>, Facade2 = boost::spirit::position_iterator<const QChar*, boost::spirit::file_position_base<std::basic_string<QChar, std::char_traits<QChar>, std::allocator<QChar> > >, boost::spirit::nil_t>]'
/usr/include/boost/iterator/iterator_facade.hpp:842:   instantiated from 'typename boost::detail::enable_if_interoperable<Derived1, Derived2, typename boost::mpl::apply2<boost::detail::always_bool2, Derived1, Derived2>::type>::type boost::operator>=(const boost::iterator_facade<Derived1, V1, TC1, Reference1, Difference1>&, const boost::iterator_facade<Derived2, V2, TC2, Reference2, Difference2>&) [with Derived1 = boost::spirit::position_iterator<const QChar*, boost::spirit::file_position_base<std::basic_string<QChar, std::char_traits<QChar>, std::allocator<QChar> > >, boost::spirit::nil_t>, V1 = const QChar, TC1 = boost::forward_traversal_tag, Reference1 = const QChar&, Difference1 = int, Derived2 = boost::spirit::position_iterator<const QChar*, boost::spirit::file_position_base<std::basic_string<QChar, std::char_traits<QChar>, std::allocator<QChar> > >, boost::spirit::nil_t>, V2 = const QChar, TC2 = boost::forward_traversal_tag, Reference2 = const QChar&, Difference2 = int]'
/home/devel/kde4/KDE/kdesdk/umbrello/umbrello/codeimport/kdevcppparser/preprocesslexer.h:267:   instantiated from here
/usr/include/boost/iterator/iterator_adaptor.hpp:230: error: invalid application of 'sizeof' to incomplete type 'boost::STATIC_ASSERTION_FAILURE<false>'
make[2]: *** [umbrello/umbrello/CMakeFiles/umbrello.dir/codeimport/kdevcppparser/driver.o] Error 1
make[1]: *** [umbrello/umbrello/CMakeFiles/umbrello.dir/all] Error 2
make: *** [all] Error 2
Comment 3 Andrew Brouwers 2009-01-12 14:20:08 UTC
Sure enough - I hit this one last night.  At first I thought it was a multiple-jobs error, but calling "make" alone produced the same error shown above.  I'm using gcc 4.2.4, glibc 2.7, and building against boost 1.37.0.
Comment 4 Pino Toscano 2009-01-13 11:22:21 UTC
*** Bug 180532 has been marked as a duplicate of this bug. ***
Comment 5 Gopala Krishna A 2009-01-14 20:20:28 UTC
I tried investigating this issue. 
According to the link [1], the tag type of spirit::position_iterator has been changed to ForwardIterator in boost 1.37. Earlier version used the iterator tag of underlying iterator.

The two methods using non-forward behavior are
PreprocessLexer::Source::eof()
PreprocessLexer::Source::length()

I hope this clue should be leading enough to fix the regression. I'll try myself to fix it.

[1] http://www.nabble.com/-spirit--iterator--position_iterator-regression-in-1.37.0-td20330244.html
Comment 6 Gopala Krishna A 2009-01-14 20:47:46 UTC
Created attachment 30245 [details]
Patch to fix compile issue when using boost 1.37

So, this is my first attempt in fixing this issue. All I did was, 
change >= to == for the CharIterator(which is position_iterator < QChar const* > )

And to fix length implementation, I just attempted manual counting using a loop and a temporary.

NOTE: I don't know the consequence of above changes esp making a copy of position_iterator and changing >= to ==.

May be the original author, Roberto Raggi can clarify.
Comment 7 Pino Toscano 2009-01-16 10:30:11 UTC
*** Bug 180915 has been marked as a duplicate of this bug. ***
Comment 8 Gopala Krishna A 2009-01-19 05:51:58 UTC
I did commit a fix yesterday
http://websvn.kde.org/?view=rev&revision=912902

However I couldn't change the status of bug to FIXED as I am neither the reporter not the assignee!

So, please try and confirm the fix.
Comment 9 Andrew Brouwers 2009-01-19 14:07:05 UTC
Hi Gopala,

Awesome!  I see that it went into trunk.  Does this mean the compile will still be broken on 4.2 when it releases?

Best wishes,
Andrew
Comment 10 Gopala Krishna A 2009-01-19 16:53:40 UTC
Thanks for reminding me Andrew. I did backport the fix.
http://websvn.kde.org/?view=rev&revision=913607

So, can you guys confirm the fix with 4.2 as well?
Comment 11 illogic-al 2009-01-20 17:33:59 UTC
kde-mac says: trunk works!
Comment 12 Ralf Habacker 2013-11-06 17:31:03 UTC
set version-fixed-in from 4.7.4 changelog