c++: cp_tree_equal tweaks
authorNathan Sidwell <nathan@acm.org>
Fri, 11 Dec 2020 16:22:57 +0000 (08:22 -0800)
committerNathan Sidwell <nathan@acm.org>
Fri, 11 Dec 2020 16:28:19 +0000 (08:28 -0800)
commit059da609fa8b3a08d1d6618f9d90dc3cfbcd05bc
tree8ef1891954a5d66472c298c94ec1d481511dc6ca
parent75de6a2895f503905589934e30c68b9a5ec41f2f
c++: cp_tree_equal tweaks

When comparing streamed trees we can encounter NON_LVALUE_EXPR and
VIEW_CONVERT_EXPRs with null types.  Also, when checking a potential
duplicate we don't want to reject PARM_DECLs with different contexts,
if those two contexts are the two decls of interest.

gcc/cp/
* cp-tree.h (map_context_from, map_context_to): Declare.
* module.cc (map_context_from, map_context_to): Define.
* tree.c (cp_tree_equal): Check map_context_{from,to} for parm
context difference.  Allow NON_LVALUE_EXPR and VIEW_CONVERT_EXPR
with null types.
gcc/cp/cp-tree.h
gcc/cp/module.cc
gcc/cp/tree.c