https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97975
Bug ID: 97975
Summary: ICE unexpected expression '(int)A<
<template-parameter-1-1> >::b' of kind
implicit_conv_expr
Product: gcc
Version: 11.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: [email protected]
Target Milestone: ---
Seems to be an old issue :
$ cat z1.cc
template <class> class A
{
static const float b;
static inline const int c = b;
};
$ g++-11-20201122 -c z1.cc
z1.cc:4:31: internal compiler error: unexpected expression '(int)A<
<template-parameter-1-1> >::b' of kind implicit_conv_expr
4 | static inline const int c = b;
| ^
0x6f5185 cxx_eval_constant_expression
../../gcc/cp/constexpr.c:6647
0x6f6b37 cxx_eval_outermost_constant_expr
../../gcc/cp/constexpr.c:6856
0x6fbf8f maybe_constant_init_1
../../gcc/cp/constexpr.c:7307
0x96811c store_init_value(tree_node*, tree_node*, vec<tree_node*, va_gc,
vl_embed>**, int)
../../gcc/cp/typeck2.c:760
0x74fc6e check_initializer
../../gcc/cp/decl.c:6923
0x77f0ab cp_finish_decl(tree_node*, tree_node*, bool, tree_node*, int)
../../gcc/cp/decl.c:7713
0x793bd3 finish_static_data_member_decl(tree_node*, tree_node*, bool,
tree_node*, int)
../../gcc/cp/decl2.c:814
0x79477e grokfield(cp_declarator const*, cp_decl_specifier_seq*, tree_node*,
bool, tree_node*, tree_node*)
../../gcc/cp/decl2.c:1000
0x85f9f4 cp_parser_member_declaration
../../gcc/cp/parser.c:25861
0x82f722 cp_parser_member_specification_opt
../../gcc/cp/parser.c:25306
0x82f722 cp_parser_class_specifier_1
../../gcc/cp/parser.c:24395
0x832159 cp_parser_class_specifier
../../gcc/cp/parser.c:24706
0x832159 cp_parser_type_specifier
../../gcc/cp/parser.c:17962
0x832d86 cp_parser_decl_specifier_seq
../../gcc/cp/parser.c:14584
0x85e0f5 cp_parser_single_declaration
../../gcc/cp/parser.c:29906
0x85e4b5 cp_parser_template_declaration_after_parameters
../../gcc/cp/parser.c:29570
0x85f07f cp_parser_explicit_template_declaration
../../gcc/cp/parser.c:29835
0x85f07f cp_parser_template_declaration_after_export
../../gcc/cp/parser.c:29854
0x8613a9 cp_parser_declaration
../../gcc/cp/parser.c:13608
0x861cf8 cp_parser_translation_unit
../../gcc/cp/parser.c:4806