diff mbox series

[committed] c++: Add testcase for already fixed PR [PR85493]

Message ID 20220221143117.313118-1-ppalka@redhat.com
State New
Headers show
Series [committed] c++: Add testcase for already fixed PR [PR85493] | expand

Commit Message

Patrick Palka Feb. 21, 2022, 2:31 p.m. UTC
The a1 and a2 case were fixed (by diagnosing the invalid expression)
with r11-434, and the a3 case with r8-7625.

	PR c++/85493

gcc/testsuite/ChangeLog:

	* g++.dg/cpp0x/decltype80.C: New test.
---
 gcc/testsuite/g++.dg/cpp0x/decltype80.C | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)
 create mode 100644 gcc/testsuite/g++.dg/cpp0x/decltype80.C
diff mbox series

Patch

diff --git a/gcc/testsuite/g++.dg/cpp0x/decltype80.C b/gcc/testsuite/g++.dg/cpp0x/decltype80.C
new file mode 100644
index 00000000000..6ad140fe548
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/decltype80.C
@@ -0,0 +1,16 @@ 
+// PR c++/85493
+// { dg-do compile { target c++11 } }
+
+struct no_def {
+  no_def() = delete;
+};
+
+template<class...>
+int foo() = delete;
+
+template<class>
+void test() {
+  decltype(no_def()) a1; // { dg-error "deleted" }
+  decltype(no_def(1,2,3)) a2; // { dg-error "no match" }
+  decltype(foo<>()) a3; // { dg-error "deleted" }
+}