This is the mail archive of the
gcc-prs@gcc.gnu.org
mailing list for the GCC project.
c++/9419: inherited member in template doesnt work
- From: rassahah at neofonie dot de
- To: gcc-gnats at gcc dot gnu dot org
- Date: 23 Jan 2003 16:14:29 -0000
- Subject: c++/9419: inherited member in template doesnt work
- Reply-to: rassahah at neofonie dot de
>Number: 9419
>Category: c++
>Synopsis: inherited member in template doesnt work
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: unassigned
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Thu Jan 23 16:16:00 UTC 2003
>Closed-Date:
>Last-Modified:
>Originator: Rasmus Hahn
>Release: gcc version 3.4 20030123
>Organization:
>Environment:
$ g++ -v
Reading specs from /usr/lib/gcc-lib/i686-pc-linux-gnu/3.4/specs
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --enable-threads --enable-languages=c,c++,objc
Thread model: posix
gcc version 3.4 20030123 (experimental)
>Description:
g++ does not find inherited member in template class. if specifiing member with explicitely with
`this->' it works. This bug seems new in this version of g++; the version from a few weeks ago
worked.
output from how-to-repeat:
$ g++ x.cc
x.cc: In member function `void B<X>::foo()':
x.cc:9: error: `a' has not been declared
$
>How-To-Repeat:
template <class X>
struct A {
int a;
};
template <class X>
struct B :public A <X> {
void foo () {
a = 3; // with `this->a = 3' it works
}
};
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted: