https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81574
Bug ID: 81574 Summary: ICE on valid C++14 code: in canonicalize_component_ref, at gimplify.c:2481 Product: gcc Version: unknown Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: su at cs dot ucdavis.edu Target Milestone: --- $ g++-trunk -v Using built-in specs. COLLECT_GCC=g++-trunk COLLECT_LTO_WRAPPER=/usr/local/gcc-trunk/libexec/gcc/x86_64-pc-linux-gnu/8.0.0/lto-wrapper Target: x86_64-pc-linux-gnu Configured with: ../gcc-source-trunk/configure --enable-languages=c,c++,lto --prefix=/usr/local/gcc-trunk --disable-bootstrap Thread model: posix gcc version 8.0.0 20170726 (experimental) [trunk revision 250555] (GCC) $ $ clang++ -c -std=c++14 small.cpp $ icc -c -std=c++14 small.cpp $ $ g++-trunk -c -std=c++14 small.cpp small.cpp: In lambda function: small.cpp:5:18: error: field ‘f()::<lambda()>::<lambda()>::<b capture>’ invalidly declared function type [=] { return b; } (); ^ small.cpp: In lambda function: small.cpp:5:21: internal compiler error: in canonicalize_component_ref, at gimplify.c:2481 [=] { return b; } (); ^ 0xbb2693 canonicalize_component_ref ../../gcc-source-trunk/gcc/gimplify.c:2481 0xbc4ed7 gimplify_compound_lval ../../gcc-source-trunk/gcc/gimplify.c:2907 0xbbb7c1 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*), int) ../../gcc-source-trunk/gcc/gimplify.c:11277 0xbbb9b6 gimplify_addr_expr ../../gcc-source-trunk/gcc/gimplify.c:5920 0xbbb9b6 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*), int) ../../gcc-source-trunk/gcc/gimplify.c:11371 0xbced77 gimplify_modify_expr ../../gcc-source-trunk/gcc/gimplify.c:5513 0xbbc6d9 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*), int) ../../gcc-source-trunk/gcc/gimplify.c:11325 0xbc0406 gimplify_stmt(tree_node**, gimple**) ../../gcc-source-trunk/gcc/gimplify.c:6546 0xbbcceb gimplify_and_add(tree_node*, gimple**) ../../gcc-source-trunk/gcc/gimplify.c:438 0xbbcceb gimplify_return_expr ../../gcc-source-trunk/gcc/gimplify.c:1541 0xbbcceb gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*), int) ../../gcc-source-trunk/gcc/gimplify.c:11584 0xbc0406 gimplify_stmt(tree_node**, gimple**) ../../gcc-source-trunk/gcc/gimplify.c:6546 0xbbbc7b gimplify_statement_list ../../gcc-source-trunk/gcc/gimplify.c:1737 0xbbbc7b gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*), int) ../../gcc-source-trunk/gcc/gimplify.c:11752 0xbc0406 gimplify_stmt(tree_node**, gimple**) ../../gcc-source-trunk/gcc/gimplify.c:6546 0xbc17f5 gimplify_bind_expr ../../gcc-source-trunk/gcc/gimplify.c:1295 0xbbd826 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*), int) ../../gcc-source-trunk/gcc/gimplify.c:11524 0xbc0406 gimplify_stmt(tree_node**, gimple**) ../../gcc-source-trunk/gcc/gimplify.c:6546 0xbc25ef gimplify_body(tree_node*, bool) ../../gcc-source-trunk/gcc/gimplify.c:12521 0xbc2c24 gimplify_function_tree(tree_node*) ../../gcc-source-trunk/gcc/gimplify.c:12679 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. $ ----------------------------- void f () { [&b (f)] { [=] { return b; } (); } (); }