1 // RUN: %clang_cc1 -fsyntax-only -verify %s
4 template<class T1
> struct C1
{
6 T1 t1
= 3; // expected-error {{cannot initialize a variable}}
10 template<class T2
> struct C2
{
12 new C1
<T2
>(); // expected-note {{in instantiation of member function}}
18 c2
.c2(); // expected-note {{in instantiation of member function}}
27 virtual T
Value() const
29 return 1; // expected-error{{cannot initialize return object of type 'int *' with an rvalue of type 'int'}}
36 static Target
<T
> Instance
;
40 Target
<T
> Provider
<T
>::Instance
; // expected-note{{in instantiation of}}
44 Target
<int*>* traits
= &Provider
<int*>::Instance
; // expected-note{{requested here}}
50 virtual void Accept(int) = 0;
53 template <typename Type
>
56 static_cast<Type
*>(0)->Accept(i
); // expected-error{{member reference base}}
58 static GMG
* Method() { return &singleton
; } // expected-note{{in instantiation of}}
62 template <typename Type
>
63 GMG
<Type
> GMG
<Type
>::singleton
; // expected-note{{requested here}}
66 GMG
<int>::Method(); // expected-note{{in instantiation of}}