brintos

brintos / llvm-project-archived public Read only

0
0
Text · 778 B · b323dfc Raw
16 lines · cpp
1// RUN: %clang_cc1 -fsyntax-only -verify %s -std=c++112 3void 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}16