Alexis Hunt | 37a477f | 2011-05-04 01:19:08 +0000 | [diff] [blame] | 1 | // Test this without pch. |
Alexis Hunt | 27a761d | 2011-05-04 23:29:54 +0000 | [diff] [blame^] | 2 | // RUN: %clang_cc1 -include %s -std=c++0x -fsyntax-only -verify %s |
Alexis Hunt | 37a477f | 2011-05-04 01:19:08 +0000 | [diff] [blame] | 3 | |
| 4 | // Test with pch. |
Alexis Hunt | 27a761d | 2011-05-04 23:29:54 +0000 | [diff] [blame^] | 5 | // RUN: %clang_cc1 -x c++-header -std=c++0x -emit-pch -o %t %s |
Alexis Hunt | 37a477f | 2011-05-04 01:19:08 +0000 | [diff] [blame] | 6 | // RUN: %clang_cc1 -std=c++0x -include-pch %t -fsyntax-only -verify %s |
| 7 | |
Alexis Hunt | 27a761d | 2011-05-04 23:29:54 +0000 | [diff] [blame^] | 8 | #ifndef PASS1 |
| 9 | #define PASS1 |
| 10 | struct foo { |
| 11 | foo(int) : foo() { } // expected-note{{it delegates to}} |
| 12 | foo(); |
| 13 | foo(bool) : foo('c') { } // expected-note{{it delegates to}} |
| 14 | foo(char) : foo(true) { } // expected-error{{creates a delegation cycle}} \ |
| 15 | // expected-note{{which delegates to}} |
| 16 | }; |
| 17 | #else |
Alexis Hunt | 6118d66 | 2011-05-04 05:57:24 +0000 | [diff] [blame] | 18 | foo::foo() : foo(1) { } // expected-error{{creates a delegation cycle}} \ |
| 19 | // expected-note{{which delegates to}} |
Alexis Hunt | 27a761d | 2011-05-04 23:29:54 +0000 | [diff] [blame^] | 20 | #endif |