diff options
author | Jason Merrill <jason@redhat.com> | 2019-05-07 18:37:14 -0400 |
---|---|---|
committer | Jason Merrill <jason@gcc.gnu.org> | 2019-05-07 18:37:14 -0400 |
commit | 258195f165f69c31c953716ece6e0922b651cd5b (patch) | |
tree | bf05c52e5bf182e538ec540b4e9b0a437c9a2511 | |
parent | 76ddb9ebd9de3bc35f69f93a3e3769589d1b7d35 (diff) | |
download | gcc-258195f165f69c31c953716ece6e0922b651cd5b.zip gcc-258195f165f69c31c953716ece6e0922b651cd5b.tar.gz gcc-258195f165f69c31c953716ece6e0922b651cd5b.tar.bz2 |
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
-rw-r--r-- | gcc/cp/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/cp/pt.c | 7 |
2 files changed, 12 insertions, 0 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index e974951..bd0914b 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,8 @@ +2019-05-07 Jason Merrill <jason@redhat.com> + + * pt.c (type_dependent_expression_p): A non-type template parm with + a placeholder type is type-dependent. + 2019-05-06 Marek Polacek <polacek@redhat.com> PR c++/90265 - ICE with generic lambda. diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c index 2f2066e..92b6710 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 |