c++: Add new test [PR88092]
authorMarek Polacek <polacek@redhat.com>
Wed, 29 Jan 2020 20:12:46 +0000 (15:12 -0500)
committerMarek Polacek <polacek@redhat.com>
Wed, 29 Jan 2020 20:19:38 +0000 (15:19 -0500)
This test got fixed by r10-1976-gdaaa6fcc70ffe66bd56f5819ad4ee78fecd54bb6
so let's add it to the testsuite.

PR c++/88092
* g++.dg/cpp2a/nontype-class31.C: New test.

gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/cpp2a/nontype-class31.C [new file with mode: 0644]

index b62e7effb595ed5de35c5836143fe961f931b42e..a8d563b1205c8e93dbf168d7f1e98f23d75d28a2 100644 (file)
@@ -1,3 +1,8 @@
+2020-01-29  Marek Polacek  <polacek@redhat.com>
+
+       PR c++/88092
+       * g++.dg/cpp2a/nontype-class31.C: New test.
+
 2020-01-29  Jeff Law  <law@redhat.com
 
        PR tree-optimization/89689
diff --git a/gcc/testsuite/g++.dg/cpp2a/nontype-class31.C b/gcc/testsuite/g++.dg/cpp2a/nontype-class31.C
new file mode 100644 (file)
index 0000000..329b312
--- /dev/null
@@ -0,0 +1,19 @@
+// PR c++/88092
+// { dg-do compile { target c++2a } }
+
+template<typename T>
+struct S {
+ constexpr S(...) { }
+};
+
+template <typename T> S(T) -> S<T>;
+
+template <S s> struct foo { };
+
+template <S s>
+void fn ()
+{
+  auto t = s;
+  foo<t> f1;
+  foo<s> f2;
+}