[Bug c++/105481] [9/10/11/12/13 Regression] ICE: unexpected expression of kind template_parm_index
ppalka at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Thu May 5 12:32:25 GMT 2022
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105481
--- Comment #5 from Patrick Palka <ppalka at gcc dot gnu.org> ---
Here's a closely related rejects-valid (rather than ICE-on-valid) testcase,
where the default argument is now T instead of uint<N> (which shouldn't affect
the outcome of partial ordering):
template<unsigned> struct uint;
template<unsigned N> uint<N> f(const uint<N> &); // #1
template<unsigned N, typename T, typename = T> uint<N> f(T); // #2
using X = uint<1>;
X (*fp)(X const &) = f; // should use #1, instead diagnoses as ambiguous
More information about the Gcc-bugs
mailing list