[Bug c++/84630] New: internal compiler error: tree check: expected class 'type', have 'exceptional' (error_mark) in tsubst_lambda_expr, at cp/pt.c:17141
vegard.nossum at gmail dot com
gcc-bugzilla@gcc.gnu.org
Thu Mar 1 07:24:00 GMT 2018
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84630
Bug ID: 84630
Summary: internal compiler error: tree check: expected class
'type', have 'exceptional' (error_mark) in
tsubst_lambda_expr, at cp/pt.c:17141
Product: gcc
Version: 8.0.1
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: vegard.nossum at gmail dot com
Target Milestone: ---
I was quite sure I had submitted this one but I have searched and cannot see it
anywhere, my apologies if it turns out to be a duplicate.
Input:
template <typename...> struct c {
template <const> __attribute__((noinline([] {}))) b() {}
};
c<> a;
Output:
$ xgcc -x c++ -S -
<stdin>:2:13: error: ISO C++ forbids declaration of 'parameter' with no type
[-fpermissive]
<stdin>:2:55: error: ISO C++ forbids declaration of 'b' with no type
[-fpermissive]
<stdin>: In member function 'int c< <template-parameter-1-1> >::b()':
<stdin>:2:58: warning: no return statement in function returning non-void
[-Wreturn-type]
<stdin>: In instantiation of 'struct c<>':
<stdin>:4:5: required from here
<stdin>:2:53: internal compiler error: tree check: expected class 'type', have
'exceptional' (error_mark) in tsubst_lambda_expr, at cp/pt.c:17141
0x6602e9 tree_class_check_failed(tree_node const*, tree_code_class, char
const*, int, char const*)
/home/vegard/git/gcc/gcc/tree.c:9388
0x11dd0a0 tree_class_check(tree_node*, tree_code_class, char const*, int, char
const*)
/home/vegard/git/gcc/gcc/tree.h:3255
0x11dd0a0 tsubst_lambda_expr(tree_node*, tree_node*, int, tree_node*)
/home/vegard/git/gcc/gcc/cp/pt.c:17141
0x10f640b tsubst_copy_and_build(tree_node*, tree_node*, int, tree_node*, bool,
bool)
/home/vegard/git/gcc/gcc/cp/pt.c:18479
0x10f408a tsubst_copy_and_build(tree_node*, tree_node*, int, tree_node*, bool,
bool)
/home/vegard/git/gcc/gcc/cp/pt.c:18168
0x10bfe06 tsubst_expr(tree_node*, tree_node*, int, tree_node*, bool)
/home/vegard/git/gcc/gcc/cp/pt.c:16973
0x1164bbf tsubst_attribute
/home/vegard/git/gcc/gcc/cp/pt.c:10327
0x1174e7c apply_late_template_attributes
/home/vegard/git/gcc/gcc/cp/pt.c:10428
0x117ef90 tsubst_function_decl
/home/vegard/git/gcc/gcc/cp/pt.c:12687
0x1184e90 tsubst_template_decl
/home/vegard/git/gcc/gcc/cp/pt.c:12804
0x1155421 tsubst_decl
/home/vegard/git/gcc/gcc/cp/pt.c:12906
0x1105c06 tsubst(tree_node*, tree_node*, int, tree_node*)
/home/vegard/git/gcc/gcc/cp/pt.c:13798
0x11e2760 instantiate_class_template_1
/home/vegard/git/gcc/gcc/cp/pt.c:10743
0x11ef20b instantiate_class_template(tree_node*)
/home/vegard/git/gcc/gcc/cp/pt.c:11041
0x138b930 complete_type(tree_node*)
/home/vegard/git/gcc/gcc/cp/typeck.c:136
0xb38193 start_decl_1(tree_node*, bool)
/home/vegard/git/gcc/gcc/cp/decl.c:5244
0xc1a64f start_decl(cp_declarator const*, cp_decl_specifier_seq*, int,
tree_node*, tree_node*, tree_node**)
/home/vegard/git/gcc/gcc/cp/decl.c:5207
0xfa251c cp_parser_init_declarator
/home/vegard/git/gcc/gcc/cp/parser.c:19589
0xfa8357 cp_parser_simple_declaration
/home/vegard/git/gcc/gcc/cp/parser.c:13061
0xfae548 cp_parser_block_declaration
/home/vegard/git/gcc/gcc/cp/parser.c:12879
$ xgcc --version
xgcc (GCC) 8.0.1 20180228 (experimental)
Built from git fd1990b25777e5f1307eac1447e8fb5fefe747b4 (r258063).
7.3.0 says:
<source>:2:13: error: ISO C++ forbids declaration of 'parameter' with no type
[-fpermissive]
template <const> __attribute__((noinline([] {}))) b() {}
^~~~~
<source>:2:55: error: ISO C++ forbids declaration of 'b' with no type
[-fpermissive]
template <const> __attribute__((noinline([] {}))) b() {}
^
<source>:1: confused by earlier errors, bailing out
Compiler returned: 1
Test case was reduced by C-Reduce.
More information about the Gcc-bugs
mailing list