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

            Bug ID: 84420
           Summary: [8 Regression] ICE when accessing a structured binding
                    to a captured variable in a template
           Product: gcc
           Version: 8.0.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: benni.buch at gmail dot com
  Target Milestone: ---

int main(){
    int a[1]{};
    [&a]{
        auto [v] = a;
        (void)v;
    }();
}


$ g++ -std=c++17 main.cpp 
main.cpp: In lambda function:
main.cpp:5:15: internal compiler error: in is_normal_capture_proxy, at
cp/lambda.c:288
         (void)v;
               ^
0x5e3bf6 is_normal_capture_proxy(tree_node*)
        ../../gcc/gcc/cp/lambda.c:288
0x8a5578 is_lambda_ignored_entity(tree_node*)
        ../../gcc/gcc/cp/lambda.c:1291
0x8c16ef qualify_lookup
        ../../gcc/gcc/cp/name-lookup.c:5322
0x8cc483 lookup_name_real_1
        ../../gcc/gcc/cp/name-lookup.c:6015
0x8cc483 lookup_name_real(tree_node*, int, int, bool, int, int)
        ../../gcc/gcc/cp/name-lookup.c:6104
0x8d450b cp_parser_lookup_name
        ../../gcc/gcc/cp/parser.c:26103
0x8ee22a cp_parser_class_name
        ../../gcc/gcc/cp/parser.c:22326
0x8ee4e1 cp_parser_type_name
        ../../gcc/gcc/cp/parser.c:17318
0x8fc55b cp_parser_type_name
        ../../gcc/gcc/cp/parser.c:17306
0x8fc55b cp_parser_simple_type_specifier
        ../../gcc/gcc/cp/parser.c:17178
0x8fd647 cp_parser_postfix_expression
        ../../gcc/gcc/cp/parser.c:6945
0x8fe2b0 cp_parser_unary_expression
        ../../gcc/gcc/cp/parser.c:8318
0x8de69f cp_parser_cast_expression
        ../../gcc/gcc/cp/parser.c:9086
0x8de861 cp_parser_cast_expression
        ../../gcc/gcc/cp/parser.c:9038
0x8deeaa cp_parser_binary_expression
        ../../gcc/gcc/cp/parser.c:9187
0x8e0684 cp_parser_assignment_expression
        ../../gcc/gcc/cp/parser.c:9476
0x8e0d98 cp_parser_expression
        ../../gcc/gcc/cp/parser.c:9645
0x8e2a58 cp_parser_expression_statement
        ../../gcc/gcc/cp/parser.c:11112
0x8e8dcd cp_parser_statement
        ../../gcc/gcc/cp/parser.c:10916
0x8ea2e0 cp_parser_statement_seq_opt
        ../../gcc/gcc/cp/parser.c:11255
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) 8.0.1 20180216 (experimental)
Copyright (C) 2018 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