We correctly accept this testcase since r11-1571.

Tested x86_64-pc-linux-gnu, applying to trunk.

gcc/testsuite/ChangeLog:

        PR c++/94102
        * g++.dg/cpp1z/class-deduction87.C: New test.
---
 gcc/testsuite/g++.dg/cpp1z/class-deduction87.C | 15 +++++++++++++++
 1 file changed, 15 insertions(+)
 create mode 100644 gcc/testsuite/g++.dg/cpp1z/class-deduction87.C

diff --git a/gcc/testsuite/g++.dg/cpp1z/class-deduction87.C 
b/gcc/testsuite/g++.dg/cpp1z/class-deduction87.C
new file mode 100644
index 00000000000..37296a435c4
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp1z/class-deduction87.C
@@ -0,0 +1,15 @@
+// PR c++/94102
+// { dg-do compile { target c++17 } }
+
+namespace std {
+  template <typename _Tp> using decay_t = _Tp;
+}
+template <typename... B> struct Merged : B... {
+  template <typename... T> Merged(T... t) : B(t)... {}
+};
+template <typename... T> Merged(T...) -> Merged<std::decay_t<T>...>;
+int main() {
+  auto l1 = [] {};
+  auto l2 = [](int i) { return i; };
+  Merged(l1, l2);
+}

base-commit: fb9f5e1028df0fe6f2ff9d220efd75970e46bff0
-- 
2.31.1

Reply via email to