blob: f2b7e903625227e826c120ccb5262f86f85c1571 [file] [log] [blame]
Sean Hunt156b6402011-05-04 01:19:08 +00001// Test this without pch.
Richard Smith762bb9d2011-10-13 22:29:44 +00002// RUN: %clang_cc1 -include %s -std=c++11 -fsyntax-only -verify %s
Sean Hunt156b6402011-05-04 01:19:08 +00003
4// Test with pch.
Richard Smith762bb9d2011-10-13 22:29:44 +00005// 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
Sean Hunt156b6402011-05-04 01:19:08 +00007
Sean Huntebcbe1d2011-05-04 23:29:54 +00008#ifndef PASS1
9#define PASS1
10struct 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
Sean Huntfe57eef2011-05-04 05:57:24 +000018foo::foo() : foo(1) { } // expected-error{{creates a delegation cycle}} \
19 // expected-note{{which delegates to}}
Sean Huntebcbe1d2011-05-04 23:29:54 +000020#endif