https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87480

--- Comment #4 from Jason Merrill <jason at gcc dot gnu.org> ---
Author: jason
Date: Wed Mar 20 20:31:40 2019
New Revision: 269826

URL: https://gcc.gnu.org/viewcvs?rev=269826&root=gcc&view=rev
Log:
        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.

        * pt.c (type_unification_real): Accept a dependent result in
        template context.

Added:
    trunk/gcc/testsuite/g++.dg/cpp0x/fntmpdefarg11.C
Modified:
    trunk/gcc/cp/ChangeLog
    trunk/gcc/cp/pt.c

Reply via email to