blob: bf5daefa55899b4ed159547552cadc519f375ec6 [file] [log] [blame]
Alexis Hunt37a477f2011-05-04 01:19:08 +00001// Test this without pch.
Richard Smith9ca5c422011-10-13 22:29:44 +00002// RUN: %clang_cc1 -include %s -std=c++11 -fsyntax-only -verify %s
Alexis Hunt37a477f2011-05-04 01:19:08 +00003
4// Test with pch.
Richard Smith9ca5c422011-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
Alexis Hunt37a477f2011-05-04 01:19:08 +00007
Alexis Hunt27a761d2011-05-04 23:29:54 +00008#ifndef PASS1
9#define PASS1
10struct foo {
Jordan Roseb13eb8d2012-07-11 19:58:23 +000011 foo(int) : foo() { }
Alexis Hunt27a761d2011-05-04 23:29:54 +000012 foo();
Jordan Roseb13eb8d2012-07-11 19:58:23 +000013 foo(bool) : foo('c') { }
14 foo(char) : foo(true) { }
Alexis Hunt27a761d2011-05-04 23:29:54 +000015};
16#else
Alexis Hunt6118d662011-05-04 05:57:24 +000017foo::foo() : foo(1) { } // expected-error{{creates a delegation cycle}} \
18 // expected-note{{which delegates to}}
Jordan Roseb13eb8d2012-07-11 19:58:23 +000019
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 Hunt27a761d2011-05-04 23:29:54 +000024#endif