https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85008
Bug ID: 85008 Summary: internal compiler error: lang_* check: failed in decl_cloned_function_p, at cp/class.c:4577 Product: gcc Version: 8.0.1 Status: UNCONFIRMED Keywords: ice-on-invalid-code Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: vegard.nossum at oracle dot com CC: webrown.cpp at gmail dot com Target Milestone: --- Input: void a() { struct b { ~b(); __attribute__((c(&b::~))) } } Output: $ cc1plus void a() <stdin>:4:27: error: expected class-name before ')' token <stdin>:4:27: internal compiler error: lang_* check: failed in decl_cloned_function_p, at cp/class.c:4577 0x5efa30 lang_check_failed(char const*, int, char const*) /home/vegard/git/gcc/gcc/cp/tree.c:5373 0x9b16c7 decl_cloned_function_p(tree_node const*, bool) /home/vegard/git/gcc/gcc/cp/class.c:4577 0x13255c2 decl_linkage(tree_node*) /home/vegard/git/gcc/gcc/cp/tree.c:4966 0xc6316d mark_used(tree_node*, int) /home/vegard/git/gcc/gcc/cp/decl2.c:5316 0x12aebcb finish_id_expression(tree_node*, tree_node*, tree_node*, cp_id_kind*, bool, bool, bool*, bool, bool, bool, bool, char const**, unsigned int) /home/vegard/git/gcc/gcc/cp/semantics.c:3706 0xf33f42 cp_parser_primary_expression /home/vegard/git/gcc/gcc/cp/parser.c:5611 0xf7698b cp_parser_postfix_expression /home/vegard/git/gcc/gcc/cp/parser.c:7030 0xf2a4b7 cp_parser_unary_expression /home/vegard/git/gcc/gcc/cp/parser.c:8322 0xebfeca cp_parser_cast_expression /home/vegard/git/gcc/gcc/cp/parser.c:9090 0xf290c9 cp_parser_unary_expression /home/vegard/git/gcc/gcc/cp/parser.c:8240 0xebfeca cp_parser_cast_expression /home/vegard/git/gcc/gcc/cp/parser.c:9090 0xec24f6 cp_parser_binary_expression /home/vegard/git/gcc/gcc/cp/parser.c:9191 0xec62ca cp_parser_assignment_expression /home/vegard/git/gcc/gcc/cp/parser.c:9486 0xed4304 cp_parser_parenthesized_expression_list /home/vegard/git/gcc/gcc/cp/parser.c:7764 0xed6ddb cp_parser_gnu_attribute_list /home/vegard/git/gcc/gcc/cp/parser.c:25056 0xed6ddb cp_parser_gnu_attributes_opt /home/vegard/git/gcc/gcc/cp/parser.c:24971 0xf886f7 cp_parser_decl_specifier_seq /home/vegard/git/gcc/gcc/cp/parser.c:13431 0xfdddd8 cp_parser_member_declaration /home/vegard/git/gcc/gcc/cp/parser.c:23522 0xf142ab cp_parser_member_specification_opt /home/vegard/git/gcc/gcc/cp/parser.c:23374 0xf142ab cp_parser_class_specifier_1 /home/vegard/git/gcc/gcc/cp/parser.c:22516 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. Version: GNU C++14 (GCC) version 8.0.1 20180306 (experimental) (x86_64-pc-linux-gnu) 7.3.0 says: <source>: In function 'void a()': <source>:4:27: error: expected class-name before ')' token __attribute__((c(&b::~))) ^ <source>:4:27: error: taking address of destructor 'a()::b::~b' <source>:5:3: error: expected unqualified-id before '}' token } ^ <source>:5:4: error: expected ';' after struct definition } ^ ; Compiler returned: 1