llvm-project
27 строк · 842.0 Байт
1// RUN: %clang_cc1 -std=c++11 -fsyntax-only -verify %s
2
3int i = delete; // expected-error{{only functions}}4int j = default; // expected-error{{special member functions}}5
6int f() = delete, g; // expected-error{{'= delete' is a function definition}}7int o, p() = delete; // expected-error{{'= delete' is a function definition}}8
9int q() = default, r; // expected-error{{only special member functions}} \10// expected-error{{'= default' is a function definition}}
11int s, t() = default; // expected-error{{'= default' is a function definition}}12
13struct foo {14foo() = default;15~foo() = delete;16void bar() = delete;17};18
19void baz() = delete;20
21struct quux {22int quux() = default; // expected-error{{constructor cannot have a return type}}23};24
25struct attrs {26[[noreturn]] friend void deleted_with_attrs() = delete;27};28