[clang] f62433f - [NFC] Add test cases reported in PR54341
Matheus Izvekov via cfe-commits
cfe-commits at lists.llvm.org
Sun Jun 5 11:34:35 PDT 2022
Author: Matheus Izvekov
Date: 2022-06-05T20:34:28+02:00
New Revision: f62433f17c304a8bd8458a60eb32cd86ecf507a4
URL: https://github.com/llvm/llvm-project/commit/f62433f17c304a8bd8458a60eb32cd86ecf507a4
DIFF: https://github.com/llvm/llvm-project/commit/f62433f17c304a8bd8458a60eb32cd86ecf507a4.diff
LOG: [NFC] Add test cases reported in PR54341
Signed-off-by: Matheus Izvekov <mizvekov at gmail.com>
Differential Revision: https://reviews.llvm.org/D127074
Added:
Modified:
clang/test/CXX/class/class.init/class.copy.elision/p3.cpp
Removed:
################################################################################
diff --git a/clang/test/CXX/class/class.init/class.copy.elision/p3.cpp b/clang/test/CXX/class/class.init/class.copy.elision/p3.cpp
index 7055acad6ccf..d7b52c561a54 100644
--- a/clang/test/CXX/class/class.init/class.copy.elision/p3.cpp
+++ b/clang/test/CXX/class/class.init/class.copy.elision/p3.cpp
@@ -96,7 +96,9 @@ void func();
struct A1 {
A1(const A1 &);
- A1(A1 &&) = delete; // expected-note 2{{'A1' has been explicitly marked deleted here}}
+ A1(A1 &&) = delete;
+ // expected-note at -1 2{{'A1' has been explicitly marked deleted here}}
+ // cxx11_2b-note at -2 {{'A1' has been explicitly marked deleted here}}
};
void test1() {
try {
@@ -125,6 +127,22 @@ void test3(A1 a) try {
} catch (...) {
throw a; // expected-error {{call to deleted constructor of 'test_throw_parameter::A1'}}
}
+
+#if __cplusplus >= 201103L
+namespace PR54341 {
+void test4(A1 a) {
+ void f(decltype((throw a, 0)));
+ // expected-warning at -1 {{has no effect}}
+
+ void g(int = decltype(throw a, 0){});
+ // expected-warning at -1 {{has no effect}}
+}
+
+void test5(A1 a, int = decltype(throw a, 0){}) {}
+// expected-error at -1 {{call to deleted constructor of 'test_throw_parameter::A1'}}
+} // namespace PR54341
+#endif
+
} // namespace test_throw_parameter
// During the first overload resolution, the selected function no
More information about the cfe-commits
mailing list