After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 147391 - test_lambda does not compile with SUN Forte 5.5
test_lambda does not compile with SUN Forte 5.5
Status: VERIFIED INCOMPLETE
Product: libsigc++
Classification: Bindings
Component: tests
2.0
Other Solaris
: Normal normal
: ---
Assigned To: Martin Schulze
Martin Schulze
Depends on:
Blocks:
 
 
Reported: 2004-07-12 09:52 UTC by Murray Cumming
Modified: 2009-08-15 18:40 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Murray Cumming 2004-07-12 09:52:22 UTC
With the code from cvs:

/sgnome/gnome2.4/forte/sparc-solaris/bin/CC  -I. -I. -I.. -I.. -I..    -
g -c -o test_lambda.o test_lambda.cc
"../sigc++/adaptors/lambda/group.h", line 205: Warning (Anachronism):
Type names qualified by template parameters require "typename".
"../sigc++/adaptors/lambda/group.h", line 305:     Where: While
specializing "sigc::lambda_group2<sigc::T_functor, sigc::T_type1,
sigc::T_type2>".
"../sigc++/adaptors/lambda/group.h", line 305:     Where: Specialized in
non-template code.
"../sigc++/adaptors/lambda/group.h", line 333: Warning (Anachronism):
Type names qualified by template parameters require "
typename".
"../sigc++/adaptors/lambda/group.h", line 435:     Where: While
specializing "sigc::lambda_group3<sigc::T_functor, sigc::T_type1,
sigc::T_type2, sigc::T_type3>".
"../sigc++/adaptors/lambda/group.h", line 435:     Where: Specialized in
non-template code.
"test_lambda.cc", line 61: Error: Overloading ambiguity between
"sigc::operator+<sigc::internal::lambda_select1,
sigc::internal::lambda_select2>(const
sigc::lambda<sigc::internal::lambda_select1>&, const
sigc::lambda<sigc::internal::lambda_select2>&)" and "sigc::operator
+<sigc::internal::lambda_select1,
sigc::lambda<sigc::internal::lambda_select2>>(const
sigc::lambda<sigc::internal::lambda_select1>&,
sigc::lambda<sigc::internal::lambda_select2>)".
"test_lambda.cc", line 66: Error: Overloading ambiguity between
"sigc::operator*<sigc::internal::lambda_select2,
sigc::internal::lambda_select3>(const
sigc::lambda<sigc::internal::lambda_select2>&, const
sigc::lambda<sigc::internal::lambda_select3>&)" and
"sigc::operator*<sigc::internal::lambda_select2,
sigc::lambda<sigc::internal::lambda_select3>>(const
sigc::lambda<sigc::internal::lambda_select2>&,
sigc::lambda<sigc::internal::lambda_select3>)".
"test_lambda.cc", line 66: Error: Overloading ambiguity between
"sigc::operator+<sigc::internal::lambda_select1,
sigc::lambda_operator<sigc::arithmetic<sigc::multiplies>,
sigc::internal::lambda_select2, sigc::internal::lambda_select3>>(const
sigc::lambda<sigc::internal::lambda_select1>&, const
sigc::lambda<sigc::lambda_operator<sigc::arithmetic<sigc::multiplies>,
sigc::internal::lambda_select2, sigc::internal::lambda_select3>>&)" and
"sigc::operator+<sigc::internal::lambda_select1,
sigc::lambda<sigc::lambda_operator<sigc::arithmetic<sigc::multiplies>,
sigc::internal::lambda_select2, sigc::internal::lambda_select3>>>(const
sigc::lambda<sigc::internal::lambda_select1>&,
sigc::lambda<sigc::lambda_operator<sigc::arithmetic<sigc::multiplies>,
sigc::internal::lambda_select2, sigc::internal::lambda_select3>>)".
"test_lambda.cc", line 86: Error: Overloading ambiguity between
"sigc::operator<<<std::ostream &, sigc::internal::lambda_select1>(const
sigc::lambda<std::ostream &>&, const
sigc::lambda<sigc::internal::lambda_select1>&)" and
"sigc::operator<<<std::ostream &,
sigc::lambda<sigc::internal::lambda_select1>>(const
sigc::lambda<std::ostream &>&,
sigc::lambda<sigc::internal::lambda_select1>)".
4 Error(s) and 2 Warning(s) detected.
make[2]: *** [test_lambda.o] Error 4
make[2]: Leaving directory `/jds/libsigc/libsigc++-2.0.3/tests'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/jds/libsigc/libsigc++-2.0.3'
Comment 1 Martin Schulze 2004-07-14 17:31:34 UTC
Unfortunately my efforts to avoid overloading the lambda action operators failed:

E.g.

  template <class T1, class T2>
  lambda<lambda_operator<[bla]> > operator + (const T1& a1, const T2& a2)

doesn't work because then operator+ would be redefined for every type in
namespace sigc. At least T1 or T2 need to be of type lambda (like e.g. the
lambda selector sigc::_1), hence the current definition with overloads:

  template <class T1, class T2>
  lambda<lambda_operator<[bla]> > operator + (const lambda<T1>& a1, T2 a2)

  template <class T1, class T2>
  lambda<lambda_operator<[bla]> > operator + (T1 a1, const lambda<T2>& a2)

  template <class T1, class T2>
  lambda<lambda_operator<[bla]> > operator + (const lambda<T1>& a1, const
lambda<T2>& a2)

Making the operators members of the class template lambda also doesn't work - at
least gcc doesn't find any matches for expressions like "_1 + 1" (don't ask me
why; a test where "operator+" was not defined as a function template but for the
fixed argument type "int" succeeded).

The only possible solution I can see at the moment is to restrict the syntax for
the FORTE. E.g. having only 

  template <class T1, class T2>
  lambda<lambda_operator<[bla]> > operator + (const lambda<T1>& a1, const T2& a2)

would allow expressions like

  (_1 + 1)(123)
  (_1 + _2)(123,456)

whereas

  (1 + _1)(123)

wouldn't compile. A valid syntax, though, would be:

  (sigc::constant(1) + _1)(123)

because sigc::constant(1) creates a lambda object.

What's your opinion?
Comment 2 Murray Cumming 2004-07-15 10:54:53 UTC
I'm not sure what API/syntax/abilities this lambda stuff even gives, but if it's
not essential then I think it's fine to disable it on platforms that don't
support it.
Comment 3 Martin Schulze 2004-07-15 17:37:24 UTC
I've added a configure check for this problem. The operator overloads now should
be disabled for the FORTE.
Comment 4 Martin Schulze 2004-07-23 14:22:18 UTC
Could you confirm that this is fixed, please?
Comment 5 Murray Cumming 2004-07-23 14:34:37 UTC
If you put a test or release tarball online then Damien can test it for us.
Sorry, I can't do that right now.
Comment 6 Martin Schulze 2004-07-23 15:45:52 UTC
Okay, new test tarball uploaded to:
http://www.hippogriff.de/libsigc++-2.0.3-test-forte.tar.gz

Damien, could you please make a try, once again? With any luck, we should get
past test_lambda now.
Thanks!
Comment 7 Martin Schulze 2004-07-23 21:38:08 UTC
It failed again! I've asked Damien to send his sigc++config.h since the
configure check I've added obviously doesn't work. It should fail with the Forte
because it simulates the code of the lambda operator overloads which doesn't
compile.
Comment 8 Martin Schulze 2004-08-21 12:40:05 UTC
In principle this is fixed in cvs and 2.0.4 (see ChangeLog).
Issue left: the expression 'sigc::var("\n")' doesn't compile with the FORTE
(also see comment in sigc++/adaptors/lambda/macros/base.h.m4).