This is the mail archive of the
gcc-prs@gcc.gnu.org
mailing list for the GCC project.
c++/10133: public/protected member of template base class is not seen in derived template class.
- From: carlo at alinoe dot com
- To: gcc-gnats at gcc dot gnu dot org
- Date: 18 Mar 2003 12:26:46 -0000
- Subject: c++/10133: public/protected member of template base class is not seen in derived template class.
- Reply-to: carlo at alinoe dot com
>Number: 10133
>Category: c++
>Synopsis: public/protected member of template base class is not seen in derived template class.
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: unassigned
>State: open
>Class: rejects-legal
>Submitter-Id: net
>Arrival-Date: Tue Mar 18 12:36:00 UTC 2003
>Closed-Date:
>Last-Modified:
>Originator: Carlo Wood
>Release: gcc version 3.4 20030313 (experimental)
>Organization:
>Environment:
>Description:
The following is a regression, it compiles with all
versions up till and including 3.3 (20030313).
I am not 100% sure it *should* compile.
> cat test.cc
template <int instance>
struct B {
int i;
};
template <int instance>
struct A : public B <instance> {
void f() { int* p = &i; }
};
> g++-cvs-3.4 -c test.cc
test.cc: In member function `void A<instance>::f()':
test.cc:8: error: `i' has not been declared
>How-To-Repeat:
>Fix:
Using '&B<instance>::i' instead of '&i' works.
Using '&this->i' also works.
>Release-Note:
>Audit-Trail:
>Unformatted: