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