aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorMarek Polacek <polacek@redhat.com>2020-01-29 15:12:46 -0500
committerMarek Polacek <polacek@redhat.com>2020-01-29 15:19:38 -0500
commit11ffae58473472766960b2f6c59108e331a9eba7 (patch)
treeb76f08daa9aaa967b2726b29db7a7142d5b1ee2d /gcc
parent0de349f108d963219bd59aa374a68c15355236be (diff)
downloadgcc-11ffae58473472766960b2f6c59108e331a9eba7.zip
gcc-11ffae58473472766960b2f6c59108e331a9eba7.tar.gz
gcc-11ffae58473472766960b2f6c59108e331a9eba7.tar.bz2
c++: Add new test [PR88092]
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.
Diffstat (limited to 'gcc')
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/nontype-class31.C19
2 files changed, 24 insertions, 0 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index b62e7ef..a8d563b 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -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
index 0000000..329b312
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp2a/nontype-class31.C
@@ -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;
+}