1// Test this without pch.
2// RUN: %clang_cc1 -x c++ -std=c++11 -DHEADER -DSOURCE -fsyntax-only -emit-llvm -o - %s
3
4// Test with pch.
5// RUN: %clang_cc1 -x c++ -std=c++11 -DHEADER -emit-pch -o %t %s
6// RUN: %clang_cc1 -x c++ -std=c++11 -DHEADER -include-pch %t -fsyntax-only -emit-llvm -o - %s
7
8#ifdef HEADER
9int n;
10struct S {
11  int *p = &m;
12  int &m = n;
13  S *that = this;
14};
15template<typename T> struct X { T t {0}; };
16
17struct v_t { };
18
19struct m_t
20{
21    struct { v_t v; };
22    m_t() { }
23};
24
25#endif
26
27#ifdef SOURCE
28S s;
29
30struct E { explicit E(int); };
31X<E> x;
32
33m_t *test() {
34  return new m_t;
35}
36
37#elif HEADER
38#undef HEADER
39#define SOURCE
40#endif
41