Sean Hunt | 7880bc3 | 2011-05-13 01:01:05 +0000 | [diff] [blame] | 1 | // Without PCH |
Richard Smith | 762bb9d | 2011-10-13 22:29:44 +0000 | [diff] [blame] | 2 | // RUN: %clang_cc1 -std=c++11 -fsyntax-only -verify -include %s %s |
Sean Hunt | 7880bc3 | 2011-05-13 01:01:05 +0000 | [diff] [blame] | 3 | // With PCH |
Richard Smith | 762bb9d | 2011-10-13 22:29:44 +0000 | [diff] [blame] | 4 | // RUN: %clang_cc1 -x c++-header -std=c++11 -emit-pch -o %t %s |
| 5 | // RUN: %clang_cc1 -std=c++11 -fsyntax-only -verify -include-pch %t %s |
Sean Hunt | 7880bc3 | 2011-05-13 01:01:05 +0000 | [diff] [blame] | 6 | |
| 7 | #ifndef PASS1 |
| 8 | #define PASS1 |
| 9 | |
| 10 | struct foo { |
| 11 | foo() = default; |
Jordan Rose | 78541c4 | 2012-07-11 19:58:23 +0000 | [diff] [blame] | 12 | void bar() = delete; |
Sean Hunt | 7880bc3 | 2011-05-13 01:01:05 +0000 | [diff] [blame] | 13 | }; |
| 14 | |
Richard Smith | dfefb84 | 2012-02-25 07:33:38 +0000 | [diff] [blame] | 15 | struct baz { |
Jordan Rose | 78541c4 | 2012-07-11 19:58:23 +0000 | [diff] [blame] | 16 | ~baz() = delete; |
Richard Smith | dfefb84 | 2012-02-25 07:33:38 +0000 | [diff] [blame] | 17 | }; |
| 18 | |
| 19 | class quux { |
Jordan Rose | 78541c4 | 2012-07-11 19:58:23 +0000 | [diff] [blame] | 20 | ~quux() = default; |
Richard Smith | dfefb84 | 2012-02-25 07:33:38 +0000 | [diff] [blame] | 21 | }; |
| 22 | |
Sean Hunt | 7880bc3 | 2011-05-13 01:01:05 +0000 | [diff] [blame] | 23 | #else |
| 24 | |
Sean Hunt | 8271317 | 2011-05-25 23:16:36 +0000 | [diff] [blame] | 25 | foo::foo() { } // expected-error{{definition of explicitly defaulted default constructor}} |
Sean Hunt | 7880bc3 | 2011-05-13 01:01:05 +0000 | [diff] [blame] | 26 | foo f; |
| 27 | void fn() { |
Jordan Rose | 78541c4 | 2012-07-11 19:58:23 +0000 | [diff] [blame] | 28 | f.bar(); // expected-error{{deleted function}} expected-note@12{{deleted here}} |
Sean Hunt | 7880bc3 | 2011-05-13 01:01:05 +0000 | [diff] [blame] | 29 | } |
| 30 | |
Jordan Rose | 78541c4 | 2012-07-11 19:58:23 +0000 | [diff] [blame] | 31 | baz bz; // expected-error{{deleted function}} expected-note@16{{deleted here}} |
| 32 | quux qx; // expected-error{{private destructor}} expected-note@20{{private here}} |
Richard Smith | dfefb84 | 2012-02-25 07:33:38 +0000 | [diff] [blame] | 33 | |
Sean Hunt | 7880bc3 | 2011-05-13 01:01:05 +0000 | [diff] [blame] | 34 | #endif |