[gcc(refs/users/marxin/heads/marxin-gcc-benchmark-branch)] c++: Add new test [PR88092]

Martin Liska marxin@gcc.gnu.org
Mon Mar 30 10:37:44 GMT 2020


https://gcc.gnu.org/g:11ffae58473472766960b2f6c59108e331a9eba7

commit 11ffae58473472766960b2f6c59108e331a9eba7
Author: Marek Polacek <polacek@redhat.com>
Date:   Wed Jan 29 15:12:46 2020 -0500

    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.

Diff:
---
 gcc/testsuite/ChangeLog                      |  5 +++++
 gcc/testsuite/g++.dg/cpp2a/nontype-class31.C | 19 +++++++++++++++++++
 2 files changed, 24 insertions(+)

diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index b62e7effb59..a8d563b1205 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 00000000000..329b3129e1b
--- /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;
+}


More information about the Gcc-cvs mailing list