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 168261 - gcc-3.2.3 build failure in is_base_and_derived<>
gcc-3.2.3 build failure in is_base_and_derived<>
Status: RESOLVED FIXED
Product: libsigc++
Classification: Bindings
Component: build
2.0.x
Other Linux
: Normal normal
: ---
Assigned To: Martin Schulze
Martin Schulze
Depends on:
Blocks:
 
 
Reported: 2005-02-23 14:11 UTC by The Written Word
Modified: 2005-06-12 21:11 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Configure + build log (18.37 KB, text/plain)
2005-04-06 13:21 UTC, Vincent
  Details
The proposed patch. (4.41 KB, patch)
2005-06-12 11:54 UTC, Paul Pogonyshev
none Details | Review

Description The Written Word 2005-02-23 14:11:53 UTC
Version details: 2.0.10
Distribution/Version: RHEL 3.0/x86

Encountered the following failure building with gcc-3.2.3:
 g++ -DHAVE_CONFIG_H -I.. -I.. -g -O2 -MT lambda.lo -MD -MP -MF .deps/lambda.Tpo
-c adaptors/lambda/lambda.cc  -fPIC -DPIC -o .libs/lambda.o
../sigc++/type_traits.h: In instantiation of
`sigc::is_base_and_derived<sigc::lambda_base, sigc::internal::lambda_select1>':
adaptors/lambda/lambda.cc:7:   instantiated from
`sigc::lambda<sigc::internal::lambda_select1>'
adaptors/lambda/lambda.cc:7:   instantiated from here
../sigc++/type_traits.h:118: invalid use of undefined type `struct 
   sigc::is_base_and_derived<sigc::lambda_base, sigc::internal::lambda_select1>
   '
../sigc++/type_traits.h:96: declaration of `struct 
   sigc::is_base_and_derived<sigc::lambda_base, sigc::internal::lambda_select1>
   '
adaptors/lambda/lambda.cc: In instantiation of
`sigc::lambda<sigc::internal::lambda_select1>':
adaptors/lambda/lambda.cc:7:   instantiated from here
adaptors/lambda/lambda.cc:7: non-constant `
   sigc::is_base_and_derived<sigc::lambda_base, 
   sigc::internal::lambda_select1>::value' cannot be used as template argument
../sigc++/type_traits.h: In instantiation of
`sigc::is_base_and_derived<sigc::lambda_base, sigc::internal::lambda_select2>':
adaptors/lambda/lambda.cc:8:   instantiated from
`sigc::lambda<sigc::internal::lambda_select2>'
adaptors/lambda/lambda.cc:8:   instantiated from here
../sigc++/type_traits.h:118: invalid use of undefined type `struct 
   sigc::is_base_and_derived<sigc::lambda_base, sigc::internal::lambda_select2>
   '
../sigc++/type_traits.h:96: declaration of `struct 
   sigc::is_base_and_derived<sigc::lambda_base, sigc::internal::lambda_select2>
   '
adaptors/lambda/lambda.cc: In instantiation of
`sigc::lambda<sigc::internal::lambda_select2>':
adaptors/lambda/lambda.cc:8:   instantiated from here
adaptors/lambda/lambda.cc:8: non-constant `
   sigc::is_base_and_derived<sigc::lambda_base, 
   sigc::internal::lambda_select2>::value' cannot be used as template argument
../sigc++/type_traits.h: In instantiation of
`sigc::is_base_and_derived<sigc::lambda_base, sigc::internal::lambda_select3>':
adaptors/lambda/lambda.cc:9:   instantiated from
`sigc::lambda<sigc::internal::lambda_select3>'
adaptors/lambda/lambda.cc:9:   instantiated from here
../sigc++/type_traits.h:118: invalid use of undefined type `struct 
   sigc::is_base_and_derived<sigc::lambda_base, sigc::internal::lambda_select3>
   '
../sigc++/type_traits.h:96: declaration of `struct 
   sigc::is_base_and_derived<sigc::lambda_base, sigc::internal::lambda_select3>
   '
adaptors/lambda/lambda.cc: In instantiation of
`sigc::lambda<sigc::internal::lambda_select3>':
adaptors/lambda/lambda.cc:9:   instantiated from here
adaptors/lambda/lambda.cc:9: non-constant `
   sigc::is_base_and_derived<sigc::lambda_base, 
   sigc::internal::lambda_select3>::value' cannot be used as template argument
