1 // RUN: %clang_cc1 -fms-extensions -fdelayed-template-parsing -fsyntax-only -verify %s
2 
3 template <class T>
4 class A {
5    void foo() {
6        undeclared();
7    }
8    void foo2();
9 };
10 
11 template <class T>
12 class B {
13    void foo4() { } // expected-note {{previous definition is here}}  expected-note {{previous definition is here}}
14    void foo4() { } // expected-error {{class member cannot be redeclared}} expected-error {{redefinition of 'foo4'}}  expected-note {{previous definition is here}}
15 };
16 
17 
18 template <class T>
19 void B<T>::foo4() {// expected-error {{redefinition of 'foo4'}}
20 }
21 
22 template <class T>
23 void A<T>::foo2() {
24     undeclared();
25 }
26 
27 
28 template <class T>
29 void foo3() {
30    undeclared();
31 }
32 
33 template void A<int>::foo2();
34 
35 
36 void undeclared()
37 {
38 
39 }
40 
41 template <class T> void foo5() {} //expected-note {{previous definition is here}}
42 template <class T> void foo5() {} // expected-error {{redefinition of 'foo5'}}
43 
44 
45 
46 namespace Inner_Outer_same_template_param_name {
47 
48 template <class T>
49 class Outmost {
50 public:
51     template <class T>
52     class Inner {
53     public:
54         void f() {
55             T* var;
56         }
57    };
58 };
59 
60 }
61 
62