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

            Bug ID: 95931
           Summary: ICE in dependent_type_p, at cp/pt.c:26326
           Product: gcc
           Version: 11.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: haoxintu at gmail dot com
  Target Milestone: ---

This code, bug.cc, reduced by C-Reduce, makes GCC-trunk ICE.

$cat bug.cc
void a { [] (auto, volatile b


$g++ bug.cc
bug.cc:1:6: error: variable or field ‘a’ declared void
    1 | void a { [] (auto, volatile b
      |      ^
bug.cc:1:29: error: ‘b’ does not name a type
    1 | void a { [] (auto, volatile b
      |                             ^
bug.cc:2: error: expected ‘,’ or ‘...’ at end of input
bug.cc:1:30: error: expected ‘)’ at end of input
    1 | void a { [] (auto, volatile b
      |             ~                ^
      |                              )
bug.cc:2: internal compiler error: in dependent_type_p, at cp/pt.c:26326
0x6551ca dependent_type_p(tree_node*)
        ../../gcc/cp/pt.c:26326
0x8fc1bb require_complete_types_for_parms
        ../../gcc/cp/decl.c:13832
0x8fc1bb check_function_type
        ../../gcc/cp/decl.c:16043
0x8fc1bb start_preparsed_function(tree_node*, tree_node*, int)
        ../../gcc/cp/decl.c:16257
0x956a15 start_lambda_function(tree_node*, tree_node*)
        ../../gcc/cp/lambda.c:1425
0x9a912b cp_parser_lambda_body
        ../../gcc/cp/parser.c:11264
0x9a912b cp_parser_lambda_expression
        ../../gcc/cp/parser.c:10640
0x9a912b cp_parser_primary_expression
        ../../gcc/cp/parser.c:5443
0x9b2960 cp_parser_postfix_expression
        ../../gcc/cp/parser.c:7296
0x99564a cp_parser_binary_expression
        ../../gcc/cp/parser.c:9609
0x9971ae cp_parser_assignment_expression
        ../../gcc/cp/parser.c:9914
0x995f6d cp_parser_constant_expression
        ../../gcc/cp/parser.c:10208
0x9966d1 cp_parser_initializer_clause
        ../../gcc/cp/parser.c:23272
0x99683a cp_parser_initializer_list
        ../../gcc/cp/parser.c:23550
0x99683a cp_parser_braced_list
        ../../gcc/cp/parser.c:23311
0x99aa3a cp_parser_initializer
        ../../gcc/cp/parser.c:23228
0x9c259b cp_parser_init_declarator
        ../../gcc/cp/parser.c:20903
0x9a36d2 cp_parser_simple_declaration
        ../../gcc/cp/parser.c:13785
0x9cc926 cp_parser_declaration
        ../../gcc/cp/parser.c:13484
0x9cd06a cp_parser_translation_unit
        ../../gcc/cp/parser.c:4761
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.


$g++ --version
g++ (GCC) 11.0.0 20200626 (experimental)
Copyright (C) 2020 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Reply via email to