From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2122) id C9A203857BBB; Wed, 25 May 2022 16:59:18 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C9A203857BBB MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" From: Jason Merrill To: gcc-cvs@gcc.gnu.org Subject: [gcc r10-10759] Revert "c++: pack init-capture of unresolved overload [PR102629]" X-Act-Checkin: gcc X-Git-Author: Jason Merrill X-Git-Refname: refs/heads/releases/gcc-10 X-Git-Oldrev: b322569f35f8ae938fc5fd0988ff6072a1074620 X-Git-Newrev: bea4429004b02b834c6a15dcc3bfbd953b230585 Message-Id: <20220525165918.C9A203857BBB@sourceware.org> Date: Wed, 25 May 2022 16:59:18 +0000 (GMT) X-BeenThere: gcc-cvs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 May 2022 16:59:18 -0000 https://gcc.gnu.org/g:bea4429004b02b834c6a15dcc3bfbd953b230585 commit r10-10759-gbea4429004b02b834c6a15dcc3bfbd953b230585 Author: Jason Merrill Date: Wed May 25 12:55:26 2022 -0400 Revert "c++: pack init-capture of unresolved overload [PR102629]" PR c++/105722 This reverts commit 93ec7bf22530610ef697fd3a64a28bebd589c790. Diff: --- gcc/cp/pt.c | 8 +------- gcc/testsuite/g++.dg/cpp2a/lambda-pack-init7.C | 18 ------------------ 2 files changed, 1 insertion(+), 25 deletions(-) diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c index ab41af4aaca..0a52f0993ab 100644 --- a/gcc/cp/pt.c +++ b/gcc/cp/pt.c @@ -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 index f3c3899e97a..00000000000 --- a/gcc/testsuite/g++.dg/cpp2a/lambda-pack-init7.C +++ /dev/null @@ -1,18 +0,0 @@ -// PR c++/102629 -// { dg-do compile { target c++20 } } - -template T&& forward(T&); -template T&& forward(T&&); - -struct S {}; - -template -void foo(Args&&... args) { - [...args = forward /*(args)*/] { // { dg-error "" } - [](auto...) { } (forward(args)...); - }; -} - -void bar( ) { - foo(S{}); -}