diff options
author | Jason Merrill <jason@redhat.com> | 2019-11-06 19:31:52 -0500 |
---|---|---|
committer | Jason Merrill <jason@gcc.gnu.org> | 2019-11-06 19:31:52 -0500 |
commit | 951c6f3dd975d795adc409da1a1477b5229199ae (patch) | |
tree | e2b9d02d58c552313d9ffaec0ca00acc474cb106 /gcc/cp | |
parent | 81a34a6b68184436726489b81d44267c40f6fbe7 (diff) | |
download | gcc-951c6f3dd975d795adc409da1a1477b5229199ae.zip gcc-951c6f3dd975d795adc409da1a1477b5229199ae.tar.gz gcc-951c6f3dd975d795adc409da1a1477b5229199ae.tar.bz2 |
PR c++/92150 - partial specialization with class NTTP.
Here unify was getting confused by the VIEW_CONVERT_EXPR we add in
finish_id_expression_1 to make class NTTP const when they're used in an
expression.
Tested x86_64-pc-linux-gnu, applying to trunk.
* pt.c (unify): Handle VIEW_CONVERT_EXPR.
From-SVN: r277901
Diffstat (limited to 'gcc/cp')
-rw-r--r-- | gcc/cp/ChangeLog | 3 | ||||
-rw-r--r-- | gcc/cp/pt.c | 5 |
2 files changed, 6 insertions, 2 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index cf3e00a..8f6a71a 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,5 +1,8 @@ 2019-11-06 Jason Merrill <jason@redhat.com> + PR c++/92150 - partial specialization with class NTTP. + * pt.c (unify): Handle VIEW_CONVERT_EXPR. + * pt.c (use_pack_expansion_extra_args_p): Still do substitution if all packs are simple pack expansions. (add_extra_args): Check that the extra args aren't dependent. diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c index c8df1d0..061a92c 100644 --- a/gcc/cp/pt.c +++ b/gcc/cp/pt.c @@ -22571,8 +22571,9 @@ unify (tree tparms, tree targs, tree parm, tree arg, int strict, /* I don't think this will do the right thing with respect to types. But the only case I've seen it in so far has been array bounds, where signedness is the only information lost, and I think that will be - okay. */ - while (CONVERT_EXPR_P (parm)) + okay. VIEW_CONVERT_EXPR can appear with class NTTP, thanks to + finish_id_expression_1, and are also OK. */ + while (CONVERT_EXPR_P (parm) || TREE_CODE (parm) == VIEW_CONVERT_EXPR) parm = TREE_OPERAND (parm, 0); if (arg == error_mark_node) |