Skip to content

Commit f62433f

Browse files
committed
[NFC] Add test cases reported in PR54341
Signed-off-by: Matheus Izvekov <mizvekov@gmail.com> Differential Revision: https://reviews.llvm.org/D127074
1 parent 501d5b2 commit f62433f

File tree

1 file changed

+19
-1
lines changed
  • clang/test/CXX/class/class.init/class.copy.elision

1 file changed

+19
-1
lines changed

clang/test/CXX/class/class.init/class.copy.elision/p3.cpp

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,9 @@ void func();
9696

9797
struct A1 {
9898
A1(const A1 &);
99-
A1(A1 &&) = delete; // expected-note 2{{'A1' has been explicitly marked deleted here}}
99+
A1(A1 &&) = delete;
100+
// expected-note@-1 2{{'A1' has been explicitly marked deleted here}}
101+
// cxx11_2b-note@-2 {{'A1' has been explicitly marked deleted here}}
100102
};
101103
void test1() {
102104
try {
@@ -125,6 +127,22 @@ void test3(A1 a) try {
125127
} catch (...) {
126128
throw a; // expected-error {{call to deleted constructor of 'test_throw_parameter::A1'}}
127129
}
130+
131+
#if __cplusplus >= 201103L
132+
namespace PR54341 {
133+
void test4(A1 a) {
134+
void f(decltype((throw a, 0)));
135+
// expected-warning@-1 {{has no effect}}
136+
137+
void g(int = decltype(throw a, 0){});
138+
// expected-warning@-1 {{has no effect}}
139+
}
140+
141+
void test5(A1 a, int = decltype(throw a, 0){}) {}
142+
// expected-error@-1 {{call to deleted constructor of 'test_throw_parameter::A1'}}
143+
} // namespace PR54341
144+
#endif
145+
128146
} // namespace test_throw_parameter
129147

130148
// During the first overload resolution, the selected function no

0 commit comments

Comments
 (0)