This is the mail archive of the gcc-bugs@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]

[Bug c++/17496] New: cannot access member of template base class in template derived class


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


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