Argyrios Kyrtzidis | 8e50297 | 2012-10-10 16:14:06 +0000 | [diff] [blame^] | 1 | // RUN: %clang_cc1 -std=c++11 -verify %s |
| 2 | |
| 3 | // rdar://12240916 stack overflow. |
| 4 | namespace rdar12240916 { |
| 5 | |
| 6 | struct S2 { |
| 7 | S2(const S2&); |
| 8 | S2(); |
| 9 | }; |
| 10 | |
| 11 | struct S { // expected-note {{not complete}} |
| 12 | S x; // expected-error {{incomplete type}} |
| 13 | S2 y; |
| 14 | }; |
| 15 | |
| 16 | S foo() { |
| 17 | S s; |
| 18 | return s; |
| 19 | } |
| 20 | |
| 21 | struct S3; // expected-note {{forward declaration}} |
| 22 | |
| 23 | struct S4 { |
| 24 | S3 x; // expected-error {{incomplete type}} |
| 25 | S2 y; |
| 26 | }; |
| 27 | |
| 28 | struct S3 { |
| 29 | S4 x; |
| 30 | S2 y; |
| 31 | }; |
| 32 | |
| 33 | S4 foo2() { |
| 34 | S4 s; |
| 35 | return s; |
| 36 | } |
| 37 | |
| 38 | } |