1// Without PCH
2// RUN: %clang_cc1 -std=c++11 -fsyntax-only -verify -include %s %s
3// With PCH
4// RUN: %clang_cc1 -x c++-header -std=c++11 -emit-pch -o %t %s
5// RUN: %clang_cc1 -std=c++11 -fsyntax-only -verify -include-pch %t %s
6
7#ifndef PASS1
8#define PASS1
9
10struct foo {
11  foo() = default;
12  void bar() = delete;
13};
14
15struct baz {
16  ~baz() = delete;
17};
18
19class quux {
20  ~quux() = default;
21};
22
23struct A {
24  A(const A&) = default;
25  template<typename T> A(T&&);
26};
27
28#else
29
30foo::foo() { } // expected-error{{definition of explicitly defaulted default constructor}}
31foo f;
32void fn() {
33  f.bar(); // expected-error{{deleted function}} expected-note@12{{deleted here}}
34}
35
36baz bz; // expected-error{{deleted function}} expected-note@16{{deleted here}}
37quux qx; // expected-error{{private destructor}} expected-note@20{{private here}}
38
39struct B { A a; };
40struct C { mutable A a; };
41static_assert(__is_trivially_constructible(B, const B&), "");
42static_assert(!__is_trivially_constructible(B, B&&), "");
43static_assert(!__is_trivially_constructible(C, const C&), "");
44static_assert(!__is_trivially_constructible(C, C&&), "");
45
46#endif
47