1// RUN: %clang_cc1 -fsyntax-only -verify %s
2
3template<typename T>
4struct X0 {
5  static T value;
6};
7
8template<typename T>
9T X0<T>::value = 0; // expected-error{{no viable conversion}}
10
11struct X1 {
12  X1(int);
13};
14
15struct X2 { }; // expected-note{{candidate constructor (the implicit copy constructor) not viable}}
16
17int& get_int() { return X0<int>::value; }
18X1& get_X1() { return X0<X1>::value; }
19
20double*& get_double_ptr() { return X0<int*>::value; } // expected-error{{non-const lvalue reference to type 'double *' cannot bind to a value of unrelated type 'int *'}}
21
22X2& get_X2() {
23  return X0<X2>::value; // expected-note{{instantiation}}
24}
25
26template<typename T> T x; // expected-warning{{variable templates are a C++1y extension}}
27