DelayedTemplateParsing.cpp revision d4a0caf78e7c18e7aca65fbfd799a6c024ff51fb
1// RUN: %clang_cc1 -fdelayed-template-parsing -fsyntax-only -verify %s
2
3template <class T>
4class A {
5   void foo() {
6       undeclared();
7   }
8      void foo2();
9};
10
11template <class T>
12class 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
18template <class T>
19void B<T>::foo4() {// expected-error {{redefinition of 'foo4'}}
20}
21
22template <class T>
23void A<T>::foo2() {
24    undeclared();
25}
26
27
28template <class T>
29void foo3() {
30   undeclared();
31}
32
33template void A<int>::foo2();
34
35
36void undeclared()
37{
38
39}
40
41template <class T> void foo5() {} //expected-note {{previous definition is here}}
42template <class T> void foo5() {} // expected-error {{redefinition of 'foo5'}}
43