public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
From: Jakub Jelinek <jakub@gcc.gnu.org>
To: gcc-cvs@gcc.gnu.org
Subject: [gcc(refs/vendors/redhat/heads/gcc-8-branch)] PR c++/89917 - ICE with lambda in variadic mem-init.
Date: Thu, 17 Sep 2020 16:46:08 +0000 (GMT)	[thread overview]
Message-ID: <20200917164608.9DB61398C036@sourceware.org> (raw)

https://gcc.gnu.org/g:5a359c34bd4de7dcd74881fb9ec897c7bd1ea9c9

commit 5a359c34bd4de7dcd74881fb9ec897c7bd1ea9c9
Author: Jason Merrill <jason@redhat.com>
Date:   Tue Feb 25 13:37:18 2020 -0500

    PR c++/89917 - ICE with lambda in variadic mem-init.
    
    A mem-initializer is not a type, and we don't want to turn autos within it
    into packs.
    
    gcc/cp/ChangeLog
    2020-02-25  Jason Merrill  <jason@redhat.com>
    
            PR c++/89917 - ICE with lambda in variadic mem-init.
            * pt.c (make_pack_expansion): Change type_pack_expansion_p to false.

Diff:
---
 gcc/cp/ChangeLog                                     |  5 +++++
 gcc/cp/pt.c                                          |  2 +-
 gcc/testsuite/g++.dg/cpp0x/lambda/lambda-variadic8.C | 14 ++++++++++++++
 3 files changed, 20 insertions(+), 1 deletion(-)

diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index ffb25f3ab95..a1fee505da6 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,8 @@
+2020-02-25  Jason Merrill  <jason@redhat.com>
+
+	PR c++/89917 - ICE with lambda in variadic mem-init.
+	* pt.c (make_pack_expansion): Change type_pack_expansion_p to false.
+
 2020-02-24  Jason Merrill  <jason@redhat.com>
 
 	PR c++/90951
diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c
index 6dc455ac326..2dc5af44394 100644
--- a/gcc/cp/pt.c
+++ b/gcc/cp/pt.c
@@ -3944,7 +3944,7 @@ make_pack_expansion (tree arg, tsubst_flags_t complain)
          class expansion.  */
       ppd.visited = new hash_set<tree>;
       ppd.parameter_packs = &parameter_packs;
-      ppd.type_pack_expansion_p = true;
+      ppd.type_pack_expansion_p = false;
       gcc_assert (TYPE_P (TREE_PURPOSE (arg)));
       cp_walk_tree (&TREE_PURPOSE (arg), &find_parameter_packs_r, 
                     &ppd, ppd.visited);
diff --git a/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-variadic8.C b/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-variadic8.C
new file mode 100644
index 00000000000..50473f70214
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-variadic8.C
@@ -0,0 +1,14 @@
+// PR c++/89917
+// { dg-do compile { target c++11 } }
+
+struct A 
+{
+  A(...);
+};
+
+template<typename... T> struct B : T...
+{
+  B() : T([]{})... {}
+};
+
+B<A> b;


                 reply	other threads:[~2020-09-17 16:46 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200917164608.9DB61398C036@sourceware.org \
    --to=jakub@gcc.gnu.org \
    --cc=gcc-cvs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).