[TableGen] Fix validateOperandClass for non Phyical Reg (#118146)
[llvm-project.git] / clang / test / CXX / special / class.copy / p15-0x.cpp
blob9d03a55423db5e82897e63d7820941ce80ea5d55
1 // RUN: %clang_cc1 -fsyntax-only -std=c++11 -verify %s
2 // expected-no-diagnostics
4 namespace PR10622 {
5 struct foo {
6 const int first;
7 foo(const foo&) = default;
8 };
9 void find_or_insert(const foo& __obj) {
10 foo x(__obj);
13 struct bar : foo {
14 bar(const bar&) = default;
16 void test_bar(const bar &obj) {
17 bar obj2(obj);
21 namespace PR11418 {
22 template<typename T>
23 T may_throw() {
24 return T();
27 template<typename T> T &&declval() noexcept;
29 struct NonPOD {
30 NonPOD();
31 NonPOD(const NonPOD &) noexcept;
32 NonPOD(NonPOD &&) noexcept;
35 struct X {
36 NonPOD np = may_throw<NonPOD>();
39 static_assert(noexcept(declval<X>()), "noexcept isn't working at all");
40 static_assert(noexcept(X(declval<X&>())), "copy constructor can't throw");
41 static_assert(noexcept(X(declval<X>())), "move constructor can't throw");