1*67e74705SXin Li // RUN: %clang_cc1 -fsyntax-only -verify %s -std=c++11
2*67e74705SXin Li
f()3*67e74705SXin Li void f() {
4*67e74705SXin Li auto a = f(); // expected-error {{variable has incomplete type 'void'}}
5*67e74705SXin Li auto &b = f(); // expected-error {{cannot form a reference to 'void'}}
6*67e74705SXin Li auto *c = f(); // expected-error {{incompatible initializer of type 'void'}}
7*67e74705SXin Li
8*67e74705SXin Li auto d(f()); // expected-error {{variable has incomplete type 'void'}}
9*67e74705SXin Li auto &&e(f()); // expected-error {{cannot form a reference to 'void'}}
10*67e74705SXin Li auto *g(f()); // expected-error {{incompatible initializer of type 'void'}}
11*67e74705SXin Li
12*67e74705SXin Li (void)new auto(f()); // expected-error {{allocation of incomplete type 'void'}}
13*67e74705SXin Li (void)new auto&(f()); // expected-error {{cannot form a reference to 'void'}}
14*67e74705SXin Li (void)new auto*(f()); // expected-error {{incompatible constructor argument of type 'void'}}
15*67e74705SXin Li }
16