2011-05-13 09:01:05 +08:00
|
|
|
// Without PCH
|
2011-10-14 06:29:44 +08:00
|
|
|
// RUN: %clang_cc1 -std=c++11 -fsyntax-only -verify -include %s %s
|
2011-05-13 09:01:05 +08:00
|
|
|
// With PCH
|
2011-10-14 06:29:44 +08:00
|
|
|
// RUN: %clang_cc1 -x c++-header -std=c++11 -emit-pch -o %t %s
|
|
|
|
// RUN: %clang_cc1 -std=c++11 -fsyntax-only -verify -include-pch %t %s
|
2011-05-13 09:01:05 +08:00
|
|
|
|
|
|
|
#ifndef PASS1
|
|
|
|
#define PASS1
|
|
|
|
|
|
|
|
struct foo {
|
|
|
|
foo() = default;
|
2012-07-12 03:58:23 +08:00
|
|
|
void bar() = delete;
|
2011-05-13 09:01:05 +08:00
|
|
|
};
|
|
|
|
|
2012-02-25 15:33:38 +08:00
|
|
|
struct baz {
|
2012-07-12 03:58:23 +08:00
|
|
|
~baz() = delete;
|
2012-02-25 15:33:38 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
class quux {
|
2012-07-12 03:58:23 +08:00
|
|
|
~quux() = default;
|
2012-02-25 15:33:38 +08:00
|
|
|
};
|
|
|
|
|
2012-12-08 16:32:28 +08:00
|
|
|
struct A {
|
|
|
|
A(const A&) = default;
|
|
|
|
template<typename T> A(T&&);
|
|
|
|
};
|
|
|
|
|
2011-05-13 09:01:05 +08:00
|
|
|
#else
|
|
|
|
|
2011-05-26 07:16:36 +08:00
|
|
|
foo::foo() { } // expected-error{{definition of explicitly defaulted default constructor}}
|
2011-05-13 09:01:05 +08:00
|
|
|
foo f;
|
|
|
|
void fn() {
|
2012-07-12 03:58:23 +08:00
|
|
|
f.bar(); // expected-error{{deleted function}} expected-note@12{{deleted here}}
|
2011-05-13 09:01:05 +08:00
|
|
|
}
|
|
|
|
|
2012-07-12 03:58:23 +08:00
|
|
|
baz bz; // expected-error{{deleted function}} expected-note@16{{deleted here}}
|
|
|
|
quux qx; // expected-error{{private destructor}} expected-note@20{{private here}}
|
2012-02-25 15:33:38 +08:00
|
|
|
|
2012-12-08 16:32:28 +08:00
|
|
|
struct B { A a; };
|
|
|
|
struct C { mutable A a; };
|
|
|
|
static_assert(__is_trivially_constructible(B, const B&), "");
|
|
|
|
static_assert(!__is_trivially_constructible(B, B&&), "");
|
|
|
|
static_assert(!__is_trivially_constructible(C, const C&), "");
|
|
|
|
static_assert(!__is_trivially_constructible(C, C&&), "");
|
|
|
|
|
2011-05-13 09:01:05 +08:00
|
|
|
#endif
|