http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59115
Bug ID: 59115 Summary: [c++1y] ICE with auto as template parameter Product: gcc Version: 4.9.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: reichelt at gcc dot gnu.org The following invalid code snippet (compiled with "-std=c++1y") triggers an ICE on trunk: =============================================================== template<typename T, auto, int = 0> void foo(T, auto) {} void bar() { foo(0, 0); } =============================================================== bug.cc:1:22: error: 'auto' parameter not permitted in this context template<typename T, auto, int = 0> void foo(T, auto) {} ^ bug.cc: In substitution of 'template<class T, <declaration error>, int <anonymous>, class auto:1> void foo(T, auto:1) [with T = int; <declaration error> = <missing>; int <anonymous> = <missing>; auto:1 = <missing>]': bug.cc:5:11: required from here bug.cc:5:11: internal compiler error: in unify, at cp/pt.c:17279 foo(0, 0); ^ 0x5d5e3d unify ../../gcc/gcc/cp/pt.c:17279 0x5de566 unify_one_argument ../../gcc/gcc/cp/pt.c:16102 0x5d3493 type_unification_real ../../gcc/gcc/cp/pt.c:16174 0x5e225e fn_type_unification(tree_node*, tree_node*, tree_node*, tree_node* const*, unsigned int, tree_node*, unification_kind_t, int, bool, bool) ../../gcc/gcc/cp/pt.c:15615 0x54d05c add_template_candidate_real ../../gcc/gcc/cp/call.c:2923 0x548ce9 add_template_candidate ../../gcc/gcc/cp/call.c:3020 0x548ce9 add_candidates ../../gcc/gcc/cp/call.c:5075 0x550062 perform_overload_resolution ../../gcc/gcc/cp/call.c:3816 0x556b5a build_new_function_call(tree_node*, vec<tree_node*, va_gc, vl_embed>**, bool, int) ../../gcc/gcc/cp/call.c:3893 0x6cc2d0 finish_call_expr(tree_node*, vec<tree_node*, va_gc, vl_embed>**, bool, bool, int) ../../gcc/gcc/cp/semantics.c:2274 0x652023 cp_parser_postfix_expression ../../gcc/gcc/cp/parser.c:6094 0x6548cd cp_parser_unary_expression ../../gcc/gcc/cp/parser.c:7100 0x65543f cp_parser_binary_expression ../../gcc/gcc/cp/parser.c:7804 0x65590f cp_parser_assignment_expression ../../gcc/gcc/cp/parser.c:8042 0x657e63 cp_parser_expression ../../gcc/gcc/cp/parser.c:8204 0x65865e cp_parser_expression ../../gcc/gcc/cp/parser.c:8243 0x65865e cp_parser_expression_statement ../../gcc/gcc/cp/parser.c:9542 0x64df67 cp_parser_statement ../../gcc/gcc/cp/parser.c:9393 0x64ec49 cp_parser_statement_seq_opt ../../gcc/gcc/cp/parser.c:9665 0x64edbe cp_parser_compound_statement ../../gcc/gcc/cp/parser.c:9619 Please submit a full bug report, [etc.]