https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69954
Bug ID: 69954 Summary: internal compiler error: in dependent_type_p, at cp/pt.c:21141 Product: gcc Version: 5.2.1 Status: UNCONFIRMED Keywords: ice-on-valid-code Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: Caspar at Kielwein dot de Target Milestone: --- Created attachment 37788 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=37788&action=edit preprocessed code of reduced example The attached code triggers an ICE on valid code. The attached file is a reduced example from production code. gcc test_range.ii --std=c++14 test_range.ii: In substitution of ‘template<class Container, class> <anonymous struct>::operator Container() [with Container = auto:1; <template-parameter-1-2> = <missing>]’: test_range.ii:18:60: required by substitution of ‘template<class source, class sink, class ... P> constexpr decltype ((declval<sink>()(declval<source>()((declval<P>)()...)), void_flag())) void_check(int) [with source = foo()::<lambda()>; sink = foo()::<lambda(auto:1)>; P = {}]’ test_range.ii:60:62: required by substitution of ‘template<class S, class T> decltype (invoke_helper<void_check<S, T>(0), S, T>()) connection<source_t, sink_t>::operator()() [with S = foo()::<lambda()>; T = foo()::<lambda(auto:1)>]’ test_range.ii:79:44: required from here test_range.ii:50:32: internal compiler error: in dependent_type_p, at cp/pt.c:21141 template <typename Container, typename = typename Container::allocator_type> ^ 0x60d62c dependent_type_p(tree_node*) ../../src/gcc/cp/pt.c:21141 0x60d960 dependent_scope_p(tree_node*) ../../src/gcc/cp/pt.c:21172 0x603007 make_typename_type(tree_node*, tree_node*, tag_types, int) ../../src/gcc/cp/decl.c:3513 0x615843 tsubst(tree_node*, tree_node*, int, tree_node*) ../../src/gcc/cp/pt.c:12576 0x6254b4 type_unification_real ../../src/gcc/cp/pt.c:17151 0x6287fd fn_type_unification(tree_node*, tree_node*, tree_node*, tree_node* const*, unsigned int, tree_node*, unification_kind_t, int, bool, bool) ../../src/gcc/cp/pt.c:16485 0x5e5af9 add_template_candidate_real ../../src/gcc/cp/call.c:3067 0x5e617c add_template_candidate ../../src/gcc/cp/call.c:3164 0x5e617c add_candidates ../../src/gcc/cp/call.c:5295 0x5e37db build_user_type_conversion_1 ../../src/gcc/cp/call.c:3713 0x5e40e0 implicit_conversion ../../src/gcc/cp/call.c:1876 0x5e4e9c add_conv_candidate ../../src/gcc/cp/call.c:2220 0x5e5b5c add_template_candidate_real ../../src/gcc/cp/call.c:3118 0x5ea4be add_template_conv_candidate ../../src/gcc/cp/call.c:3179 0x5ea4be build_op_call_1 ../../src/gcc/cp/call.c:4306 0x5ea4be build_op_call(tree_node*, vec<tree_node*, va_gc, vl_embed>**, int) ../../src/gcc/cp/call.c:4368 0x6b1eb8 finish_call_expr(tree_node*, vec<tree_node*, va_gc, vl_embed>**, bool, bool, int) ../../src/gcc/cp/semantics.c:2426 0x613d55 tsubst_copy_and_build(tree_node*, tree_node*, int, tree_node*, bool, bool) ../../src/gcc/cp/pt.c:15379 0x61314a tsubst_copy_and_build(tree_node*, tree_node*, int, tree_node*, bool, bool) ../../src/gcc/cp/pt.c:15159 0x614ce0 tsubst(tree_node*, tree_node*, int, tree_node*) ../../src/gcc/cp/pt.c:12655 Please submit a full bug report, Could reproduce with gcc 4.9 and gcc 5.2.1 gcc 6 compiles correctly, ICE does not happen. gcc -v Using built-in specs. COLLECT_GCC=gcc COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/5/lto-wrapper Target: x86_64-linux-gnu