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