public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/94546] New: unimplemented: unexpected AST of kind nontype_argument_pack
@ 2020-04-10  7:20 bisqwit at iki dot fi
  2020-04-10 13:32 ` [Bug c++/94546] " mpolacek at gcc dot gnu.org
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: bisqwit at iki dot fi @ 2020-04-10  7:20 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94546

            Bug ID: 94546
           Summary: unimplemented: unexpected AST of kind
                    nontype_argument_pack
           Product: gcc
           Version: 10.0
            Status: UNCONFIRMED
          Keywords: rejects-valid
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: bisqwit at iki dot fi
  Target Milestone: ---

Rejects valid code.

$ g++-10 --version
g++-10 (Debian 10-20200324-1) 10.0.1 20200324 (experimental) [master revision
596c90d3559:023579257f5:906b3eb9df6c577d3f6e9c3ea5c9d7e4d1e90536]

$ g++-10 tmp.cc -std=c++20
tmp.cc: In instantiation of ‘void test(auto:1&&) [with auto:1 =
main()::<lambda(auto:2&& ...)>&]’:
tmp.cc:18:14:   required from here
tmp.cc:8:5: sorry, unimplemented: unexpected AST of kind nontype_argument_pack
    8 |     [&]<class... T>(T&&... rest)
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
    9 |     {
      |     ~
   10 |         plot(std::forward<T>(rest)...);
      |         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   11 |     };
      |     ~
tmp.cc:8: confused by earlier errors, bailing out

#include <utility>
void test(auto&& plot)
{
    // Note: For brevity, this lambda function is only
    // defined, not called nor assigned to a variable.
    // Doing those things won’t fix the error.
    [&]<class... T>(T&&... rest)
    {
        plot(std::forward<T>(rest)...);
    };
}
int main()
{
    auto Plot = [](auto&&...)
    {
    };
    test(Plot);
}

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug c++/94546] unimplemented: unexpected AST of kind nontype_argument_pack
  2020-04-10  7:20 [Bug c++/94546] New: unimplemented: unexpected AST of kind nontype_argument_pack bisqwit at iki dot fi
@ 2020-04-10 13:32 ` mpolacek at gcc dot gnu.org
  2020-04-10 13:50 ` [Bug c++/94546] [10 Regression] " mpolacek at gcc dot gnu.org
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2020-04-10 13:32 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94546

Marek Polacek <mpolacek at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever confirmed|0                           |1
                 CC|                            |mpolacek at gcc dot gnu.org
   Last reconfirmed|                            |2020-04-10

--- Comment #1 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
Confirmed.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug c++/94546] [10 Regression] unimplemented: unexpected AST of kind nontype_argument_pack
  2020-04-10  7:20 [Bug c++/94546] New: unimplemented: unexpected AST of kind nontype_argument_pack bisqwit at iki dot fi
  2020-04-10 13:32 ` [Bug c++/94546] " mpolacek at gcc dot gnu.org
@ 2020-04-10 13:50 ` mpolacek at gcc dot gnu.org
  2020-04-10 21:31 ` jason at gcc dot gnu.org
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2020-04-10 13:50 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94546

Marek Polacek <mpolacek at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|rejects-valid               |ice-on-valid-code
   Target Milestone|---                         |10.0
            Summary|unimplemented: unexpected   |[10 Regression]
                   |AST of kind                 |unimplemented: unexpected
                   |nontype_argument_pack       |AST of kind
                   |                            |nontype_argument_pack
           Priority|P3                          |P1

--- Comment #2 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
Started with r277900.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug c++/94546] [10 Regression] unimplemented: unexpected AST of kind nontype_argument_pack
  2020-04-10  7:20 [Bug c++/94546] New: unimplemented: unexpected AST of kind nontype_argument_pack bisqwit at iki dot fi
  2020-04-10 13:32 ` [Bug c++/94546] " mpolacek at gcc dot gnu.org
  2020-04-10 13:50 ` [Bug c++/94546] [10 Regression] " mpolacek at gcc dot gnu.org
