Richard Smith | a085da8 | 2011-03-17 16:11:59 +0000 | [diff] [blame^] | 1 | // RUN: %clang_cc1 -fsyntax-only -verify %s -std=c++0x |
| 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 | } |