Richard Smith | 34b41d9 | 2011-02-20 03:19:35 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 -fsyntax-only -verify %s -std=c++0x |
| 2 | |
| 3 | template<typename T> |
| 4 | struct only { |
| 5 | only(T); |
| 6 | template<typename U> only(U) = delete; // expected-note {{here}} |
| 7 | }; |
| 8 | |
| 9 | template<typename ...T> |
| 10 | void f(T ...t) { |
| 11 | auto x(t...); // expected-error {{requires an initializer}} expected-error {{contains multiple expressions}} |
| 12 | only<int> check = x; |
| 13 | } |
| 14 | |
| 15 | void g() { |
| 16 | f(); // expected-note {{here}} |
| 17 | f(0); |
| 18 | f(0, 1); // expected-note {{here}} |
| 19 | } |
| 20 | |
| 21 | |
| 22 | template<typename T> |
| 23 | bool h(T t) { |
| 24 | auto a = t; |
| 25 | decltype(a) b; |
| 26 | a = a + b; |
| 27 | |
| 28 | auto p = new auto(t); |
| 29 | |
| 30 | only<double*> test = p; // expected-error {{conversion function from 'char *' to 'only<double *>'}} |
| 31 | return p; |
| 32 | } |
| 33 | |
| 34 | bool b = h('x'); // expected-note {{here}} |