[clang] Handle __declspec() attributes in using
[llvm-project.git] / clang / test / CXX / class / p6-0x.cpp
blobcf628a6343aecb0080628baaea9f5519e6f544ff
1 // RUN: %clang_cc1 -fsyntax-only -verify %s -std=c++11
2 // expected-no-diagnostics
4 class Trivial { int n; void f(); };
5 class NonTrivial1 { NonTrivial1(const NonTrivial1 &); };
6 class NonTrivial2 { NonTrivial2(NonTrivial2 &&); };
7 class NonTrivial3 { NonTrivial3 operator=(const NonTrivial3 &); };
8 class NonTrivial4 { NonTrivial4 operator=(NonTrivial4 &&); };
9 class NonTrivial5 { ~NonTrivial5(); };
11 static_assert(__is_trivial(Trivial), "Trivial is not trivial");
12 static_assert(!__is_trivial(NonTrivial1), "NonTrivial1 is trivial");
13 static_assert(!__is_trivial(NonTrivial2), "NonTrivial2 is trivial");
14 static_assert(!__is_trivial(NonTrivial3), "NonTrivial3 is trivial");
15 static_assert(!__is_trivial(NonTrivial4), "NonTrivial4 is trivial");
16 static_assert(!__is_trivial(NonTrivial5), "NonTrivial5 is trivial");
18 struct Trivial2 {
19 Trivial2() = default;
20 Trivial2(const Trivial2 &) = default;
21 Trivial2(Trivial2 &&) = default;
22 Trivial2 &operator=(const Trivial2 &) = default;
23 Trivial2 &operator=(Trivial2 &&) = default;
24 ~Trivial2() = default;
27 class NonTrivial6 { ~NonTrivial6(); };
29 NonTrivial6::~NonTrivial6() = default;
31 static_assert(!__is_trivial(NonTrivial6), "NonTrivial6 is trivial");