[Libreoffice] Debian gcc or LO bug

Stephan Bergmann sbergman at redhat.com
Mon Sep 19 00:50:11 PDT 2011


On 09/18/2011 11:23 PM, julien2412 wrote:
> Hello,
>
> On LO-dev IRC, i met someone with this pb
> /home/luc/git/core/vcl/unx/gtk/a11y/atkutil.cxx:322:60: error: call of
> overloaded
> ‘insert(com::sun::star::uno::Reference<com::sun::star::accessibility::XAccessibleEventBroadcaster>&)’
> is ambiguous
>
> detail logs :
> [ build CXX ] vcl/unx/gtk/a11y/atkutil
> R=/home/luc/git&&  S=$R/core&&  O=$S/solver/unxlngx6.pro&&
> W=$S/workdir/unxlngx6.pro&&   mkdir -p $W/CxxObject/vcl/unx/gtk/a11y/
> $W/Dep/CxxObject/vcl/unx/gtk/a11y/&&  ccache g++ -DCPPU_ENV=gcc3 -DCUI
> -DENABLE_GRAPHITE -DENABLE_GTK -DENABLE_LAYOUT=0
> -DENABLE_LAYOUT_EXPERIMENTAL=0 -DGCC -DGXX_INCLUDE_PATH=/usr/include/c++/4.6
> -DHAVE_GCC_VISIBILITY_FEATURE -DLINUX -DNDEBUG -DOPTIMIZE
> -DOSL_DEBUG_LEVEL=0 -DPRODUCT -DPRODUCT_FULL -DSOLAR_JAVA -DSUPD=350 -DUNIX
> -
> DUNX -DVCL -DX86_64 -D_PTHREADS -D_REENTRANT   -DVCLPLUG_GTK_IMPLEMENTATION
> -DVERSION=\"350m1\"   -Wall -Wendif-labels -Wextra -Wshadow
> -Woverloaded-virtual -Wno-non-virtual-dtor -fPIC -fmessage-length=0
> -fno-common -pipe  -fvisibility=hidden  -fvisibility-inlines-hidden
> -std=c++0x -Wno-deprecated-declarations   -DEXCEPTIONS_ON -fexceptions
> -fno-enforce-eh-specs  -O2 -c $S/vcl/unx/gtk/a11y/atkutil.cxx -o
> $W/CxxObject/vcl/unx/gtk/a11y/atkutil.o -MMD -MT $W/
> CxxObject/vcl/unx/gtk/a11y/atkutil.o -MP -MF
> $W/Dep/CxxObject/vcl/unx/gtk/a11y/atkutil.d -I$S/vcl/unx/gtk/a11y/
> -I$O/inc/stl -I$O/inc/external -I$O/inc -I$S/solenv/unxlngx6/inc
> -I$S/solenv/inc -I$S/res -I$S/solenv/inc/Xp31
> -I/usr/lib/jvm/java-6-openjdk-amd64/include
> -I/usr/lib/jvm/java-6-openjdk-amd64/include/linux
> -I/usr/lib/jvm/java-6-openjdk-amd64/include/native_threads/include
> -I$S/vcl/inc -I$S/vcl/inc/pch -I$S/solenv/inc -I$O/inc  -I$O/inc/offapi
> -I$O/
> inc/udkapi -pthread -I/usr/include/gtk-2.0
> -I/usr/lib/x86_64-linux-gnu/gtk-2.0/include -I/usr/include/atk-1.0
> -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/pango-1.0
> -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12
> -I/usr/include/cairo -I/usr/include/gio-unix-2.0/ -I/usr/include/glib-2.0
> -I/usr/lib/glib-2.0/include
> /home/luc/git/core/vcl/unx/gtk/a11y/atkutil.cxx: In member function ‘void
> DocumentFocusListener::attachRecursive(const
> com::sun::star::uno::Reference<com::sun::star::accessibility::XAccessible>&,
> const
> com::sun::star::uno::Reference<com::sun::star::accessibility::XAccessibleContext>&,
> const
> com::sun::star::uno::Reference<com::sun::star::accessibility::XAccessibleStateSet>&)’:
> /home/luc/git/core/vcl/unx/gtk/a11y/atkutil.cxx:322:60: error: call of
> overloaded
> ‘insert(com::sun::star::uno::Reference<com::sun::star::accessibility::XAccessibleEventBroadcaster>&)’
> is ambiguous
> /home/luc/git/core/vcl/unx/gtk/a11y/atkutil.cxx:322:60: note: candidates
> are:
> /usr/include/c++/4.6/bits/stl_set.h:407:7: note: std::pair<typename
> std::_Rb_tree<_Key, _Key, std::_Identity<_Key>, _Compare, typename
> _Alloc::rebind<_Key>::other>::const_iterator, bool>  std::set<_Key, _Compare,
> _Alloc>::insert(const value_type&) [with _Key =
> com::sun::star::uno::Reference<com::sun::star::uno::XInterface>, _Compare =
> std::less&lt;com::sun::star::uno::Reference&lt;com::sun::star::uno::XInterface&gt;
>> , _Alloc = std::allocator<com::sun::star::uno::
> Reference<com::sun::star::uno::XInterface>  >, typename std::_Rb_tree<_Key,
> _Key, std::_Identity<_Key>, _Compare, typename
> _Alloc::rebind<_Key>::other>::const_iterator =
> std::_Rb_tree_const_iterator&lt;com::sun::star::uno::Reference&lt;com::sun::star::uno::XInterface&gt;
>> , std::set<_Key, _Compare, _Alloc>::value_type =
> com::sun::star::uno::Reference<com::sun::star::uno::XInterface>]
> /usr/include/c++/4.6/bits/stl_set.h:416:7: note: std::pair<typename
> std::_Rb_tree<_Key, _Key, std::_Identity<_Key>, _Compare, typename
> _Alloc::rebind<_Key>::other>::const_iterator, bool>  std::set<_Key, _Compare,
> _Alloc>::insert(std::set<_Key, _Compare, _Alloc>::value_type&&) [with _Key =
> com::sun::star::uno::Reference<com::sun::star::uno::XInterface>, _Compare =
> std::less&lt;com::sun::star::uno::Reference&lt;com::sun::star::uno::XInterface&gt;
>> , _Alloc = std::
> allocator&lt;com::sun::star::uno::Reference&lt;com::sun::star::uno::XInterface&gt;
>> , typename std::_Rb_tree<_Key, _Key, std::_Identity<_Key>, _Compare,
> typename _Alloc::rebind<_Key>::other>::const_iterator =
> std::_Rb_tree_const_iterator&lt;com::sun::star::uno::Reference&lt;com::sun::star::uno::XInterface&gt;
>> , std::set<_Key, _Compare, _Alloc>::value_type =
> com::sun::star::uno::Reference<com::sun::star::uno::XInterface>]

The "value_type &&" rvalue reference in the second alterntive indicates 
that the given GCC and standard library already support C++11 rvalue 
references and move semantics.

I am not sure whether it is indeed the case per the Standard wording, 
but this apparently lets at least claim the given GCC implementation 
that the given LibO code is ambiguous:

 From Reference<XBroadcaster> to insert(Reference<XInterface>const&), 
there always has been a conversion route via 
Reference<XBroadcaster>::operator Reference<XInterface>const&().

I assume the given GCC thinks that there is an additional, longer route, 
from Reference<XBroadcaster> to insert(Reference<XInterface>&&) via the 
same Reference<XBroadcaster>::operator Reference<XInterface>const&() but 
followed by Reference<XInterface>(Reference<XInterface>const&) copy 
constructor.  (But that would rather look like a GCC bug, as the second 
route is longer; maybe there is another tricky route that GCC thinks is 
viable, given all the magic in Reference.h.)

Anyway, one could try out whether using an explicit intermediary 
XReference<XInterface> variable helps, a la

if( xBroadcaster.is() )
{
   uno::Reference< uno::XInterface > xIfc( xBroadcaster );
   if( m_aRefList.insert(xIfc).second )
   {

-Stephan


More information about the LibreOffice mailing list