https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77804
Martin Sebor <msebor at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |ice-on-valid-code Status|UNCONFIRMED |ASSIGNED Last reconfirmed| |2016-09-30 CC| |msebor at gcc dot gnu.org Assignee|unassigned at gcc dot gnu.org |msebor at gcc dot gnu.org Ever confirmed|0 |1 Known to fail| |6.2.0, 7.0 --- Comment #1 from Martin Sebor <msebor at gcc dot gnu.org> --- Confirmed. $ cat v.C && /build/gcc-trunk-git/gcc/xgcc -B /build/gcc-trunk-git/gcc -S v.Cvoid* operator new[] (__SIZE_TYPE__ n, void *p) { return p; } int main() { char buf[256]; unsigned n = 10; int* p = new (buf) (int[n]); // incorrect way, parenthesis by mistake } v.C: In function ‘int main()’: v.C:7:31: warning: non-constant array new length must be specified without parentheses around the type-id [-Wvla] int* p = new (buf) (int[n]); // incorrect way, parenthesis by mistake ^ v.C:7:31: internal compiler error: in tree_to_uhwi, at tree.c:7330 0x1464ef6 tree_to_uhwi(tree_node const*) /src/gcc/git/gcc/tree.c:7330 0x9b9d9c warn_placement_new_too_small /src/gcc/git/gcc/cp/init.c:2530 0x9bc037 build_new_1 /src/gcc/git/gcc/cp/init.c:3060 0x9bd294 build_new(vec<tree_node*, va_gc, vl_embed>**, tree_node*, tree_node*, vec<tree_node*, va_gc, vl_embed>**, int, int) /src/gcc/git/gcc/cp/init.c:3515 0x928c05 cp_parser_new_expression /src/gcc/git/gcc/cp/parser.c:8171 0x927dc8 cp_parser_unary_expression /src/gcc/git/gcc/cp/parser.c:7771 0x9295fa cp_parser_cast_expression /src/gcc/git/gcc/cp/parser.c:8696 0x9296e8 cp_parser_binary_expression /src/gcc/git/gcc/cp/parser.c:8798 0x92a405 cp_parser_assignment_expression /src/gcc/git/gcc/cp/parser.c:9086 0x92ab5d cp_parser_constant_expression /src/gcc/git/gcc/cp/parser.c:9354 0x940240 cp_parser_initializer_clause /src/gcc/git/gcc/cp/parser.c:21048 0x940089 cp_parser_initializer /src/gcc/git/gcc/cp/parser.c:20986 0x93bf31 cp_parser_init_declarator /src/gcc/git/gcc/cp/parser.c:18851 0x93139e cp_parser_simple_declaration /src/gcc/git/gcc/cp/parser.c:12567 0x93115f cp_parser_block_declaration /src/gcc/git/gcc/cp/parser.c:12435 0x9305d7 cp_parser_declaration_statement /src/gcc/git/gcc/cp/parser.c:12047 0x92d3b4 cp_parser_statement /src/gcc/git/gcc/cp/parser.c:10599 0x92dfc5 cp_parser_statement_seq_opt /src/gcc/git/gcc/cp/parser.c:10931 0x92dec0 cp_parser_compound_statement /src/gcc/git/gcc/cp/parser.c:10885 0x93fe1f cp_parser_function_body /src/gcc/git/gcc/cp/parser.c:20905 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.