From: Jason Merrill Date: Tue, 7 May 2019 22:37:14 +0000 (-0400) Subject: A non-type template parm with a placeholder type is type-dependent. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=258195f165f69c31c953716ece6e0922b651cd5b;p=gcc.git 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 --- diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index e974951dc52..bd0914b8ffa 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 2f2066e297c..92b67106d63 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