PR c++/81486 - CTAD failing with ().
authorMarek Polacek <polacek@redhat.com>
Wed, 2 Jan 2019 22:39:16 +0000 (22:39 +0000)
committerMarek Polacek <mpolacek@gcc.gnu.org>
Wed, 2 Jan 2019 22:39:16 +0000 (22:39 +0000)
* g++.dg/cpp1z/class-deduction60.C: New test.
* g++.dg/cpp1z/class-deduction61.C: New test.

From-SVN: r267535

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

index b4cf17811ab46873eebce620858f8c94181515f1..a7e0e1bdf1433d64de86a6a2a8dd73ff06963441 100644 (file)
@@ -6,6 +6,10 @@
        PR c++/88631 - CTAD failing for value-initialization.
        * g++.dg/cpp1z/class-deduction59.C: New test.
 
+       PR c++/81486 - CTAD failing with ().
+       * g++.dg/cpp1z/class-deduction60.C: New test.
+       * g++.dg/cpp1z/class-deduction61.C: New test.
+       
 2019-01-02  Martin Sebor  <msebor@redhat.com>
             Jeff Law  <law@redhat.com>
 
diff --git a/gcc/testsuite/g++.dg/cpp1z/class-deduction60.C b/gcc/testsuite/g++.dg/cpp1z/class-deduction60.C
new file mode 100644 (file)
index 0000000..dbc5732
--- /dev/null
@@ -0,0 +1,19 @@
+// PR c++/81486
+// { dg-do compile { target c++17 } }
+
+template <class T>
+struct C {
+  C(T);
+};
+
+template <>
+struct C<void> { };
+
+C() -> C<void>;
+
+int
+main()
+{
+  auto a = C{};
+  auto b = C();
+}
diff --git a/gcc/testsuite/g++.dg/cpp1z/class-deduction61.C b/gcc/testsuite/g++.dg/cpp1z/class-deduction61.C
new file mode 100644 (file)
index 0000000..9ef095e
--- /dev/null
@@ -0,0 +1,15 @@
+// PR c++/81486
+// { dg-do compile { target c++17 } }
+
+template <typename... Ts>
+struct foo
+{
+  template <typename... Us>
+  foo(Us...) { }
+};
+
+int
+main ()
+{
+  auto f = foo();
+}