https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66426
Bug ID: 66426 Summary: ICE: unexpected expression ‘int(Constructible())...’ of kind expr_pack_expansion Product: gcc Version: 4.9.3 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: jamrial at gmail dot com Target Milestone: --- [jamrial@archVM ~]$ cat zip.c template <typename> struct A; template <bool> struct enable_if; template <typename T, T> struct B; template <bool... Bools> using and_c = A<B<bool, Bools || true...>>; template <typename...> using Constructible = int; template <typename... Ts> struct common_tuple { template < typename... Us, typename enable_if<and_c<(int)Constructible<Ts, Us>()...>::value>::type> }; [jamrial@archVM ~]$ g++-trunk -O2 -std=c++11 -c zip2.c zip2.c:10:1: error: expected unqualified-id before ‘}’ token }; ^ [jamrial@archVM ~]$ g++-5.1 -O2 -std=c++11 -c zip2.c zip2.c:10:1: error: expected unqualified-id before ‘}’ token }; ^ [jamrial@archVM ~]$ g++-4.9 -O2 -std=c++11 -c zip.c zip.c:9:63: internal compiler error: unexpected expression ‘int(Constructible())...’ of kind expr_pack_expansion typename enable_if<and_c<(int)Constructible<Ts, Us>()...>::value>::type> ^ 0x61cbd6 cxx_eval_constant_expression /home/jamrial/gcc-4.9-20150603/gcc/cp/semantics.c:9833 0x61e5b6 cxx_eval_outermost_constant_expr /home/jamrial/gcc-4.9-20150603/gcc/cp/semantics.c:9853 0x585cb0 convert_nontype_argument /home/jamrial/gcc-4.9-20150603/gcc/cp/pt.c:5698 0x585cb0 convert_template_argument /home/jamrial/gcc-4.9-20150603/gcc/cp/pt.c:6590 0x582252 coerce_template_parameter_pack /home/jamrial/gcc-4.9-20150603/gcc/cp/pt.c:6713 0x582252 coerce_template_parms /home/jamrial/gcc-4.9-20150603/gcc/cp/pt.c:6922 0x586c70 lookup_template_class_1 /home/jamrial/gcc-4.9-20150603/gcc/cp/pt.c:7594 0x586c70 lookup_template_class(tree_node*, tree_node*, tree_node*, tree_node*, int, int) /home/jamrial/gcc-4.9-20150603/gcc/cp/pt.c:7895 0x6149b2 finish_template_type(tree_node*, tree_node*, int) /home/jamrial/gcc-4.9-20150603/gcc/cp/semantics.c:2969 0x5d63fa cp_parser_template_id /home/jamrial/gcc-4.9-20150603/gcc/cp/parser.c:13464 0x5d6613 cp_parser_class_name /home/jamrial/gcc-4.9-20150603/gcc/cp/parser.c:19195 0x5cc673 cp_parser_qualifying_entity /home/jamrial/gcc-4.9-20150603/gcc/cp/parser.c:5538 0x5cc673 cp_parser_nested_name_specifier_opt /home/jamrial/gcc-4.9-20150603/gcc/cp/parser.c:5263 0x5e0ee2 cp_parser_simple_type_specifier /home/jamrial/gcc-4.9-20150603/gcc/cp/parser.c:14666 0x5c3ebd cp_parser_type_specifier /home/jamrial/gcc-4.9-20150603/gcc/cp/parser.c:14412 0x5c65cb cp_parser_type_specifier_seq /home/jamrial/gcc-4.9-20150603/gcc/cp/parser.c:18137 0x5d4ee2 cp_parser_type_id_1 /home/jamrial/gcc-4.9-20150603/gcc/cp/parser.c:18010 0x5d4fde cp_parser_template_type_arg /home/jamrial/gcc-4.9-20150603/gcc/cp/parser.c:18059 0x5d51d8 cp_parser_template_argument /home/jamrial/gcc-4.9-20150603/gcc/cp/parser.c:13840 0x5d51d8 cp_parser_template_argument_list /home/jamrial/gcc-4.9-20150603/gcc/cp/parser.c:13750 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. Testcase based on the one from Comment 2 of pr66405.