https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96462
Bug ID: 96462 Summary: [10/11 Regression] ICE in tree check: expected identifier_node, have bit_not_expr in find_namespace_slot, at cp/name-lookup.c:97 Product: gcc Version: 11.0 Status: UNCONFIRMED Keywords: ice-on-invalid-code Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: haoxintu at gmail dot com Target Milestone: --- Hi, all. This code makes GCC-trunk ICE without emitting any error messages, while other released versions compile it well. Input: //small.cc enum a {}; using a:: ~ a; Command: g++ small.cc Output: small.cc:2:13: internal compiler error: tree check: expected identifier_node, have bit_not_expr in find_namespace_slot, at cp/name-lookup.c:97 2 | using a:: ~ a; | ^ 0x7c7fd7 tree_check_failed(tree_node const*, char const*, int, char const*, ...) ../../gcc/tree.c:9687 0x63f701 tree_check(tree_node*, char const*, int, char const*, tree_code) ../../gcc/tree.h:3303 0x63f701 find_namespace_slot ../../gcc/cp/name-lookup.c:97 0x983071 name_lookup::search_namespace_only(tree_node*) ../../gcc/cp/name-lookup.c:544 0x983132 name_lookup::search_namespace(tree_node*) ../../gcc/cp/name-lookup.c:561 0x983132 name_lookup::search_namespace(tree_node*) ../../gcc/cp/name-lookup.c:554 0x983226 name_lookup::search_qualified(tree_node*, bool) ../../gcc/cp/name-lookup.c:622 0x983226 name_lookup::search_qualified(tree_node*, bool) ../../gcc/cp/name-lookup.c:614 0x986a1b qualified_namespace_lookup ../../gcc/cp/name-lookup.c:6045 0x986b8d lookup_using_decl ../../gcc/cp/name-lookup.c:4619 0x987070 finish_nonmember_using_decl(tree_node*, tree_node*) ../../gcc/cp/name-lookup.c:5132 0x9c7fd2 cp_parser_using_declaration ../../gcc/cp/parser.c:20025 0x9d763e cp_parser_declaration ../../gcc/cp/parser.c:13510 0x9d7d2b cp_parser_translation_unit ../../gcc/cp/parser.c:4793 0x9d7d2b c_parse_file() ../../gcc/cp/parser.c:44081 0xaf2e9d c_common_parse_file() ../../gcc/c-family/c-opts.c:1188 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. My GCC version is Using built-in specs. COLLECT_GCC=g++ COLLECT_LTO_WRAPPER=/home/haoxin/corpus-compilers/gcc-trunk/gcc-master/build/libexec/gcc/x86_64-pc-linux-gnu/11.0.0/lto-wrapper Target: x86_64-pc-linux-gnu Configured with: ../configure --prefix=/home/haoxin/corpus-compilers/gcc-trunk/gcc-master/build/ --enable-languages=c,c++ CC=gcc CXX=g++ Thread model: posix Supported LTO compression algorithms: zlib gcc version 11.0.0 20200801 (experimental) (GCC)