https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79298
Bug ID: 79298 Summary: ICE on invalid C++ code on x86_64-linux-gnu: Segmentation fault 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: --- This seems to be a recent regression. $ 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.1/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.1 20170130 (experimental) [trunk revision 245020] (GCC) $ $ g++-trunk -c tmp.cpp tmp.cpp: In function ‘int foo()’: tmp.cpp:6:13: error: ‘y’ is not a member of ‘M’ return M::y; ^ tmp.cpp:6:13: internal compiler error: Segmentation fault 0xe13a2f crash_signal ../../gcc-source-trunk/gcc/toplev.c:333 0x89192b consider_binding_level ../../gcc-source-trunk/gcc/cp/name-lookup.c:4788 0x897a81 suggest_alternative_in_explicit_scope(unsigned int, tree_node*, tree_node*) ../../gcc-source-trunk/gcc/cp/name-lookup.c:4529 0x7871b4 qualified_name_lookup_error(tree_node*, tree_node*, tree_node*, unsigned int) ../../gcc-source-trunk/gcc/cp/error.c:3780 0x843ef8 finish_id_expression(tree_node*, tree_node*, tree_node*, cp_id_kind*, bool, bool, bool*, bool, bool, bool, bool, char const**, unsigned int) ../../gcc-source-trunk/gcc/cp/semantics.c:3461 0x7b0373 cp_parser_primary_expression ../../gcc-source-trunk/gcc/cp/parser.c:5335 0x7b314e cp_parser_postfix_expression ../../gcc-source-trunk/gcc/cp/parser.c:6782 0x7ae3cc cp_parser_unary_expression ../../gcc-source-trunk/gcc/cp/parser.c:8101 0x7bb627 cp_parser_cast_expression ../../gcc-source-trunk/gcc/cp/parser.c:8778 0x7bbc35 cp_parser_binary_expression ../../gcc-source-trunk/gcc/cp/parser.c:8880 0x7bc520 cp_parser_assignment_expression ../../gcc-source-trunk/gcc/cp/parser.c:9168 0x7befe9 cp_parser_expression ../../gcc-source-trunk/gcc/cp/parser.c:9335 0x7d16a3 cp_parser_jump_statement ../../gcc-source-trunk/gcc/cp/parser.c:12145 0x7d16a3 cp_parser_statement ../../gcc-source-trunk/gcc/cp/parser.c:10579 0x7d21cc cp_parser_statement_seq_opt ../../gcc-source-trunk/gcc/cp/parser.c:11025 0x7d22bf cp_parser_compound_statement ../../gcc-source-trunk/gcc/cp/parser.c:10979 0x7cccaf cp_parser_function_body ../../gcc-source-trunk/gcc/cp/parser.c:21431 0x7cccaf cp_parser_ctor_initializer_opt_and_function_body ../../gcc-source-trunk/gcc/cp/parser.c:21467 0x7cd591 cp_parser_function_definition_after_declarator ../../gcc-source-trunk/gcc/cp/parser.c:26235 0x7ce7c9 cp_parser_function_definition_from_specifiers_and_declarator ../../gcc-source-trunk/gcc/cp/parser.c:26147 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. $ ----------------------------- namespace N { int x; } namespace M = N; int foo () { return M::y; }