struct a {}; template <typename> struct b { a operator*(); }; template <typename c, typename d> c e(d); template <typename, typename d> auto e(b<d> f) -> decltype(e<int>(*f)) {} void blah() { e<a>(b<int>{}); } $ ./cc1plus -quiet f.ii ‘ Internal compiler error: Error reporting routines re-entered. 0x9d0882 push_tinst_level_loc /home/mbelivea/src/gcc/gcc/cp/pt.c:10258 0x9d09e1 push_tinst_level /home/mbelivea/src/gcc/gcc/cp/pt.c:10301 0xa02c62 fn_type_unification(tree_node*, tree_node*, tree_node*, tree_node* const*, unsigned int, tree_node*, unification_kind_t, int, conversion**, bool, bool) /home/mbelivea/src/gcc/gcc/cp/pt.c:20200 0x850f06 add_template_candidate_real /home/mbelivea/src/gcc/gcc/cp/call.c:3315 0x85188c add_template_candidate /home/mbelivea/src/gcc/gcc/cp/call.c:3400 0x85188c add_candidates /home/mbelivea/src/gcc/gcc/cp/call.c:5724 0x856ea7 add_candidates /home/mbelivea/src/gcc/gcc/cp/call.c:4388 0x856ea7 perform_overload_resolution /home/mbelivea/src/gcc/gcc/cp/call.c:4396 0x85a245 build_new_function_call(tree_node*, vec<tree_node*, va_gc, vl_embed>**, int) /home/mbelivea/src/gcc/gcc/cp/call.c:4470 0xa44a2d finish_call_expr(tree_node*, vec<tree_node*, va_gc, vl_embed>**, bool, bool, int) /home/mbelivea/src/gcc/gcc/cp/semantics.c:2584 0x9fd7bd tsubst_copy_and_build(tree_node*, tree_node*, int, tree_node*, bool, bool) /home/mbelivea/src/gcc/gcc/cp/pt.c:19093 0x9e8091 tsubst(tree_node*, tree_node*, int, tree_node*) /home/mbelivea/src/gcc/gcc/cp/pt.c:15140 0x9e3f50 tsubst_function_type /home/mbelivea/src/gcc/gcc/cp/pt.c:14167 0x9e7337 tsubst(tree_node*, tree_node*, int, tree_node*) /home/mbelivea/src/gcc/gcc/cp/pt.c:14947 0xa02d0a fn_type_unification(tree_node*, tree_node*, tree_node*, tree_node* const*, unsigned int, tree_node*, unification_kind_t, int, conversion**, bool, bool) /home/mbelivea/src/gcc/gcc/cp/pt.c:20212 0x850f06 add_template_candidate_real /home/mbelivea/src/gcc/gcc/cp/call.c:3315 0x85188c add_template_candidate /home/mbelivea/src/gcc/gcc/cp/call.c:3400 0x85188c add_candidates /home/mbelivea/src/gcc/gcc/cp/call.c:5724 0x856ea7 add_candidates /home/mbelivea/src/gcc/gcc/cp/call.c:4388 0x856ea7 perform_overload_resolution /home/mbelivea/src/gcc/gcc/cp/call.c:4396 Please submit a full bug report, with preprocessed source if appropriate. Please include the complete backtrace with any bug report. See <https://gcc.gnu.org/bugs/> for instructions. $ ./cc1plus -quiet f.ii ‘ Internal compiler error: Error reporting routines re-entered. 0x9d0882 push_tinst_level_loc /home/mbelivea/src/gcc/gcc/cp/pt.c:10258 0x9d09e1 push_tinst_level /home/mbelivea/src/gcc/gcc/cp/pt.c:10301 0xa02c62 fn_type_unification(tree_node*, tree_node*, tree_node*, tree_node* const*, unsigned int, tree_node*, unification_kind_t, int, conversion**, bool, bool) /home/mbelivea/src/gcc/gcc/cp/pt.c:20200 0x850f06 add_template_candidate_real /home/mbelivea/src/gcc/gcc/cp/call.c:3315 0x85188c add_template_candidate /home/mbelivea/src/gcc/gcc/cp/call.c:3400 0x85188c add_candidates /home/mbelivea/src/gcc/gcc/cp/call.c:5724 0x856ea7 add_candidates /home/mbelivea/src/gcc/gcc/cp/call.c:4388 0x856ea7 perform_overload_resolution /home/mbelivea/src/gcc/gcc/cp/call.c:4396 0x85a245 build_new_function_call(tree_node*, vec<tree_node*, va_gc, vl_embed>**, int) /home/mbelivea/src/gcc/gcc/cp/call.c:4470 0xa44a2d finish_call_expr(tree_node*, vec<tree_node*, va_gc, vl_embed>**, bool, bool, int) /home/mbelivea/src/gcc/gcc/cp/semantics.c:2584 0x9fd7bd tsubst_copy_and_build(tree_node*, tree_node*, int, tree_node*, bool, bool) /home/mbelivea/src/gcc/gcc/cp/pt.c:19093 0x9e8091 tsubst(tree_node*, tree_node*, int, tree_node*) /home/mbelivea/src/gcc/gcc/cp/pt.c:15140 0x9e3f50 tsubst_function_type /home/mbelivea/src/gcc/gcc/cp/pt.c:14167 0x9e7337 tsubst(tree_node*, tree_node*, int, tree_node*) /home/mbelivea/src/gcc/gcc/cp/pt.c:14947 0xa02d0a fn_type_unification(tree_node*, tree_node*, tree_node*, tree_node* const*, unsigned int, tree_node*, unification_kind_t, int, conversion**, bool, bool) /home/mbelivea/src/gcc/gcc/cp/pt.c:20212 0x850f06 add_template_candidate_real /home/mbelivea/src/gcc/gcc/cp/call.c:3315 0x85188c add_template_candidate /home/mbelivea/src/gcc/gcc/cp/call.c:3400 0x85188c add_candidates /home/mbelivea/src/gcc/gcc/cp/call.c:5724 0x856ea7 add_candidates /home/mbelivea/src/gcc/gcc/cp/call.c:4388 0x856ea7 perform_overload_resolution /home/mbelivea/src/gcc/gcc/cp/call.c:4396 Please submit a full bug report, with preprocessed source if appropriate. Please include the complete backtrace with any bug report. See <https://gcc.gnu.org/bugs/> for instructions.
Adding missing return on line 4 lets it compile.
Confirmed. With -Wreturn-type, started with r253600. Before: 90747.C: In instantiation of ‘decltype (e<int>((* f))) e(b<d>) [with <template-parameter-1-1> = a; d = int; decltype (e<int>((* f))) = int]’: 90747.C:5:28: required from here 90747.C:4:73: warning: no return statement in function returning non-void [-Wreturn-type] template <typename, typename d> auto e(b<d> f) -> decltype(e<int>(*f)) {} ^
Possibly the same problem as in PR54080.
GCC 8.4.0 has been released, adjusting target milestone.
GCC 8 branch is being closed.
GCC 9.4 is being released, retargeting bugs to GCC 9.5.
GCC 9 branch is being closed
GCC 10.4 is being released, retargeting bugs to GCC 10.5.
GCC 10 branch is being closed.