re PR c++/82231 (ICE when deducing non-type template parameter value whose type depen...
authorMarek Polacek <polacek@redhat.com>
Tue, 19 Dec 2017 20:44:19 +0000 (20:44 +0000)
committerMarek Polacek <mpolacek@gcc.gnu.org>
Tue, 19 Dec 2017 20:44:19 +0000 (20:44 +0000)
PR c++/82231
* g++.dg/cpp1z/nontype-auto14.C: New test.

From-SVN: r255839

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

index b32cb7a09faf250bf58a6fa2a8110e92dc493db9..a87d64e9dd11da53be933400a5b70a2acd08c965 100644 (file)
@@ -1,3 +1,8 @@
+2017-12-19  Marek Polacek  <polacek@redhat.com>
+
+       PR c++/82231
+       * g++.dg/cpp1z/nontype-auto14.C: New test.
+
 2017-12-18  Jeff Law  <law@redhat.com>
 
        PR tree-optimization/83477
diff --git a/gcc/testsuite/g++.dg/cpp1z/nontype-auto14.C b/gcc/testsuite/g++.dg/cpp1z/nontype-auto14.C
new file mode 100644 (file)
index 0000000..d7ab133
--- /dev/null
@@ -0,0 +1,14 @@
+// PR c++/82231
+// { dg-options -std=c++17 }
+
+template<int>
+struct x {};
+
+template <auto I, decltype(I) X>
+void f(x<X>) { }
+
+int
+main()
+{
+  f<0>(x<1>{});
+}