public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/94483] New: [10 Regression] ICE: tree check: expected type_pack_expansion, have error_mark in add_capture, at cp/lambda.c:607
@ 2020-04-04  6:46 asolokha at gmx dot com
  2020-04-04  9:45 ` [Bug c++/94483] [9/10 " marxin at gcc dot gnu.org
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: asolokha at gmx dot com @ 2020-04-04  6:46 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 94483
           Summary: [10 Regression] ICE: tree check: expected
                    type_pack_expansion, have error_mark in add_capture,
                    at cp/lambda.c:607
           Product: gcc
           Version: 10.0
            Status: UNCONFIRMED
          Keywords: error-recovery, ice-on-invalid-code
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: asolokha at gmx dot com
  Target Milestone: ---

g++-10.0.1-alpha20200329 snapshot (g:60c254b279e8e8443b8ad26cc46b9e4084cff66c)
ICEs when compiling the following testcase, extracted from
test/CXX/temp/temp.decls/temp.variadic/init-capture.cpp from the clang 10.0.0
test suite, w/ -std=c++2a:

template<int ...a> constexpr auto x = [...z = a] (auto F) { return F(z...); };

% g++-10.0.1 -std=c++2a -c elqdcpvu.cpp
elqdcpvu.cpp:1:47: error: expansion pattern 'int' contains no parameter packs
    1 | template<int ...a> constexpr auto x = [...z = a] (auto F) { return
F(z...); };
      |                                               ^
elqdcpvu.cpp:1:47: internal compiler error: tree check: expected
type_pack_expansion, have error_mark in add_capture, at cp/lambda.c:607
0x7bb258 tree_check_failed(tree_node const*, char const*, int, char const*,
...)
       
/var/tmp/portage/sys-devel/gcc-10.0.1_alpha20200329/work/gcc-10-20200329/gcc/tree.c:9737
0x62bdea tree_check(tree_node*, char const*, int, char const*, tree_code)
       
/var/tmp/portage/sys-devel/gcc-10.0.1_alpha20200329/work/gcc-10-20200329/gcc/tree.h:3278
0x62bdea add_capture(tree_node*, tree_node*, tree_node*, bool, bool)
       
/var/tmp/portage/sys-devel/gcc-10.0.1_alpha20200329/work/gcc-10-20200329/gcc/cp/lambda.c:607
0x99dad1 cp_parser_lambda_introducer
       
/var/tmp/portage/sys-devel/gcc-10.0.1_alpha20200329/work/gcc-10-20200329/gcc/cp/parser.c:10928
0x99dad1 cp_parser_lambda_expression
       
/var/tmp/portage/sys-devel/gcc-10.0.1_alpha20200329/work/gcc-10-20200329/gcc/cp/parser.c:10530
0x99dad1 cp_parser_primary_expression
       
/var/tmp/portage/sys-devel/gcc-10.0.1_alpha20200329/work/gcc-10-20200329/gcc/cp/parser.c:5413
0x9a8487 cp_parser_postfix_expression
       
/var/tmp/portage/sys-devel/gcc-10.0.1_alpha20200329/work/gcc-10-20200329/gcc/cp/parser.c:7257
0x98a669 cp_parser_binary_expression
       
/var/tmp/portage/sys-devel/gcc-10.0.1_alpha20200329/work/gcc-10-20200329/gcc/cp/parser.c:9554
0x98c31e cp_parser_assignment_expression
       
/var/tmp/portage/sys-devel/gcc-10.0.1_alpha20200329/work/gcc-10-20200329/gcc/cp/parser.c:9859
0x98b005 cp_parser_constant_expression
       
/var/tmp/portage/sys-devel/gcc-10.0.1_alpha20200329/work/gcc-10-20200329/gcc/cp/parser.c:10153
0x98b7a1 cp_parser_initializer_clause
       
/var/tmp/portage/sys-devel/gcc-10.0.1_alpha20200329/work/gcc-10-20200329/gcc/cp/parser.c:23218
0x98fe5f cp_parser_initializer
       
/var/tmp/portage/sys-devel/gcc-10.0.1_alpha20200329/work/gcc-10-20200329/gcc/cp/parser.c:23156
0x9b8943 cp_parser_init_declarator
       
/var/tmp/portage/sys-devel/gcc-10.0.1_alpha20200329/work/gcc-10-20200329/gcc/cp/parser.c:20850
0x9bf954 cp_parser_single_declaration
       
/var/tmp/portage/sys-devel/gcc-10.0.1_alpha20200329/work/gcc-10-20200329/gcc/cp/parser.c:29479
0x9bfadc cp_parser_template_declaration_after_parameters
       
/var/tmp/portage/sys-devel/gcc-10.0.1_alpha20200329/work/gcc-10-20200329/gcc/cp/parser.c:29051
0x9c0240 cp_parser_explicit_template_declaration
       
/var/tmp/portage/sys-devel/gcc-10.0.1_alpha20200329/work/gcc-10-20200329/gcc/cp/parser.c:29317
0x9c3459 cp_parser_declaration
       
/var/tmp/portage/sys-devel/gcc-10.0.1_alpha20200329/work/gcc-10-20200329/gcc/cp/parser.c:13379
0x9c3a9f cp_parser_translation_unit
       
/var/tmp/portage/sys-devel/gcc-10.0.1_alpha20200329/work/gcc-10-20200329/gcc/cp/parser.c:4731
0x9c3a9f c_parse_file()
       
/var/tmp/portage/sys-devel/gcc-10.0.1_alpha20200329/work/gcc-10-20200329/gcc/cp/parser.c:43944
0xadbadb c_common_parse_file()
       
/var/tmp/portage/sys-devel/gcc-10.0.1_alpha20200329/work/gcc-10-20200329/gcc/c-family/c-opts.c:1186

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

* [Bug c++/94483] [9/10 Regression] ICE: tree check: expected type_pack_expansion, have error_mark in add_capture, at cp/lambda.c:607
  2020-04-04  6:46 [Bug c++/94483] New: [10 Regression] ICE: tree check: expected type_pack_expansion, have error_mark in add_capture, at cp/lambda.c:607 asolokha at gmx dot com
@ 2020-04-04  9:45 ` marxin at gcc dot gnu.org
  2020-04-06  7:24 ` rguenth at gcc dot gnu.org
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: marxin at gcc dot gnu.org @ 2020-04-04  9:45 UTC (permalink / raw)
  To: gcc-bugs

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

Martin Liška <marxin at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
                 CC|                            |jason at gcc dot gnu.org,
                   |                            |marxin at gcc dot gnu.org
            Summary|[10 Regression] ICE: tree   |[9/10 Regression] ICE: tree
                   |check: expected             |check: expected
                   |type_pack_expansion, have   |type_pack_expansion, have
                   |error_mark in add_capture,  |error_mark in add_capture,
                   |at cp/lambda.c:607          |at cp/lambda.c:607
   Last reconfirmed|                            |2020-04-04
     Ever confirmed|0                           |1

--- Comment #1 from Martin Liška <marxin at gcc dot gnu.org> ---
Started with r9-4041-g7de37c97b4031ba6.

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

* [Bug c++/94483] [9/10 Regression] ICE: tree check: expected type_pack_expansion, have error_mark in add_capture, at cp/lambda.c:607
  2020-04-04  6:46 [Bug c++/94483] New: [10 Regression] ICE: tree check: expected type_pack_expansion, have error_mark in add_capture, at cp/lambda.c:607 asolokha at gmx dot com
  2020-04-04  9:45 ` [Bug c++/94483] [9/10 " marxin at gcc dot gnu.org
@ 2020-04-06  7:24 ` rguenth at gcc dot gnu.org
  2020-04-16 13:51 ` ppalka at gcc dot gnu.org
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: rguenth at gcc dot gnu.org @ 2020-04-06  7:24 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |9.4
           Priority|P3                          |P4

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

* [Bug c++/94483] [9/10 Regression] ICE: tree check: expected type_pack_expansion, have error_mark in add_capture, at cp/lambda.c:607
  2020-04-04  6:46 [Bug c++/94483] New: [10 Regression] ICE: tree check: expected type_pack_expansion, have error_mark in add_capture, at cp/lambda.c:607 asolokha at gmx dot com
  2020-04-04  9:45 ` [Bug c++/94483] [9/10 " marxin at gcc dot gnu.org
  2020-04-06  7:24 ` rguenth at gcc dot gnu.org
@ 2020-04-16 13:51 ` ppalka at gcc dot gnu.org
  2020-04-16 16:52 ` ppalka at gcc dot gnu.org
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: ppalka at gcc dot gnu.org @ 2020-04-16 13:51 UTC (permalink / raw)
  To: gcc-bugs

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

Patrick Palka <ppalka at gcc dot gnu.org> changed:

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

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

* [Bug c++/94483] [9/10 Regression] ICE: tree check: expected type_pack_expansion, have error_mark in add_capture, at cp/lambda.c:607
  2020-04-04  6:46 [Bug c++/94483] New: [10 Regression] ICE: tree check: expected type_pack_expansion, have error_mark in add_capture, at cp/lambda.c:607 asolokha at gmx dot com
                   ` (2 preceding siblings ...)
  2020-04-16 13:51 ` ppalka at gcc dot gnu.org
@ 2020-04-16 16:52 ` ppalka at gcc dot gnu.org
  2020-04-17 18:08 ` cvs-commit at gcc dot gnu.org
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: ppalka at gcc dot gnu.org @ 2020-04-16 16:52 UTC (permalink / raw)
  To: gcc-bugs

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

Patrick Palka <ppalka at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|error-recovery,             |ice-on-valid-code
                   |ice-on-invalid-code         |

--- Comment #2 from Patrick Palka <ppalka at gcc dot gnu.org> ---
Is the testcase really invalid?  I don't see why it would be.

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

* [Bug c++/94483] [9/10 Regression] ICE: tree check: expected type_pack_expansion, have error_mark in add_capture, at cp/lambda.c:607
  2020-04-04  6:46 [Bug c++/94483] New: [10 Regression] ICE: tree check: expected type_pack_expansion, have error_mark in add_capture, at cp/lambda.c:607 asolokha at gmx dot com
                   ` (3 preceding siblings ...)
  2020-04-16 16:52 ` ppalka at gcc dot gnu.org
@ 2020-04-17 18:08 ` cvs-commit at gcc dot gnu.org
  2020-04-17 18:09 ` [Bug c++/94483] [9 " ppalka at gcc dot gnu.org
  2021-04-28  2:48 ` ppalka at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2020-04-17 18:08 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Patrick Palka <ppalka@gcc.gnu.org>:

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

commit r10-7780-ga28edad3da5c59f09565d3d42e20be1a924986c4
Author: Patrick Palka <ppalka@redhat.com>
Date:   Thu Apr 16 10:28:23 2020 -0400

    c++: Non-type-dependent variadic lambda init-capture [PR94483]

    In this PR, we're ICEing on a use of an 'int... a' template parameter pack
as
    part of the variadic lambda init-capture [...z=a].

    The unexpected thing about this variadic init-capture is that it is not
    type-dependent, and so the call to do_auto_deduction from
    lambda_capture_field_type actually resolves its type to 'int' instead of
exiting
    early like it does for a type-dependent variadic initializer.  This later
    confuses add_capture which, according to one of its comments, assumes that
    'type' is always 'auto' for a variadic init-capture.

    The simplest fix (and the approach that this patch takes) seems to be to
avoid
    doing auto deduction in lambda_capture_field_type when the initializer uses
    parameter packs, so that we always return 'auto' even in the
non-type-dependent
    case.

    gcc/cp/ChangeLog:

            PR c++/94483
            * lambda.c (lambda_capture_field_type): Avoid doing auto deduction
if
            the explicit initializer has parameter packs.

    gcc/testsuite/ChangeLog:

            PR c++/94483
            * g++.dg/cpp2a/lambda-pack-init5.C: New test.

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

* [Bug c++/94483] [9 Regression] ICE: tree check: expected type_pack_expansion, have error_mark in add_capture, at cp/lambda.c:607
  2020-04-04  6:46 [Bug c++/94483] New: [10 Regression] ICE: tree check: expected type_pack_expansion, have error_mark in add_capture, at cp/lambda.c:607 asolokha at gmx dot com
                   ` (4 preceding siblings ...)
  2020-04-17 18:08 ` cvs-commit at gcc dot gnu.org
@ 2020-04-17 18:09 ` ppalka at gcc dot gnu.org
  2021-04-28  2:48 ` ppalka at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: ppalka at gcc dot gnu.org @ 2020-04-17 18:09 UTC (permalink / raw)
  To: gcc-bugs

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

Patrick Palka <ppalka at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|[9/10 Regression] ICE: tree |[9 Regression] ICE: tree
                   |check: expected             |check: expected
                   |type_pack_expansion, have   |type_pack_expansion, have
                   |error_mark in add_capture,  |error_mark in add_capture,
                   |at cp/lambda.c:607          |at cp/lambda.c:607

--- Comment #4 from Patrick Palka <ppalka at gcc dot gnu.org> ---
Fixed for GCC 10 so far.

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

* [Bug c++/94483] [9 Regression] ICE: tree check: expected type_pack_expansion, have error_mark in add_capture, at cp/lambda.c:607
  2020-04-04  6:46 [Bug c++/94483] New: [10 Regression] ICE: tree check: expected type_pack_expansion, have error_mark in add_capture, at cp/lambda.c:607 asolokha at gmx dot com
                   ` (5 preceding siblings ...)
  2020-04-17 18:09 ` [Bug c++/94483] [9 " ppalka at gcc dot gnu.org
@ 2021-04-28  2:48 ` ppalka at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: ppalka at gcc dot gnu.org @ 2021-04-28  2:48 UTC (permalink / raw)
  To: gcc-bugs

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

Patrick Palka <ppalka at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|---                         |FIXED
   Target Milestone|9.4                         |10.0

--- Comment #5 from Patrick Palka <ppalka at gcc dot gnu.org> ---
This doesn't seem appropriate to backport because it's "only" a rejects-valid
-> ice-on-valid regression.  Before r9-4041, we just didn't support pack
expansions in lambda init-capture.

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

end of thread, other threads:[~2021-04-28  2:48 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-04  6:46 [Bug c++/94483] New: [10 Regression] ICE: tree check: expected type_pack_expansion, have error_mark in add_capture, at cp/lambda.c:607 asolokha at gmx dot com
2020-04-04  9:45 ` [Bug c++/94483] [9/10 " marxin at gcc dot gnu.org
2020-04-06  7:24 ` rguenth at gcc dot gnu.org
2020-04-16 13:51 ` ppalka at gcc dot gnu.org
2020-04-16 16:52 ` ppalka at gcc dot gnu.org
2020-04-17 18:08 ` cvs-commit at gcc dot gnu.org
2020-04-17 18:09 ` [Bug c++/94483] [9 " ppalka at gcc dot gnu.org
2021-04-28  2:48 ` ppalka 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).