https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67687
Martin Sebor <msebor at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Last reconfirmed|2015-10-19 00:00:00 |2016-3-15 CC| |msebor at gcc dot gnu.org Summary|[c++0x][constexpr] |ICE initializing constexpr |initialize constexpr member |member with constexpr |with constexpr constructor |constructor Known to fail| |4.9.3, 5.3.0, 6.0 --- Comment #2 from Martin Sebor <msebor at gcc dot gnu.org> --- This seems to have always failed with an ICE. Reconfirming for all supported versions, including the top of trunk. $ cat t.c && /build/gcc-trunk-bootstrap/gcc/xgcc -B /build/gcc-trunk-bootstrap/gcc -S -Wall -Wextra -Wpedantic -xc++ t.c template <unsigned int Coordinate> struct dimension{ template<typename ... T> constexpr dimension(T...t){} }; struct accessor_base{ template<typename ... T> constexpr accessor_base(T...t){} }; template <typename ArgType, typename Pair> struct accessor_mixed{ private: static constexpr accessor_base s_args_constexpr{dimension<Pair::first>{0} }; }; t.c:16:79: internal compiler error: unexpected expression ‘(const accessor_base){dimension<Pair:: first>{0}}’ of kind implicit_conv_expr static constexpr accessor_base s_args_constexpr{dimension<Pair::first>{0} }; ^ 0x84e015 cxx_eval_constant_expression /src/gcc/trunk/gcc/cp/constexpr.c:3968 0x8515d3 cxx_eval_outermost_constant_expr /src/gcc/trunk/gcc/cp/constexpr.c:4026 0x6d47b4 store_init_value(tree_node*, tree_node*, vec<tree_node*, va_gc, vl_embed>**, int) /src/gcc/trunk/gcc/cp/typeck2.c:822 0x63be15 check_initializer /src/gcc/trunk/gcc/cp/decl.c:6155 0x65c1c8 cp_finish_decl(tree_node*, tree_node*, bool, tree_node*, int) /src/gcc/trunk/gcc/cp/decl.c:6675 0x70bc0e grokfield(cp_declarator const*, cp_decl_specifier_seq*, tree_node*, bool, tree_node*, tree_node*) /src/gcc/trunk/gcc/cp/decl2.c:1036 0x758837 cp_parser_member_declaration /src/gcc/trunk/gcc/cp/parser.c:22559 0x734128 cp_parser_member_specification_opt /src/gcc/trunk/gcc/cp/parser.c:22108 0x734128 cp_parser_class_specifier_1 /src/gcc/trunk/gcc/cp/parser.c:21300 0x734128 cp_parser_class_specifier /src/gcc/trunk/gcc/cp/parser.c:21536 0x734128 cp_parser_type_specifier /src/gcc/trunk/gcc/cp/parser.c:15820 0x748f01 cp_parser_decl_specifier_seq /src/gcc/trunk/gcc/cp/parser.c:12744 0x7573c5 cp_parser_single_declaration /src/gcc/trunk/gcc/cp/parser.c:25703 0x75776c cp_parser_template_declaration_after_parameters /src/gcc/trunk/gcc/cp/parser.c:25398 0x758178 cp_parser_explicit_template_declaration /src/gcc/trunk/gcc/cp/parser.c:25630 0x758178 cp_parser_template_declaration_after_export /src/gcc/trunk/gcc/cp/parser.c:25648 0x75f6a9 cp_parser_declaration /src/gcc/trunk/gcc/cp/parser.c:12080 0x75ded6 cp_parser_declaration_seq_opt /src/gcc/trunk/gcc/cp/parser.c:12010 0x75e1e8 cp_parser_translation_unit /src/gcc/trunk/gcc/cp/parser.c:4323 0x75e1e8 c_parse_file() /src/gcc/trunk/gcc/cp/parser.c:37394 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.