@ 2020-04-10 21:31 ` jason at gcc dot gnu.org
  2020-04-20 13:46 ` rguenth at gcc dot gnu.org
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: jason at gcc dot gnu.org @ 2020-04-10 21:31 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94546

Jason Merrill <jason at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jason at gcc dot gnu.org
           Assignee|unassigned at gcc dot gnu.org      |jason at gcc dot gnu.org
             Status|NEW                         |ASSIGNED

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug c++/94546] [10 Regression] unimplemented: unexpected AST of kind nontype_argument_pack
  2020-04-10  7:20 [Bug c++/94546] New: unimplemented: unexpected AST of kind nontype_argument_pack bisqwit at iki dot fi
                   ` (2 preceding siblings ...)
  2020-04-10 21:31 ` jason at gcc dot gnu.org
@ 2020-04-20 13:46 ` rguenth at gcc dot gnu.org
  2020-04-22  6:28 ` cvs-commit at gcc dot gnu.org
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: rguenth at gcc dot gnu.org @ 2020-04-20 13:46 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94546

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
      Known to work|                            |9.3.0

--- Comment #3 from Richard Biener <rguenth at gcc dot gnu.org> ---
Works with GCC 9.3 with -std=c++2a -fconcepts (w/o -fconcepts it warns)

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug c++/94546] [10 Regression] unimplemented: unexpected AST of kind nontype_argument_pack
  2020-04-10  7:20 [Bug c++/94546] New: unimplemented: unexpected AST of kind nontype_argument_pack bisqwit at iki dot fi
                   ` (3 preceding siblings ...)
  2020-04-20 13:46 ` rguenth at gcc dot gnu.org
@ 2020-04-22  6:28 ` cvs-commit at gcc dot gnu.org
  2020-04-22  6:28 ` jason at gcc dot gnu.org
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2020-04-22  6:28 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94546

--- Comment #4 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Jason Merrill <jason@gcc.gnu.org>:

https://gcc.gnu.org/g:aedd04caa945260ea77fd22f29b77292f7dba72e

commit r10-7865-gaedd04caa945260ea77fd22f29b77292f7dba72e
Author: Jason Merrill <jason@redhat.com>
Date:   Wed Apr 22 02:27:54 2020 -0400

    c++: generic lambda forwarding function [PR94546]

    While instantiating test(Plot) we partially instantiate the generic lambda.
    We look at forward<T>(rest)... and see that it's just replacing parameter
    packs with new parameter packs and tries to do a direct substitution.  But
    because register_parameter_specializations had built up a
    NONTYPE_ARGUMENT_PACK around the new parameter pack, the substitution
    failed.  So let's not wrap it that way.

    gcc/cp/ChangeLog
    2020-04-22  Jason Merrill  <jason@redhat.com>

            PR c++/94546
            * pt.c (register_parameter_specializations): If the instantiation
is
            still a parameter pack, don't wrap it in a NONTYPE_ARGUMENT_PACK.
            (tsubst_pack_expansion, tsubst_expr): Adjust.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug c++/94546] [10 Regression] unimplemented: unexpected AST of kind nontype_argument_pack
  2020-04-10  7:20 [Bug c++/94546] New: unimplemented: unexpected AST of kind nontype_argument_pack bisqwit at iki dot fi
                   ` (4 preceding siblings ...)
  2020-04-22  6:28 ` cvs-commit at gcc dot gnu.org
