This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/11645] New: Failure to deal with using and private inheritance
- From: "gcc-bugzilla at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 23 Jul 2003 14:28:35 -0000
- Subject: [Bug c++/11645] New: Failure to deal with using and private inheritance
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11645
Summary: Failure to deal with using and private inheritance
Product: gcc
Version: 3.3.1
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: foskey at optushome dot com dot au
CC: gcc-bugs at gcc dot gnu dot org
GCC build triplet: i386-pc-linux-gnu
GCC host triplet: i386-pc-linux-gnu
GCC target triplet: i386-pc-linux-gnu
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();
}