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++/15863] New: Nested class template lookup regression in 3.4-branch


Hi,

The following testcase is simplified from the wvstreams library + extra tests added. It fails with 
current 3.4-branch though they are accepted by gcc 3.3.2, icc and Comeau C++.

[gb@n2 gcc]$ ./cc1plus --version
GNU C++ version 3.4.1 20040607 (prerelease) (i686-pc-linux-gnu)

[gb@n2 gcc]$ cat /home/gb/vrac/template2.cpp
// { dg-do compile }

// Simplified testcase from the wvstreams library
template< class K, class D >
struct A {
        template< typename T >
        struct B { };

        struct I {
                void f(void) {
                        A::B<K> k;
                }
        };
};

// Related tests?
template< typename K >
struct B {
        template< int > struct X {};
        template< typename T > struct C {};

        struct V1 { B::X<0> x; };
        struct V2 { B::C<int> c; };
        struct V3 { void f() { B::X<0> x; } };
        struct V4 { void f() { B::C<int> c; } };
};

[gb@n2 gcc]$ ./cc1plus ~/vrac/template2.cpp
 void A<K, D>::I::f()

/home/gb/vrac/template2.cpp:11: error: expected primary-expression before '>' token
/home/gb/vrac/template2.cpp:11: error: `k' undeclared (first use this function)
/home/gb/vrac/template2.cpp:11: error: (Each undeclared identifier is reported only once for each 
function it appears in.)
 void B<K>::V3::f()

/home/gb/vrac/template2.cpp:24: error: `x' undeclared (first use this function)
 void B<K>::V4::f()

/home/gb/vrac/template2.cpp:25: error: expected primary-expression before "int"
/home/gb/vrac/template2.cpp:25: error: expected `;' before "int"

-- 
           Summary: Nested class template lookup regression in 3.4-branch
           Product: gcc
           Version: 3.4.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: gbeauchesne at mandrakesoft dot com
                CC: gcc-bugs at gcc dot gnu dot org
  GCC host triplet: i686-pc-linux-gnu


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


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