[PR87770] test partial specializations for type dependence
authorAlexandre Oliva <aoliva@redhat.com>
Tue, 5 Feb 2019 06:11:25 +0000 (06:11 +0000)
committerAlexandre Oliva <aoliva@gcc.gnu.org>
Tue, 5 Feb 2019 06:11:25 +0000 (06:11 +0000)
commite1bbb0bcf74966cbd5199d6391bdef5e8f592ef1
tree743a7747d3c6a4ce4c8fdd73e126c6da2f16539c
parentca0107a731027066b62a78d9d8c9bd0e7084b8fa
[PR87770] test partial specializations for type dependence

When instantiating a partial specialization of a template member
function for a full specialization of a class template, we test
whether the context of variables local to the partial specialization,
i.e., the partial specialization itself, is dependent, and this ICEs
in type_dependent_expression_p, when checking that the function type
isn't type-dependent because it is not in a type-dependent scope.

We shouldn't have got that far: the previous block in
type_dependent_expression_p catches cases in which the function itself
takes template arguments of its own, but it only did so for primary
templates, not for partial specializations.  This patch fixes that.

for  gcc/cp/ChangeLog

PR c++/87770
* pt.c (instantiates_primary_template_p): New.
(type_dependent_expression_p): Use it.

for  gcc/testsuite/ChangeLog

PR c++/87770
* g++.dg/pr87770.C: New.

From-SVN: r268529
gcc/cp/ChangeLog
gcc/cp/pt.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/pr87770.C [new file with mode: 0644]