re PR c++/82308 ([C++17] deduction of template arguments results in internal compiler...
authorPaolo Carlini <paolo@gcc.gnu.org>
Fri, 20 Oct 2017 00:30:41 +0000 (00:30 +0000)
committerPaolo Carlini <paolo@gcc.gnu.org>
Fri, 20 Oct 2017 00:30:41 +0000 (00:30 +0000)
2017-10-19  Paolo Carlini  <paolo.carlini@oracle.com>

PR c++/82308
* g++.dg/cpp1z/class-deduction45.C: New.

From-SVN: r253920

gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/cpp1z/class-deduction45.C [new file with mode: 0644]

index 8ef91aadc878b76a157aab9db4a49224d5661e11..4aab328fae3fd68ec9cfad6a017801c4250e8a70 100644 (file)
@@ -1,4 +1,9 @@
-2017-10-18  Uros Bizjak  <ubizjak@gmail.com>
+2017-10-19  Paolo Carlini  <paolo.carlini@oracle.com>
+
+       PR c++/82308
+       * g++.dg/cpp1z/class-deduction45.C: New.
+
+2017-10-19  Uros Bizjak  <ubizjak@gmail.com>
            Jakub Jelinek  <jakub@redhat.com>
 
        PR target/82618
diff --git a/gcc/testsuite/g++.dg/cpp1z/class-deduction45.C b/gcc/testsuite/g++.dg/cpp1z/class-deduction45.C
new file mode 100644 (file)
index 0000000..3fe8dd3
--- /dev/null
@@ -0,0 +1,24 @@
+// PR c++/82308
+// { dg-options -std=c++17 }
+
+template<typename, unsigned>
+struct array {};
+
+template <unsigned R>
+class X {
+public:
+  using T = array<int, R>;
+
+  enum class C : char { A, B };
+  X(T bounds, C c = C::B) : t(bounds) {}
+
+private:
+  T t;
+};
+
+int main()
+{
+  array<int, 2> a;
+  X    d{a};
+  X<2> e{a};
+}