Code following works in gcc 3.2 but not in gcc 3.3.1, worked in gcc 3.3.0. gcctest.cpp: In member function `void INetContentTypeParameterList::Clear()': gcctest.cpp:21: error: cannot call member function `int Container::Count()' without object gcctest.cpp:22: error: cannot call member function `int Container::Count()' without object Environment: System: Linux gandalf 2.4.20 #4 Mon Apr 7 22:21:12 EST 2003 i686 GNU/Linux Architecture: i686 host: i386-pc-linux-gnu build: i386-pc-linux-gnu target: i386-pc-linux-gnu configured with: ../src/configure -v --enable-languages=c,c++,java,f77,pascal,objc,ada,treelang --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-gxx-include-dir=/usr/include/c++/3.3 --enable-shared --with-system-zlib --enable-nls --without-included-gettext --enable-__cxa_atexit --enable-clocale=gnu --enable-debug --enable-java-gc=boehm --enable-java-awt=xlib --enable-objc-gc i386-linux How-To-Repeat: class Contained {}; class Container { public: int Count(); void* Remove(int); }; class List : private Container { public: using Container::Count; using Container::Remove; }; class INetContentTypeParameterList : private List { public: void Clear(); }; void INetContentTypeParameterList::Clear() { while (Count()) delete static_cast<Contained*>(Remove(Count() - 1)); } int main() { INetContentTypeParameterList ilist; ilist.Clear(); }
This looks valid to me but I want a second opinion. From Phil's regression hunter: : Search converges between 2003-06-25-trunk (#317) and 2003-06-26-trunk (#318). : Search converges between 2003-06-25-3.3 (#149) and 2003-06-26-3.3 (#150). Reduced sources: struct Container { int Count(); }; struct List : private Container { using Container::Count; }; struct INetContentTypeParameterList : private List { void Clear(); }; void INetContentTypeParameterList::Clear() { Count();//Calling non static but in a non-static method. }
Yes, the code is legal. The only patch in that time windows that to my layman's eyes looks as if it could be related is this one: 2003-06-25 Mark Mitchell <mark@codesourcery.com> PR c++/10990 * search.c (lookup_base_r): Rely on accessible_p, rather than trying to emulate that logic here. PR c++/10931 * call.c (convert_like): Pass issue_conversion_warnings. (convert_like_with_context): Likewise. (convert_like_real): Add issue_conversion_warnings parameter. (perform_direct_initialization_if_possible): New function. * cp-tree.h (perform_direct_initialization_if_possible): Declare it. * typeck.c (check_for_casting_away_constness): New function. (build_static_cast): Rewrite. Mark, would you mind taking a look? W.
Subject: Bug 11645 CVSROOT: /cvs/gcc Module name: gcc Changes by: mmitchel@gcc.gnu.org 2003-07-23 21:28:24 Modified files: gcc/cp : ChangeLog call.c cp-tree.h search.c gcc/testsuite : ChangeLog Added files: gcc/testsuite/g++.dg/inherit: access4.C Log message: PR c++/11645 * cp-tree.h (accessible_base_p): Declare. * call.c (build_over_call): Use it. * search.c (accessible_base_p): New function, split out from ... (lookup_base): ... here. PR c++/11645 * g++.dg/inherit/access4.C: New test. Patches: http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/ChangeLog.diff?cvsroot=gcc&r1=1.3545&r2=1.3546 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/call.c.diff?cvsroot=gcc&r1=1.413&r2=1.414 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/cp-tree.h.diff?cvsroot=gcc&r1=1.884&r2=1.885 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/search.c.diff?cvsroot=gcc&r1=1.276&r2=1.277 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&r1=1.2912&r2=1.2913 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/inherit/access4.C.diff?cvsroot=gcc&r1=NONE&r2=1.1
Subject: Bug 11645 CVSROOT: /cvs/gcc Module name: gcc Branch: gcc-3_3-branch Changes by: mmitchel@gcc.gnu.org 2003-07-23 21:35:40 Modified files: gcc/cp : ChangeLog call.c cp-tree.h search.c gcc/testsuite : ChangeLog Added files: gcc/testsuite/g++.dg/inherit: access4.C Log message: PR c++/11645 * cp-tree.h (accessible_base_p): Declare. * call.c (build_over_call): Use it. * search.c (accessible_base_p): New function, split out from ... (lookup_base): ... here. PR c++/11645 * g++.dg/inherit/access4.C: New test. Patches: http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=1.3076.2.186&r2=1.3076.2.187 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/call.c.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=1.341.2.26&r2=1.341.2.27 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/cp-tree.h.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=1.776.2.27&r2=1.776.2.28 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/search.c.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=1.243.2.14&r2=1.243.2.15 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=1.2261.2.242&r2=1.2261.2.243 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/inherit/access4.C.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=NONE&r2=1.1.2.1
Fixed in GCC 3.3.1, GCC 3.4.
OpenOffice.org now compiles correctly with gcc 3.3.1. Thanks for your help.