| Richard Smith | 9ca5c42 | 2011-10-13 22:29:44 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 -fsyntax-only -verify %s -std=c++11 | 
| Richard Smith | 9647d3c | 2011-03-17 16:11:59 +0000 | [diff] [blame] | 2 |  | 
|  | 3 | void f() { | 
|  | 4 | auto a = f(); // expected-error {{variable has incomplete type 'void'}} | 
|  | 5 | auto &b = f(); // expected-error {{cannot form a reference to 'void'}} | 
|  | 6 | auto *c = f(); // expected-error {{incompatible initializer of type 'void'}} | 
|  | 7 |  | 
|  | 8 | auto d(f()); // expected-error {{variable has incomplete type 'void'}} | 
|  | 9 | auto &&e(f()); // expected-error {{cannot form a reference to 'void'}} | 
|  | 10 | auto *g(f()); // expected-error {{incompatible initializer of type 'void'}} | 
|  | 11 |  | 
|  | 12 | (void)new auto(f()); // expected-error {{allocation of incomplete type 'void'}} | 
|  | 13 | (void)new auto&(f()); // expected-error {{cannot form a reference to 'void'}} | 
|  | 14 | (void)new auto*(f()); // expected-error {{incompatible constructor argument of type 'void'}} | 
|  | 15 | } |