]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Revert "c++: pack init-capture of unresolved overload [PR102629]"
authorJason Merrill <jason@redhat.com>
Wed, 25 May 2022 16:55:26 +0000 (12:55 -0400)
committerJason Merrill <jason@redhat.com>
Wed, 25 May 2022 16:58:51 +0000 (12:58 -0400)
PR c++/105722

This reverts commit 93ec7bf22530610ef697fd3a64a28bebd589c790.

gcc/cp/pt.c
gcc/testsuite/g++.dg/cpp2a/lambda-pack-init7.C [deleted file]

index ab41af4aaca29b6b589f4b696c836a3418e0b1a4..0a52f0993abd2adb9a650a19e7c0ec8104da214b 100644 (file)
@@ -12438,13 +12438,7 @@ gen_elem_of_pack_expansion_instantiation (tree pattern,
     t = tsubst_expr (pattern, args, complain, in_decl,
                     /*integral_constant_expression_p=*/false);
   else
-    {
-      t = tsubst (pattern, args, complain, in_decl);
-      if (is_auto (t) && !ith_elem_is_expansion)
-       /* When expanding the fake auto... pack expansion from add_capture, we
-          need to mark that the expansion is no longer a pack.  */
-       TEMPLATE_TYPE_PARAMETER_PACK (t) = false;
-    }
+    t = tsubst (pattern, args, complain, in_decl);
 
   /*  If the Ith argument pack element is a pack expansion, then
       the Ith element resulting from the substituting is going to
diff --git a/gcc/testsuite/g++.dg/cpp2a/lambda-pack-init7.C b/gcc/testsuite/g++.dg/cpp2a/lambda-pack-init7.C
deleted file mode 100644 (file)
index f3c3899..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-// PR c++/102629
-// { dg-do compile { target c++20 } }
-
-template <class T> T&& forward(T&);
-template <class T> T&& forward(T&&);
-
-struct S {};
-
-template <typename... Args>
-void foo(Args&&... args) {
-  [...args = forward<Args> /*(args)*/] { // { dg-error "" }
-    [](auto...) { } (forward<Args>(args)...);
-  };
-}
-
-void bar( ) {
-  foo(S{});
-}