[Flang] remove whole-archive option for AIX linker (#76039)
[llvm-project.git] / clang / test / CXX / special / class.copy / p3-cxx11.cpp
blob8d27f1c2eacb2c28eb862a4f0503e587dd6e22f1
1 // RUN: %clang_cc1 -fcxx-exceptions -fexceptions -std=c++23 -fsyntax-only -verify %s
2 // RUN: %clang_cc1 -fcxx-exceptions -fexceptions -std=c++20 -fsyntax-only -verify %s
3 // RUN: %clang_cc1 -fcxx-exceptions -fexceptions -std=c++11 -fsyntax-only -verify %s
4 class X {
5 X(const X&);
7 public:
8 X();
9 X(X&&);
12 X return_by_move(int i, X x) {
13 X x2;
14 if (i == 0)
15 return x;
16 else if (i == 1)
17 return x2;
18 else
19 return x;
22 void throw_move_only(X x) {
23 X x2;
24 throw x;
25 throw x2;
28 namespace PR10142 {
29 struct X {
30 X();
31 X(X&&);
32 X(const X&) = delete; // expected-note 2{{'X' has been explicitly marked deleted here}}
35 void f(int i) {
36 X x;
37 try {
38 X x2;
39 if (i)
40 throw x2; // okay
41 throw x; // expected-error{{call to deleted constructor of 'X'}}
42 } catch (...) {
46 template<typename T>
47 void f2(int i) {
48 T x;
49 try {
50 T x2;
51 if (i)
52 throw x2; // okay
53 throw x; // expected-error{{call to deleted constructor of 'PR10142::X'}}
54 } catch (...) {
58 template void f2<X>(int); // expected-note{{in instantiation of function template specialization 'PR10142::f2<PR10142::X>' requested here}}