Commit 26b3e568 by Nathan Sidwell

[PR94044] Fix ICE with sizeof<argumentpack>

Thanks to Jim for figuring out how to reproduce the problem, I was
able to apply pr94044-jig.diff to poorly hash the specialization
table. (That places all the specializations of a particular template
in the same bucket, forcing us to compare the arguments.)

The testcase creates sizeof_exprs containing argument packs, and we
can no longer use same_type_p on those.

	PR c++/94044
	* tree.c (cp_tree_equal) [SIZEOF_EXPR]: Detect argument pack
	operand.
parent 7a2090b0
2020-03-23 nathans <nathan@acm.org>
PR c++/94044
* tree.c (cp_tree_equal) [SIZEOF_EXPR]: Detect argument pack
operand.
2020-03-21 Patrick Palka <ppalka@redhat.com>
PR c++/94066
......
......@@ -3802,9 +3802,13 @@ cp_tree_equal (tree t1, tree t2)
if (SIZEOF_EXPR_TYPE_P (t2))
o2 = TREE_TYPE (o2);
}
if (TREE_CODE (o1) != TREE_CODE (o2))
return false;
if (TYPE_P (o1))
if (ARGUMENT_PACK_P (o1))
return template_args_equal (o1, o2);
else if (TYPE_P (o1))
return same_type_p (o1, o2);
else
return cp_tree_equal (o1, o2);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment