This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/17496] New: cannot access member of template base class in template derived class
- From: "papadopo at shfj dot cea dot fr" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 15 Sep 2004 08:09:31 -0000
- Subject: [Bug c++/17496] New: cannot access member of template base class in template derived class
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
template <typename T> struct A {
int a;
};
template <typename T> struct B : public A<T> {
void foo() { a = 1; }
};
The above code won't compile:
foo.cc: In member function `void B<T>::foo()':
foo.cc:5: error: `a' undeclared (first use this function)
foo.cc:5: error: (Each undeclared identifier is reported only once for each
function it appears in.)
I can reproduce that with 3.4.0, 3.4.1, 3.4.2, and the 3.5 beta shipped with
Fedora 3 test releases.
I can't reproduce that with former gcc releases such as gcc 3.3.4.
--
Summary: cannot access member of template base class in template
derived class
Product: gcc
Version: 3.4.0
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: papadopo at shfj dot cea dot fr
CC: gcc-bugs at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17496