https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113649
Bug ID: 113649
Summary: ICE: nested template class template argument deduction
Product: gcc
Version: 14.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: schaumb at gmail dot com
Target Milestone: ---
The following code does not compile, see here https://godbolt.org/z/vz5KMzhsh:
template<class ...Ts>
struct params {
template <typename Return>
struct return_type {
constexpr return_type(Return (*p1)(Ts...)){}
};
template <typename Return>
return_type(Return (*)(Ts...)) ->
return_type<Return>;
template<return_type Any>
struct addr {};
};
void x(double);
template struct params<double>::addr<&x>;
It runs to internal compiler error:
<source>:19:40: internal compiler error: in build_function_type, at
tree.cc:7488
19 | template struct params<double>::addr<&x>;
| ^
0x2647edc internal_error(char const*, ...)
???:0
0xa51cb7 fancy_abort(char const*, int, char const*)
???:0
0xc72375 do_auto_deduction(tree_node*, tree_node*, tree_node*, int,
auto_deduction_context, tree_node*, int, tree_node*)
???:0
0xc76223 coerce_template_parms(tree_node*, tree_node*, tree_node*, int, bool)
???:0
0xc93089 lookup_template_class(tree_node*, tree_node*, tree_node*, tree_node*,
int, int)
???:0
0xccf8ff finish_template_type(tree_node*, tree_node*, int)
???:0
0xc53d2a c_parse_file()
???:0
0xda79a9 c_common_parse_file()
???:0
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.
Compiler returned: 1