On 1/30/19 11:25 AM, Alexandre Oliva wrote:
On Jan 30, 2019, Jason Merrill <ja...@redhat.com> wrote:

Hmm, I wouldn't expect that from a function named
"instantiates_primary_template_p".

Hmm, indeed.

Perhaps another function that calls instantiates_primary_template_p
and then checks for dependent innermost template args?

Does that come up as often?  If not, I'll just leave that part of the
test where it was.

We know tmpl is a decl, so we can unconditionally take its DECL_CONTEXT.

Note that I'm talking about the "tmpl" variable, not "node".

Ahh, sorry, I missed that.  Nice!

Here's what I regstrapped overnight.  Ok to install?


[PR87770] test partial specializations for type dependence

From: Alexandre Oliva <aol...@redhat.com>

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.

OK.

Jason

Reply via email to