On 05/09/2011 07:41 PM, Nathan Froyd wrote:
I present the patch below.  We have a new function,
cp_tree_operand_length, and the code has been retrofitted to use it in
various places.

I've changed iterative_hash_template_arg to use it as well.

Tested x86_64-pc-linux-gnu, applying to trunk.
commit 9a83e9c63ea02e71cfb9df81478a4aed98a58611
Author: Jason Merrill <ja...@redhat.com>
Date:   Thu Jun 30 18:35:10 2011 -0400

    	* pt.c (iterative_hash_template_arg): Use cp_tree_operand_length.

diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c
index dc6cd50..4903044 100644
--- a/gcc/cp/pt.c
+++ b/gcc/cp/pt.c
@@ -1609,7 +1609,7 @@ iterative_hash_template_arg (tree arg, hashval_t val)
     default:
       gcc_assert (IS_EXPR_CODE_CLASS (tclass));
       {
-	unsigned n = TREE_OPERAND_LENGTH (arg);
+	unsigned n = cp_tree_operand_length (arg);
 	for (i = 0; i < n; ++i)
 	  val = iterative_hash_template_arg (TREE_OPERAND (arg, i), val);
 	return val;

Reply via email to