https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87480
--- Comment #7 from CVS Commits <cvs-commit at gcc dot gnu.org> --- The releases/gcc-8 branch has been updated by Jason Merrill <ja...@gcc.gnu.org>: https://gcc.gnu.org/g:2dcdcda91921b512b978f7223c530352fd61b91b commit r8-10069-g2dcdcda91921b512b978f7223c530352fd61b91b Author: Jason Merrill <ja...@redhat.com> Date: Tue Feb 25 21:29:03 2020 -0500 PR c++/87480 - decltype of member access in default template arg The issue here is that declval<T>().d is considered instantiation-dependent within a template, as the access to 'd' might depend on the particular specialization. But when we're deducing template arguments for a call, we know that the call and the arguments are non-dependent, so we can do the substitution as though we aren't in a template. Which strictly speaking we aren't, since the default argument is considered a separate definition. gcc/cp/ChangeLog 2020-02-25 Jason Merrill <ja...@redhat.com> PR c++/87480 - decltype of member access in default template arg * pt.c (type_unification_real): Accept a dependent result in template context.