https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87770
--- Comment #10 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:d2221c1179354ad71c4944ea0cc634803aae98f1 commit r8-10066-gd2221c1179354ad71c4944ea0cc634803aae98f1 Author: Alexandre Oliva <aol...@redhat.com> Date: Tue Feb 5 06:11:25 2019 +0000 c++: test partial specializations for type dependence [PR87770] 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. gcc/cp/ChangeLog 2019-02-05 Alexandre Oliva <aol...@redhat.com> PR c++/87770 * pt.c (instantiates_primary_template_p): New. (type_dependent_expression_p): Use it. gcc/testsuite/ChangeLog 2019-02-05 Alexandre Oliva <aol...@redhat.com> PR c++/87770 * g++.dg/pr87770.C: New.