On Thursday 10 November 2005 11:21, Stephan Bergmann wrote:
> Petr Mladek wrote:
> [...]
>
> > I am fixing OOo to build with the upcoming gcc-4.1. And I got many
> > similar build errors like this one:
> >
> > --- cut ---
> > /usr/src/packages/BUILD/ooo-build-2.1.137/build/src680-m137/cppuhelper/so
> >urce/access_control.cxx:65: instantiated from here
> > /usr/src/packages/BUILD/ooo-build-2.1.137/build/src680-m137/solver/680/un
> >xlngi6.pro/inc/com/sun/star/uno/Any.hxx:240: error: no matching function
> > for call to
> > 'getCppuType(com::sun::star::uno::Reference<com::sun::star::security::XAc
> >cessContr oller>*)'
> > ../unxlngi6.pro/inc/com/sun/star/uno/Exception.hpp:62: note: candidates
> > are: const com::sun::star::uno::Type& getCppuType(const
> > com::sun::star::uno::Exception*)
> > ../unxlngi6.pro/inc/com/sun/star/uno/RuntimeException.hpp:44: note:
> > const com::sun::star::uno::Type& getCppuType(const
> > com::sun::star::uno::RuntimeException*)
> > ../unxlngi6.pro/inc/com/sun/star/uno/TypeClass.hdl:57: note:
> > const com::sun::star::uno::Type& getCppuType(const
> > com::sun::star::uno::TypeClass*)
> > /usr/src/packages/BUILD/ooo-build-2.1.137/build/src680-m137/solver/680/un
> >xlngi6. --- cut ---
> >
> > The problem is the following. Any.hxx defines some inline operators and
> > methods that use the function getCppuType. The function getCppuType is
> > declared for many types in the .hdl include files and is defined in the
> > related .hpp include files. Most of the .hpp files includes Any.hxx.
> > Thereafter, Any.hxx is usually included when the first .hpp file is
> > included. It means that Any.hxx is included before the other .hpp/.hdl
> > files are included. It means that the methods and operators from Any.hxx
> > are defined before the related getCppuType functions are even declared.
> >
> > It worked in the past but gcc-4.1 does not longer allow this situation. I
> > discussed it with our gcc developers and they said that the code was
> > broken. The function getCppuType must be declared before it is used at
> > least.
>
> If I understand things correctly, the above problem boils down to
>
> struct A {};
> struct B {};
> void f(A*);
> template<typename T> void g(T t) { f(t); } // line 4
> void f(B*);
> void h(B*b) { g(b); } // line 6
Hmm, this code can be compiled by gcc-4.1.
It must be more complicated. I am trying to create a small test case that
shows the problem.
> being rejected by GCC 4.1, on the grounds that f(B*) is not visible at
> the point of definition of template g.
>
> After a quick look into Vandevoorde/Josuttis (which is often easier than
> The Standard...), my understanding is that f in line 4 is an unqualified
> dependent name (its argument type is dependent), and so two-phase lookup
> happens for f, first in line 4 (seeing only f(A*)), and then in line 6
> at the point of instantiation of g for B (seeing also f(B*)).
>
> Petr, can you invite any of your GCC developers into our discussion? (I
> won't be able to respond before Monday, however.)
OK, I'll invite our GCC developers after I create the test case.
Thanks for help.
--
Best Regards,
Petr Mladek
software developer
---------------------------------------------------------------------
SuSE CR, s.r.o. e-mail: [EMAIL PROTECTED]
Drahobejlova 27 tel:+420 296 542 373
190 00 Praha 9 fax:+420 296 542 374
Czech Republic http://www.suse.cz/
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]