language: C++ 4.7.2 (gcc-4.7.2)
date: 448 days 19 hours ago
link:
visibility: public
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
template <typename T>
struct A {
    struct B {
    };
};
 
struct C {
    typedef A<C> D;
 
    int f() {
        typename D::B p;
        return 0;
    }
};
 
C gc;
int x = gc.f();
 
template <>
struct A<C> {
    struct B {
        B() {
            cout << "B::B()" << endl;
        }
 
        ~B() {
            cout << "B::~B()" << endl;
        }
    };
};
 
int main() {
}
 
prog.cpp: In member function ‘int C::f()’:
prog.cpp:11: error: using ‘typename’ outside of template
prog.cpp:11: warning: unused variable ‘p’
prog.cpp: At global scope:
prog.cpp:20: error: specialization of ‘A<C>’ after instantiation
prog.cpp:20: error: redefinition of ‘struct A<C>’
prog.cpp:2: error: previous definition of ‘struct A<C>’