2011-06-12 15:46:16 +00:00
|
|
|
// Without PCH
|
2011-10-20 21:14:49 +00:00
|
|
|
// RUN: %clang_cc1 -std=c++11 -fsyntax-only -verify -include %s %s
|
2011-06-12 15:46:16 +00:00
|
|
|
// With PCH
|
2011-10-20 21:14:49 +00: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-06-12 15:46:16 +00:00
|
|
|
|
|
|
|
#ifndef PASS1
|
|
|
|
#define PASS1
|
|
|
|
|
|
|
|
struct foo {
|
|
|
|
foo() = default;
|
2012-08-15 20:02:54 +00:00
|
|
|
void bar() = delete;
|
2011-06-12 15:46:16 +00:00
|
|
|
};
|
|
|
|
|
2012-04-14 14:01:31 +00:00
|
|
|
struct baz {
|
2012-08-15 20:02:54 +00:00
|
|
|
~baz() = delete;
|
2012-04-14 14:01:31 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
class quux {
|
2012-08-15 20:02:54 +00:00
|
|
|
~quux() = default;
|
2012-04-14 14:01:31 +00:00
|
|
|
};
|
|
|
|
|
2013-04-08 18:45:10 +00:00
|
|
|
struct A {
|
|
|
|
A(const A&) = default;
|
|
|
|
template<typename T> A(T&&);
|
|
|
|
};
|
|
|
|
|
2011-06-12 15:46:16 +00:00
|
|
|
#else
|
|
|
|
|
|
|
|
foo::foo() { } // expected-error{{definition of explicitly defaulted default constructor}}
|
|
|
|
foo f;
|
|
|
|
void fn() {
|
2012-08-15 20:02:54 +00:00
|
|
|
f.bar(); // expected-error{{deleted function}} expected-note@12{{deleted here}}
|
2011-06-12 15:46:16 +00:00
|
|
|
}
|
|
|
|
|
2012-08-15 20:02:54 +00:00
|
|
|
baz bz; // expected-error{{deleted function}} expected-note@16{{deleted here}}
|
|
|
|
quux qx; // expected-error{{private destructor}} expected-note@20{{private here}}
|
2012-04-14 14:01:31 +00:00
|
|
|
|
2013-04-08 18:45:10 +00: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-06-12 15:46:16 +00:00
|
|
|
#endif
|