This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/77791] New: ICE on invalid C++11 code with redefined function parameter: tree check: expected tree that contains ‘decl minimal’ structure, have ‘error_mark’ in cp_parser_lambda_declarator_opt, at cp/parser.c:1011
- From: "su at cs dot ucdavis.edu" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 29 Sep 2016 03:08:38 +0000
- Subject: [Bug c++/77791] New: ICE on invalid C++11 code with redefined function parameter: tree check: expected tree that contains ‘decl minimal’ structure, have ‘error_mark’ in cp_parser_lambda_declarator_opt, at cp/parser.c:1011
- Auto-submitted: auto-generated
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77791
Bug ID: 77791
Summary: ICE on invalid C++11 code with redefined function
parameter: tree check: expected tree that contains
‘decl minimal’ structure, have ‘error_mark’ in
cp_parser_lambda_declarator_opt, at cp/parser.c:1011
Product: gcc
Version: 7.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: su at cs dot ucdavis.edu
Target Milestone: ---
It is regression from 6.2.x.
$ 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/7.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 7.0.0 20160928 (experimental) [trunk revision 240585] (GCC)
$
$ g++-trunk -std=c++11 -c small.cpp
small.cpp:1:29: error: redefinition of ‘int i’
auto a = [] (int i, int i = 0) {};
^
small.cpp:1:18: note: ‘int i’ previously declared here
auto a = [] (int i, int i = 0) {};
^
small.cpp:1:29: internal compiler error: tree check: expected tree that
contains ‘decl minimal’ structure, have ‘error_mark’ in
cp_parser_lambda_declarator_opt, at cp/parser.c:10119
auto a = [] (int i, int i = 0) {};
^
0x1090e44 tree_contains_struct_check_failed(tree_node const*,
tree_node_structure_enum, char const*, int, char const*)
../../gcc-source-trunk/gcc/tree.c:9914
0x7b4612 contains_struct_check
../../gcc-source-trunk/gcc/tree.h:3145
0x7b4612 cp_parser_lambda_declarator_opt
../../gcc-source-trunk/gcc/cp/parser.c:10119
0x792a82 cp_parser_lambda_expression
../../gcc-source-trunk/gcc/cp/parser.c:9779
0x792a82 cp_parser_primary_expression
../../gcc-source-trunk/gcc/cp/parser.c:4966
0x79dbe6 cp_parser_postfix_expression
../../gcc-source-trunk/gcc/cp/parser.c:6724
0x79c01c cp_parser_unary_expression
../../gcc-source-trunk/gcc/cp/parser.c:8019
0x7a5e57 cp_parser_cast_expression
../../gcc-source-trunk/gcc/cp/parser.c:8696
0x7a6455 cp_parser_binary_expression
../../gcc-source-trunk/gcc/cp/parser.c:8798
0x7a6d40 cp_parser_assignment_expression
../../gcc-source-trunk/gcc/cp/parser.c:9086
0x7a717a cp_parser_constant_expression
../../gcc-source-trunk/gcc/cp/parser.c:9354
0x7a7904 cp_parser_initializer_clause
../../gcc-source-trunk/gcc/cp/parser.c:21048
0x7a929b cp_parser_initializer
../../gcc-source-trunk/gcc/cp/parser.c:20986
0x7bb3fc cp_parser_init_declarator
../../gcc-source-trunk/gcc/cp/parser.c:18851
0x7bbb39 cp_parser_simple_declaration
../../gcc-source-trunk/gcc/cp/parser.c:12567
0x7bbe71 cp_parser_block_declaration
../../gcc-source-trunk/gcc/cp/parser.c:12435
0x7c3dd0 cp_parser_declaration
../../gcc-source-trunk/gcc/cp/parser.c:12332
0x7c2914 cp_parser_declaration_seq_opt
../../gcc-source-trunk/gcc/cp/parser.c:12211
0x7c2c58 cp_parser_translation_unit
../../gcc-source-trunk/gcc/cp/parser.c:4356
0x7c2c58 c_parse_file()
../../gcc-source-trunk/gcc/cp/parser.c:37805
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <http://gcc.gnu.org/bugs.html> for instructions.
$
-------------------------------------
auto a = [] (int i, int i = 0) {};