vtable-instantiation.cc revision 2a5f99eb4e2af771faacfceb9f78e230129c5e5a
1// RUN: %clang_cc1 -fsyntax-only -verify %s
2// PR8640
3
4template<class T1> struct C1 {
5  virtual void c1() {
6    T1 t1 = 3;  // expected-error {{cannot initialize a variable}}
7  }
8};
9
10template<class T2> struct C2 {
11  void c2() {
12    new C1<T2>();  // expected-note {{in instantiation of member function}}
13  }
14};
15
16void f() {
17  C2<int*> c2;
18  c2.c2();  // expected-note {{in instantiation of member function}}
19}
20
21