[sigc] Re: [Bug 147391] - test_lambda does not compile with SUN Forte 5.5



Am 29.07.2004 17:46:24 schrieb(en) Damien Carbery:
$ CC test-lambda-operator-overload.cc
"test-lambda-operator-overload.cc", line 42: Error: Overloading ambiguity between "operator-<int, OtherThing<int>>(const OtherThing<int>&, OtherThing<int>)" and "operator-<OtherThing<int>, int>(OtherThing<int>, const OtherThing<int>&)".
1 Error(s) detected.

Thank you, Damien. Obviously, the FORTE compiler accepts the operator overloads if they take every argument as a const reference. No compiler check is needed at all! I'm currently building a new test tarball and will upload it withing the next hour to:

www.hippogriff.de/libsigc++-2.0.4-test1.tar.gz

Please try this one and post the compiler output as usual.

Cheers!

 Martin



Martin Schulze wrote:
Hi!

Okay, back to this problem.
I'm trying to find a working configure check. Damien, Could you please try to compile the attached source file and post the compiler output?

Thanks,

 Martin


Am 25.07.2004 13:27:08 schrieb(en) Damien Carbery:

As I sent the mail I noticed that I hadn't added any text but I did
attach the file (which was only 300 or so bytes of commented lines). I am dialing into my work email from home, using the web interface. I
never sent an attachment before.

Here is the file inline:
/* sigc++config.h.  Generated by configure.  */
/* config.h.in.  Generated from configure.ac by autoheader.  */

/* #undef SIGC_GCC_TEMPLATE_SPECIALIZATION_OPERATOR_OVERLOAD */
/* #undef SIGC_MSVC_TEMPLATE_SPECIALIZATION_OPERATOR_OVERLOAD */
/* #undef SIGC_OPERATOR_OVERLOAD_AMBIGUITY */
=== end of file ===

----- Original Message -----
From: Martin Schulze <martin-ml hippogriff de>
Date: Saturday, July 24, 2004 7:29 pm
Subject: Re: [Bug 147391] - test_lambda does not compile with SUN
Forte 5.5

> Damien, there neither seems to be a (new) message body nor an
> attachment in your mail?!
>
>  Martin
>
> Am 24.07.2004 13:56:59 schrieb(en) Damien Carbery:
> >
> >
> > ----- Original Message -----
> > From: Martin Schulze <martin-ml hippogriff de>
> > Date: Friday, July 23, 2004 10:33 pm
> > Subject: Re: [Bug 147391] - test_lambda does not compile with SUN
> > Forte 5.5
> >
> > > Hi Damien!
> > >
> > > Could you please send me the sigc++config.h that was generated?
> > > Obviously, the configure check I've added doesn't work.
> > >
> > > I'm attaching the configure check as a source file in case
anyone
> > > has
> > > an idea. It succeeds with gcc and MSVC. Obviously, it also
> succeeds> >
> > > with the SUN Forte but it should fail because it simulates the
> code> > of
> > > the lambda operator overloads which doesn't compile.
> > >
> > > Thanks!
> > >
> > >  Martin
> > >
> > >
> > > Am 23.07.2004 19:10:05 schrieb(en) Damien Carbery:
> > > > It failed in test_lambda.c
> > > > Log attached.
> > > >
> > > > [cut]
>



------------------------------------------------------------------------

#include <iostream>

  struct Thing
  {};

  template<class T>
  struct OtherThing
  {};

  /* test 1 */
  template <class T1, class T2>
Thing operator+ (const OtherThing<T1>& a1, const T2& a2) { return Thing(); }

  template <class T1, class T2>
Thing operator+ (const T1& a1, const OtherThing<T2>& a2) { return Thing(); }

  template <class T1, class T2>
Thing operator+ (const OtherThing<T1>& a1, const OtherThing<T2>& a2) { return Thing(); }


  /* test2 */
  template <class T1, class T2>
Thing operator- (const OtherThing<T1>& a1, T2 a2) { return Thing (); }

  template <class T1, class T2>
Thing operator- (T1 a1, const OtherThing<T2>& a2) { return Thing (); }

  template <class T1, class T2>
Thing operator- (const OtherThing<T1>& a1, const OtherThing<T2>& a2) { return Thing(); }


int main() {
  Thing thing;
  OtherThing<int> other_thing;

  Thing thing1 = thing + other_thing;
  Thing thing2 = other_thing + thing;
  Thing thing3 = other_thing + other_thing;

  Thing thing4 = thing - other_thing;
  Thing thing5 = other_thing - thing;
  Thing thing6 = other_thing - other_thing;
}

--
Damien Carbery
Desktop Release Engineer
Sun Microsystems

Email: damien carbery sun com
Ph: +353 1 819-9218
Ext: x 19218

Dublin Bus and Irish Rail timetables for your Palm:
http://bussched.sourceforge.net



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]