Bug 95937 - ICE in finish_class_member_access_expr, at cp/typeck.c:3133
Summary: ICE in finish_class_member_access_expr, at cp/typeck.c:3133
Status: NEW
Alias: None
Product: gcc
Classification: Unclassified
Component: c++ (show other bugs)
Version: 11.0
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords: error-recovery, ice-on-invalid-code
Depends on:
Blocks:
 
Reported: 2020-06-27 11:13 UTC by Haoxin Tu
Modified: 2021-08-05 10:14 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2020-06-27 00:00:00


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Haoxin Tu 2020-06-27 11:13:23 UTC
This code, bug.cc, reduced by C-Reduce, makes GCC-trunk ICE.

$cat bug.cc
void a { [].decltype(auto)::b

$g++ bug.cc
bug.cc:1:6: error: variable or field ‘a’ declared void
    1 | void a { [].decltype(auto)::b
      |      ^
bug.cc: In lambda function:
bug.cc:1:12: error: expected ‘{’ before ‘.’ token
    1 | void a { [].decltype(auto)::b
      |            ^
bug.cc: At global scope:
bug.cc:1:29: internal compiler error: in finish_class_member_access_expr, at cp/typeck.c:3133
    1 | void a { [].decltype(auto)::b
      |                             ^
0x69a36f finish_class_member_access_expr(cp_expr, tree_node*, bool, int)
	../../gcc/cp/typeck.c:3133
0x9b9d27 cp_parser_postfix_dot_deref_expression
	../../gcc/cp/parser.c:7900
0x9b2c52 cp_parser_postfix_expression
	../../gcc/cp/parser.c:7540
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
0x9cd06a c_parse_file()
	../../gcc/cp/parser.c:44043
0xae4dbb c_common_parse_file()
	../../gcc/c-family/c-opts.c:1190
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.
Comment 1 Marek Polacek 2020-06-27 18:13:02 UTC
Confirmed.
Comment 2 Andrew Pinski 2021-08-05 10:14:10 UTC
Note this does not ICE with -std=c++11 or -std=c++98 :).