@ 2020-04-22  6:28 ` jason at gcc dot gnu.org
  2021-02-12  2:47 ` cvs-commit at gcc dot gnu.org
  2021-02-27 20:43 ` cvs-commit at gcc dot gnu.org
  7 siblings, 0 replies; 9+ messages in thread
From: jason at gcc dot gnu.org @ 2020-04-22  6:28 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94546

Jason Merrill <jason at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|---                         |FIXED

--- Comment #5 from Jason Merrill <jason at gcc dot gnu.org> ---
Fixed

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug c++/94546] [10 Regression] unimplemented: unexpected AST of kind nontype_argument_pack
  2020-04-10  7:20 [Bug c++/94546] New: unimplemented: unexpected AST of kind nontype_argument_pack bisqwit at iki dot fi
                   ` (5 preceding siblings ...)
  2020-04-22  6:28 ` jason at gcc dot gnu.org
@ 2021-02-12  2:47 ` cvs-commit at gcc dot gnu.org
  2021-02-27 20:43 ` cvs-commit at gcc dot gnu.org
  7 siblings, 0 replies; 9+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-02-12  2:47 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94546

--- Comment #6 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Jason Merrill <jason@gcc.gnu.org>:

https://gcc.gnu.org/g:ac001ddd0cb635dec0145bf577ac796894bda398

commit r11-7204-gac001ddd0cb635dec0145bf577ac796894bda398
Author: Jason Merrill <jason@redhat.com>
Date:   Thu Feb 11 19:45:22 2021 -0500

    c++: variadic lambda template and empty pack [PR97246]

    In get<0>, Is is empty, so the first parameter pack of the lambda is empty,
    but after the fix for PR94546 we were wrongly associating it with the
    partial instantiation of 'v'.

    gcc/cp/ChangeLog:

            PR c++/97246
            PR c++/94546
            * pt.c (extract_fnparm_pack): Check DECL_PACK_P here.
            (register_parameter_specializations): Not here.

    gcc/testsuite/ChangeLog:

            PR c++/97246
            * g++.dg/cpp2a/lambda-generic-variadic21.C: New test.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug c++/94546] [10 Regression] unimplemented: unexpected AST of kind nontype_argument_pack
  2020-04-10  7:20 [Bug c++/94546] New: unimplemented: unexpected AST of kind nontype_argument_pack bisqwit at iki dot fi
                   ` (6 preceding siblings ...)
  2021-02-12  2:47 ` cvs-commit at gcc dot gnu.org
@ 2021-02-27 20:43 ` cvs-commit at gcc dot gnu.org
  7 siblings, 0 replies; 9+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-02-27 20:43 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94546

--- Comment #7 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-10 branch has been updated by Jason Merrill
<jason@gcc.gnu.org>:

https://gcc.gnu.org/g:f98a3c8a58b3cb39d4073e8a5b2671a5d68b8ce4

commit r10-9393-gf98a3c8a58b3cb39d4073e8a5b2671a5d68b8ce4
Author: Jason Merrill <jason@redhat.com>
Date:   Thu Feb 11 19:45:22 2021 -0500

    c++: variadic lambda template and empty pack [PR97246]

    In get<0>, Is is empty, so the first parameter pack of the lambda is empty,
    but after the fix for PR94546 we were wrongly associating it with the
    partial instantiation of 'v'.

    gcc/cp/ChangeLog:

            PR c++/97246
            PR c++/94546
            * pt.c (extract_fnparm_pack): Check DECL_PACK_P here.
            (register_parameter_specializations): Not here.

    gcc/testsuite/ChangeLog:

            PR c++/97246
            * g++.dg/cpp2a/lambda-generic-variadic21.C: New test.

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2021-02-27 20:43 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-10  7:20 [Bug c++/94546] New: unimplemented: unexpected AST of kind nontype_argument_pack bisqwit at iki dot fi
2020-04-10 13:32 ` [Bug c++/94546] " mpolacek at gcc dot gnu.org
2020-04-10 13:50 ` [Bug c++/94546] [10 Regression] " mpolacek at gcc dot gnu.org
2020-04-10 21:31 ` jason at gcc dot gnu.org
2020-04-20 13:46 ` rguenth at gcc dot gnu.org
2020-04-22  6:28 ` cvs-commit at gcc dot gnu.org
2020-04-22  6:28 ` jason at gcc dot gnu.org
2021-02-12  2:47 ` cvs-commit at gcc dot gnu.org
2021-02-27 20:43 ` cvs-commit at gcc dot gnu.org

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).