https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95568
Marek Polacek <mpolacek at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jason at gcc dot gnu.org --- Comment #3 from Marek Polacek <mpolacek at gcc dot gnu.org> --- So far my guess is that this doesn't work because in a template finish_decltype_type will create a DECLTYPE_TYPE in the deduction guide, so we'll have template<class T> X(decltype (X<T>::x))-> X<T> deduction guide. type_unification_real then tries to deduce T from a P/A pair decltype (X<T>::x) and 0. But: The non-deduced contexts are: -- The expression of a decltype-specifier. and If a template parameter is used only in non-deduced contexts and is not explicitly specified, template argument deduction fails.