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++/14376] New: [3.4 regression] scoping problem in template child class


the following code does not compile with the 20040225 snapshot of gcc-3.4, and
compiles correctly with gcc-3.3.2:

---------------
template <class T> struct A { T x; };

template <class T>
struct B : public A<T> {
        B(const A<T> &a) { x = a.x; }
};
---------------
test.C: In constructor `B<T>::B(const A<T>&)':
test.C:5: error: `x' undeclared (first use this function)
test.C:5: error: (Each undeclared identifier is reported only once for each
function it appears in.)


> /dept/rnd/vendor/gcc-3.4pre/bin/g++ -v
Reading specs from
/dept/rnd/vendor/gcc-3.4-20040225/lib/gcc/i686-pc-linux-gnu/3.4.0/specs
Configured with: ../gcc-3.4-20040225/configure
--prefix=/dept/rnd/vendor/gcc-3.4-20040225 --enable-threads --enable-languages=c,c++
Thread model: posix
gcc version 3.4.0 20040225 (prerelease)

-- 
           Summary: [3.4 regression] scoping problem in template child class
           Product: gcc
           Version: 3.4.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: nick at ilm dot com
                CC: gcc-bugs at gcc dot gnu dot org
 GCC build triplet: i686-pc-linux-gnu
  GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14376


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