blob: df24b3d0075a976c0e0aacde2856562a763d2b98 [file] [log] [blame]
Richard Smith762bb9d2011-10-13 22:29:44 +00001// RUN: %clang_cc1 -std=c++11 -fsyntax-only -verify %s
Sean Hunt7880bc32011-05-13 01:01:05 +00002
3int i = delete; // expected-error{{only functions}}
4int j = default; // expected-error{{special member functions}}
5
Sebastian Redlecfcd562012-02-11 23:51:21 +00006int 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}}
Sean Hunt7880bc32011-05-13 01:01:05 +000012
13struct foo {
14 foo() = default;
15 ~foo() = delete;
16 void bar() = delete;
17};
18
19void baz() = delete;
Richard Smithc430ef42011-11-10 09:08:44 +000020
21struct quux {
22 int quux() = default; // expected-error{{constructor cannot have a return type}} expected-error {{member 'quux' has the same name as its class}}
23};