https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67131
Bug ID: 67131 Summary: [6 Regression] ICE: Segmentation fault Product: gcc Version: 6.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: trippels at gcc dot gnu.org CC: jason at gcc dot gnu.org Target Milestone: --- trippels@gcc2-power8 test % cat metafunction.ii template <typename T> typename T::_ type; template <template <typename...> class> struct A; template <template <typename> class f> A<f> metafunction; namespace detail { template <typename> struct _decltype; } template <template <typename...> class F> struct A { template <typename... T> auto operator()() -> decltype(type<F<detail::_decltype<T>...>>); }; template <typename F> auto valid_call(F f) -> decltype(f()); constexpr auto valid_call(...) { return 0; } template <typename> struct no_type; static_assert(!valid_call(metafunction<no_type>),""); trippels@gcc2-power8 test % clang++ -Wall -Wextra -c -std=c++14 metafunction.ii trippels@gcc2-power8 test % g++ -c metafunction.ii metafunction.ii: In substitution of ‘template<class ... T> decltype (type<F<detail::_decltype<T>...> >) A< <template-parameter-1-1> >::operator()() [with T = {}]’: metafunction.ii:11:57: required by substitution of ‘template<class F> decltype (f()) valid_call(F) [with F = A<no_type>]’ metafunction.ii:14:48: required from here metafunction.ii:9:8: internal compiler error: Segmentation fault auto operator()() -> decltype(type<F<detail::_decltype<T>...>>); ^ 0x10a19a33 crash_signal ../../gcc/gcc/toplev.c:352 0x1031435c invalid_nonstatic_memfn_p ../../gcc/gcc/cp/typeck.c:1815 0x10385f67 finish_decltype_type(tree_node*, bool, int) ../../gcc/gcc/cp/semantics.c:7172 0x1020c867 tsubst(tree_node*, tree_node*, int, tree_node*) ../../gcc/gcc/cp/pt.c:12686 0x1021219f tsubst_function_type ../../gcc/gcc/cp/pt.c:11749 0x1020c033 tsubst(tree_node*, tree_node*, int, tree_node*) ../../gcc/gcc/cp/pt.c:12493 0x1021911b tsubst_decl ../../gcc/gcc/cp/pt.c:10969 0x1020c3f3 tsubst(tree_node*, tree_node*, int, tree_node*) ../../gcc/gcc/cp/pt.c:11965 0x10209c4f instantiate_template_1 ../../gcc/gcc/cp/pt.c:16156 0x10209c4f instantiate_template(tree_node*, tree_node*, int) ../../gcc/gcc/cp/pt.c:16207 0x10236c27 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:16556 0x10188d3b add_template_candidate_real ../../gcc/gcc/cp/call.c:3022 0x1018996f add_template_candidate ../../gcc/gcc/cp/call.c:3119 0x1018996f add_candidates ../../gcc/gcc/cp/call.c:5245 0x1019012b build_op_call_1 ../../gcc/gcc/cp/call.c:4232 0x1019012b build_op_call(tree_node*, vec<tree_node*, va_gc, vl_embed>**, int) ../../gcc/gcc/cp/call.c:4319 0x1037e2e3 finish_call_expr(tree_node*, vec<tree_node*, va_gc, vl_embed>**, bool, bool, int) ../../gcc/gcc/cp/semantics.c:2408 0x10222d6b tsubst_copy_and_build(tree_node*, tree_node*, int, tree_node*, bool, bool) ../../gcc/gcc/cp/pt.c:15397 0x1020b8e3 tsubst(tree_node*, tree_node*, int, tree_node*) ../../gcc/gcc/cp/pt.c:12666 0x10211ebb tsubst_function_type ../../gcc/gcc/cp/pt.c:11749 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.