[Bug c++/17403] New: Inherited data member reported as undeclared.
william dot crocker at analog dot com
gcc-bugzilla@gcc.gnu.org
Fri Sep 10 17:32:00 GMT 2004
GCC Team:
Version of GCC: 3.4.2
System type: Linux juno 2.4.20-20.8 #1 Mon Aug 18 14:59:07 EDT 2003 i686 i686
i386 GNU/Linux
Build options: [whc@juno gcc]$ usr_local_3.4.2/bin/g++ -v
Reading specs from
/home/whc/lintel/gcc/usr_local_3.4.2/lib/gcc/i686-pc-linux-gnu/3.4.2/specs
Configured with: ./configure : (reconfigured) ./configure
--prefix=/home/whc/lintel/gcc/usr_local_3.4.2
Thread model: posix
gcc version 3.4.2
The following code (which used to work)
now produces an error.
Sorry if being-an-error is now the proper behavior
I just can't imagine why.
Bill
---------------------------- The code.
class BaseIter {
public:
void *theList;
};
template <class T>
class ConstIter : public BaseIter {
public:
void *the_list() {
return theList;
}
};
template <class T>
class Listiter : public ConstIter<T> {
public:
void *the_list() {
// return ConstIter<T>::theList; // Okay.
return theList; // Line #19, Error. Why ??
}
};
------------ When I try to compile.
home/whc/lintel/gcc/usr_local_3.4.2/bin/g++ z.cc
z.cc: In member function `void* Listiter<T>::the_list()':
z.cc:19: error: `theList' undeclared (first use this function)
z.cc:19: error: (Each undeclared identifier is reported only once for each
function it appears in.)
make: *** [z.o] Error 1
novus:/home/whc/lintel/gcc:
--
Summary: Inherited data member reported as undeclared.
Product: gcc
Version: 3.4.2
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: william dot crocker at analog dot com
CC: gcc-bugs at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17403
More information about the Gcc-bugs
mailing list