blob: 0ea59481d5f3e54a249e6d9fe0f5c97b5aa51995 [file] [log] [blame]
Richard Smith34b41d92011-02-20 03:19:35 +00001// RUN: %clang_cc1 -fsyntax-only -verify %s -std=c++0x
2
3template<typename T>
4struct only {
5 only(T);
6 template<typename U> only(U) = delete; // expected-note {{here}}
7};
8
9template<typename ...T>
10void f(T ...t) {
11 auto x(t...); // expected-error {{requires an initializer}} expected-error {{contains multiple expressions}}
12 only<int> check = x;
13}
14
15void g() {
16 f(); // expected-note {{here}}
17 f(0);
18 f(0, 1); // expected-note {{here}}
19}
20
21
22template<typename T>
23bool 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
34bool b = h('x'); // expected-note {{here}}