From 258195f165f69c31c953716ece6e0922b651cd5b Mon Sep 17 00:00:00 2001 From: Jason Merrill Date: Tue, 7 May 2019 18:37:14 -0400 Subject: [PATCH] A non-type template parm with a placeholder type is type-dependent. * pt.c (type_dependent_expression_p): A non-type template parm with a placeholder type is type-dependent. From-SVN: r270984 --- gcc/cp/ChangeLog | 5 +++++ gcc/cp/pt.c | 7 +++++++ 2 files changed, 12 insertions(+) diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index e974951dc525..bd0914b8ffad 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,8 @@ +2019-05-07 Jason Merrill + + * pt.c (type_dependent_expression_p): A non-type template parm with + a placeholder type is type-dependent. + 2019-05-06 Marek Polacek PR c++/90265 - ICE with generic lambda. diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c index 2f2066e297cf..92b67106d630 100644 --- a/gcc/cp/pt.c +++ b/gcc/cp/pt.c @@ -25981,6 +25981,13 @@ type_dependent_expression_p (tree expression) return false; } + /* The type of a non-type template parm declared with a placeholder type + depends on the corresponding template argument, even though + placeholders are not normally considered dependent. */ + if (TREE_CODE (expression) == TEMPLATE_PARM_INDEX + && is_auto (TREE_TYPE (expression))) + return true; + gcc_assert (TREE_CODE (expression) != TYPE_DECL); /* Dependent type attributes might not have made it from the decl to -- 2.47.2