Richard Smith | 762bb9d | 2011-10-13 22:29:44 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 -std=c++11 -fsyntax-only -verify %s |
Sean Hunt | 7880bc3 | 2011-05-13 01:01:05 +0000 | [diff] [blame] | 2 | |
| 3 | int i = delete; // expected-error{{only functions}} |
| 4 | int j = default; // expected-error{{special member functions}} |
| 5 | |
| 6 | int f() = delete, g; // expected-error{{standalone}} |
| 7 | int o, p() = delete; // expected-error{{standalone}} |
| 8 | |
| 9 | struct foo { |
| 10 | foo() = default; |
| 11 | ~foo() = delete; |
| 12 | void bar() = delete; |
| 13 | }; |
| 14 | |
| 15 | void baz() = delete; |
Richard Smith | c430ef4 | 2011-11-10 09:08:44 +0000 | [diff] [blame^] | 16 | |
| 17 | struct quux { |
| 18 | int quux() = default; // expected-error{{constructor cannot have a return type}} expected-error {{member 'quux' has the same name as its class}} |
| 19 | }; |