1 // RUN: %clang_cc1 -fsyntax-only -verify -std=c++11 %s
11 static_assert(sizeof(U) == 0, "expected type failure");
20 auto g(); // expected-error{{return without trailing return type}}
22 int h() -> int; // expected-error{{trailing return type must specify return type 'auto', not 'int'}}
28 using T = auto (int) -> auto (*)(char) -> void; // expected-note {{previous}}
29 using T = void; // expected-error {{type alias redefinition with different types ('void' vs 'auto (int) -> auto (*)(char) -> void')}}
31 using U = auto (int) -> auto (*)(char) -> void;
32 using U = void (*(int))(char); // ok
37 auto i(T x) -> decltype(x)
42 only<double> p1 = i(1.0);
47 auto f(T x) -> T { return x; }
50 auto g(T x, U y) -> decltype(x + y)
58 auto h(T x, U y, V z) -> decltype(x + y + z)
65 nested<U> get_nested();
69 only<int> p2 = xx.f(0L);
70 only<double> p3 = xx.g(0L, 1.0);
71 only<double> p4 = xx.get_nested<double>().h(0L, 1.0, 3.14f);
75 auto f1(T t) -> decltype(f1(t)) {} // expected-note{{candidate template ignored}}
78 f1(0); // expected-error{{no matching function for call to 'f1'}}
82 auto f2(T t) -> decltype(f2(&t)) {} // expected-note{{candidate template ignored}}
85 f2(0); // expected-error{{no matching function for call to 'f2'}}