../sigc++/type_traits.h: In instantiation of
`sigc::is_base_and_derived<sigc::lambda_base, sigc::internal::lambda_select4>':
adaptors/lambda/lambda.cc:10:   instantiated from
`sigc::lambda<sigc::internal::lambda_select4>'
adaptors/lambda/lambda.cc:10:   instantiated from here
../sigc++/type_traits.h:118: invalid use of undefined type `struct 
   sigc::is_base_and_derived<sigc::lambda_base, sigc::internal::lambda_select4>
   '
../sigc++/type_traits.h:96: declaration of `struct 
   sigc::is_base_and_derived<sigc::lambda_base, sigc::internal::lambda_select4>
   '
adaptors/lambda/lambda.cc: In instantiation of
`sigc::lambda<sigc::internal::lambda_select4>':
adaptors/lambda/lambda.cc:10:   instantiated from here
adaptors/lambda/lambda.cc:10: non-constant `
   sigc::is_base_and_derived<sigc::lambda_base, 
   sigc::internal::lambda_select4>::value' cannot be used as template argument
../sigc++/type_traits.h: In instantiation of
`sigc::is_base_and_derived<sigc::lambda_base, sigc::internal::lambda_select5>':
adaptors/lambda/lambda.cc:11:   instantiated from
`sigc::lambda<sigc::internal::lambda_select5>'
adaptors/lambda/lambda.cc:11:   instantiated from here
../sigc++/type_traits.h:118: invalid use of undefined type `struct 
   sigc::is_base_and_derived<sigc::lambda_base, sigc::internal::lambda_select5>
   '
../sigc++/type_traits.h:96: declaration of `struct 
   sigc::is_base_and_derived<sigc::lambda_base, sigc::internal::lambda_select5>
   '
adaptors/lambda/lambda.cc: In instantiation of
`sigc::lambda<sigc::internal::lambda_select5>':
adaptors/lambda/lambda.cc:11:   instantiated from here
adaptors/lambda/lambda.cc:11: non-constant `
   sigc::is_base_and_derived<sigc::lambda_base, 
   sigc::internal::lambda_select5>::value' cannot be used as template argument
../sigc++/type_traits.h: In instantiation of
`sigc::is_base_and_derived<sigc::lambda_base, sigc::internal::lambda_select6>':
adaptors/lambda/lambda.cc:12:   instantiated from
`sigc::lambda<sigc::internal::lambda_select6>'
adaptors/lambda/lambda.cc:12:   instantiated from here
../sigc++/type_traits.h:118: invalid use of undefined type `struct 
   sigc::is_base_and_derived<sigc::lambda_base, sigc::internal::lambda_select6>
   '
../sigc++/type_traits.h:96: declaration of `struct 
   sigc::is_base_and_derived<sigc::lambda_base, sigc::internal::lambda_select6>
   '
adaptors/lambda/lambda.cc: In instantiation of
`sigc::lambda<sigc::internal::lambda_select6>':
adaptors/lambda/lambda.cc:12:   instantiated from here
adaptors/lambda/lambda.cc:12: non-constant `
   sigc::is_base_and_derived<sigc::lambda_base, 
   sigc::internal::lambda_select6>::value' cannot be used as template argument
../sigc++/type_traits.h: In instantiation of
`sigc::is_base_and_derived<sigc::lambda_base, sigc::internal::lambda_select7>':
adaptors/lambda/lambda.cc:13:   instantiated from
`sigc::lambda<sigc::internal::lambda_select7>'
adaptors/lambda/lambda.cc:13:   instantiated from here
../sigc++/type_traits.h:118: invalid use of undefined type `struct 
   sigc::is_base_and_derived<sigc::lambda_base, sigc::internal::lambda_select7>
   '
../sigc++/type_traits.h:96: declaration of `struct 
   sigc::is_base_and_derived<sigc::lambda_base, sigc::internal::lambda_select7>
   '
adaptors/lambda/lambda.cc: In instantiation of
`sigc::lambda<sigc::internal::lambda_select7>':
adaptors/lambda/lambda.cc:13:   instantiated from here
adaptors/lambda/lambda.cc:13: non-constant `
   sigc::is_base_and_derived<sigc::lambda_base, 
   sigc::internal::lambda_select7>::value' cannot be used as template argument
make[3]: *** [lambda.lo] Error 1
Comment 1 The Written Word 2005-02-23 14:12:18 UTC
BTW, it does build with gcc-3.3.2 and gcc-3.4.3.
Comment 2 Murray Cumming 2005-02-23 14:43:52 UTC
Thanks. Do you know the most recent (if any) version that does build with this
compiler?
Comment 3 The Written Word 2005-02-23 14:52:42 UTC
2.0.6.
Comment 4 Murray Cumming 2005-03-03 11:30:07 UTC
I'm not too worried as long as a version does build. You could try patching the
is_base_and_derived struct locally if you need the few extra bugfixes since
then. I'd be OK with a patch to add an "#ifdef 0" block with a comment that
mentions the broken compilers explicitly. A compiler test (see below) might
detect this too, but I'm not sure if it's worth it.

The problem seems to be:

../sigc++/type_traits.h:118: invalid use of undefined type `struct 
   sigc::is_base_and_derived<sigc::lambda_base, sigc::internal::lambda_select1>

- in 2.0.6, the is_base_class() static methods were in an inner class of
is_base_and_derived.
- in 2.0.7+, they are in the is_base_and_derived class itself, without the inner
class.

In both cases, the class is not fully defined, and in no cases should that
matter, because they are static.


Comment 5 Murray Cumming 2005-03-06 12:19:39 UTC
Does this help?
Comment 6 The Written Word 2005-03-06 20:12:36 UTC
Sorry, no time to look at this yet. Hopefully in a few weeks.
Comment 7 Dimitri Papadopoulos 2005-04-04 13:07:03 UTC
Same thing here with the Red Hat 9 compiler
gcc 3.2.2 20030222 (Red Hat Linux 3.2.2-5)
and libsigc++-2.0.11.
Comment 8 Vincent 2005-04-06 13:20:30 UTC
I also encountered the same problem while trying to build gnome-coaster on
GARNOME 2.10.0.1 on my RHEL WS3 box. 
my gcc spec is: gcc (GCC) 3.2.3 20030502 (Red Hat Linux 3.2.3-49)

This is libsigc++ v2.0.10. Attaching configure + build failure log. I'll install
an updated toolchain, much worth it imho than fixing code for broken compilers.
Comment 9 Vincent 2005-04-06 13:21:27 UTC
Created attachment 39746 [details]
Configure + build log
Comment 10 Murray Cumming 2005-04-07 09:08:14 UTC
Comment #4 (http://bugzilla.gnome.org/show_bug.cgi?id=168261#c4) still applies.
Comment 11 Murray Cumming 2005-04-25 13:08:10 UTC
I'd like someone to at least create a simple C++ test case (without using
libsigc++) to show this compiler problem. Then we can check for it in
libsigc++'s configure step.
Comment 12 Murray Cumming 2005-04-28 08:22:04 UTC
I have added comments in sigc++/type_traits.h to help someone create a patch.
I'm not using g++ 3.2 so I can't do it for you.
Comment 13 Paul Pogonyshev 2005-06-12 11:53:46 UTC
I have made a patch for this.  It is diffed against 2.0.14 as, from my
observations, success of using `autogen.sh' for any package that you don't
maintain, is close to 0%.
Comment 14 Paul Pogonyshev 2005-06-12 11:54:34 UTC
Created attachment 47644 [details] [review]
The proposed patch.
Comment 15 Paul Pogonyshev 2005-06-12 13:29:34 UTC
Forgot the change log entry:

2005-06-12  Paul Pogonyshev  <pogonyshev@gmx.net>

	* configure.ac: 
	* scripts/cxx.m4: 
	* sigc++config.h.in: Add test for whether the compiler allows
	referencing to member functions of the class/structure being
	declared from a definition of a static member variable.
	Supposedly a generic solution for GCC 3.2 compilation problems.

	* sigc++/type_traits.h: Define SIGC_WRAP_IS_BASE_CLASS_ based on
	results of the above test.
	(struct is_base_and_derived): Wrap up is_base_class_() functions
	in an internal class if SIGC_WRAP_IS_BASE_CLASS_ is defined.
Comment 16 Murray Cumming 2005-06-12 21:11:23 UTC
Excellent. Thanks. I have committed this, but without the extra
SIGC_WRAP_IS_BASE_CLASS_ define.