]> git.ipfire.org Git - thirdparty/gcc.git/commit - gcc/cp/ChangeLog
PR c++/87480 - decltype of member access in default template arg
authorjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 20 Mar 2019 20:31:40 +0000 (20:31 +0000)
committerjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 20 Mar 2019 20:31:40 +0000 (20:31 +0000)
commit0f86e901b85a4424983136ca9ea2cc3d24074f20
tree2150935ef639b1e97f5dcdda3907facd092ba69b
parentf374a5347b4d3b21be55a548e66e7b350dfc20d1
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.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@269826 138bc75d-0d04-0410-961f-82ee72b054a4
gcc/cp/ChangeLog
gcc/cp/pt.c
gcc/testsuite/g++.dg/cpp0x/fntmpdefarg11.C [new file with mode: 0644]