This is the mail archive of the gcc-prs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

c++/9419: inherited member in template doesnt work


>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:


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]