[clang] Implement lifetime analysis for lifetime_capture_by(X) (#115921)
[llvm-project.git] / clang / test / PCH / cxx0x-delegating-ctors.cpp
blobbf5daefa55899b4ed159547552cadc519f375ec6
1 // Test this without pch.
2 // RUN: %clang_cc1 -include %s -std=c++11 -fsyntax-only -verify %s
4 // Test with pch.
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
8 #ifndef PASS1
9 #define PASS1
10 struct foo {
11 foo(int) : foo() { }
12 foo();
13 foo(bool) : foo('c') { }
14 foo(char) : foo(true) { }
16 #else
17 foo::foo() : foo(1) { } // expected-error{{creates a delegation cycle}} \
18 // expected-note{{which delegates to}}
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}}
24 #endif