GNOME Bugzilla – Bug 161502
access error in adaptors/lambda/lambda.cc on Tru64
Last modified: 2005-01-19 21:33:40 UTC
Tru64 UNIX 5.1b, vendor C and C++ compilers. (Note: this is a completely different issue from bug #113529) Compiling sigc++ 2.0.6 with CXXFLAGS set to CXX=cxx CXXFLAGS="-std strict_ansi -model ansi -O2 -g3 -readonly_strings" eventually results in the compile failing in adaptors/lambda/lambda.cc: cxx -DHAVE_CONFIG_H -I.. -I.. -std strict_ansi -model ansi -O2 -g3 -readonly_strings -c -MD adaptors/lambda/lambda.cc -DPIC -o .libs/lambda.o cxx: Error: ../sigc++/type_traits.h, line 103: class "sigc::is_base_and_derived<T_base, T_derived>::big [with T_base=sigc::lambda_base, T_derived=sigc::internal::lambda_select1]" is inaccessible detected during: instantiation of class "sigc::is_base_and_derived<T_base, T_derived>::test [with T_base=sigc::lambda_base, T_derived=sigc::internal::lambda_select1]" at line 109 instantiation of class "sigc::is_base_and_derived<T_base, T_derived> [with T_base=sigc::lambda_base, T_derived=sigc::internal::lambda_select1]" at line 50 of "../sigc++/adaptors/lambda/base.h" processing of template argument list for "sigc::internal::lambda_core" based on template argument <sigc::internal::lambda_select1> at line 316 of "../sigc++/adaptors/lambda/base.h" instantiation of class "sigc::lambda<T_type> [with T_type=sigc::internal::lambda_select1]" at line 7 of "adaptors/lambda/lambda.cc" static big is_base_class_(...); -----------^ cxx: Error: ../sigc++/type_traits.h, line 103: class "sigc::is_base_and_derived<T_base, T_derived>::big [with T_base=sigc::lambda_base, T_derived=sigc::internal::lambda_select2]" is inaccessible detected during: instantiation of class "sigc::is_base_and_derived<T_base, T_derived>::test [with T_base=sigc::lambda_base, T_derived=sigc::internal::lambda_select2]" at line 109 instantiation of class "sigc::is_base_and_derived<T_base, T_derived> [with T_base=sigc::lambda_base, T_derived=sigc::internal::lambda_select2]" at line 50 of "../sigc++/adaptors/lambda/base.h" processing of template argument list for "sigc::internal::lambda_core" based on template argument <sigc::internal::lambda_select2> at line 316 of "../sigc++/adaptors/lambda/base.h" instantiation of class "sigc::lambda<T_type> [with T_type=sigc::internal::lambda_select2]" at line 8 of "adaptors/lambda/lambda.cc" static big is_base_class_(...); -----------^ cxx: Error: ../sigc++/type_traits.h, line 103: class "sigc::is_base_and_derived<T_base, T_derived>::big [with T_base=sigc::lambda_base, T_derived=sigc::internal::lambda_select3]" is inaccessible detected during: instantiation of class "sigc::is_base_and_derived<T_base, T_derived>::test [with T_base=sigc::lambda_base, T_derived=sigc::internal::lambda_select3]" at line 109 instantiation of class "sigc::is_base_and_derived<T_base, T_derived> [with T_base=sigc::lambda_base, T_derived=sigc::internal::lambda_select3]" at line 50 of "../sigc++/adaptors/lambda/base.h" processing of template argument list for "sigc::internal::lambda_core" based on template argument <sigc::internal::lambda_select3> at line 316 of "../sigc++/adaptors/lambda/base.h" instantiation of class "sigc::lambda<T_type> [with T_type=sigc::internal::lambda_select3]" at line 9 of "adaptors/lambda/lambda.cc" static big is_base_class_(...); -----------^ cxx: Error: ../sigc++/type_traits.h, line 103: class "sigc::is_base_and_derived<T_base, T_derived>::big [with T_base=sigc::lambda_base, T_derived=sigc::internal::lambda_select4]" is inaccessible detected during: instantiation of class "sigc::is_base_and_derived<T_base, T_derived>::test [with T_base=sigc::lambda_base, T_derived=sigc::internal::lambda_select4]" at line 109 instantiation of class "sigc::is_base_and_derived<T_base, T_derived> [with T_base=sigc::lambda_base, T_derived=sigc::internal::lambda_select4]" at line 50 of "../sigc++/adaptors/lambda/base.h" processing of template argument list for "sigc::internal::lambda_core" based on template argument <sigc::internal::lambda_select4> at line 316 of "../sigc++/adaptors/lambda/base.h" instantiation of class "sigc::lambda<T_type> [with T_type=sigc::internal::lambda_select4]" at line 10 of "adaptors/lambda/lambda.cc" static big is_base_class_(...); -----------^ I'm pretty weak in C++, but my understanding is that `private' members cannot be accessed by derived classes, which seems to be what the compiler is complaining about. I tried changing the "private:" to "protected:", but it didn't seem to make a difference.
Note: The build is now successful (with the version in cvs) without the extra CXXFLAGS.
That's great news! How does a make check do? With some contortions I could get it to build before, but as I reported in bug #161503, all the tests segfaulted in the __fini section.
It doesn't seem to core dump when not built with "std strict_ansi -model ansi", but it does with it. This fixed the compile error: //Allow the test inner class to access the other (big) inner class. //The Tru64 compiler needs this. murrayc. struct test; friend struct test; That, and other things for the Tru64 build, are fixed in cvs.
It's good that it will build without `-std strict_ansi'. I'm hopefull that it will build and not coredump whether or not the separate `-model ansi' is used. That may be required by other packages that link against libsigc++. In any case, thanks for your work on this!