[Bug c++/13243] [3.4 Regression] Segfault on illegal template construct

giovannibajo at libero dot it gcc-bugzilla@gcc.gnu.org
Mon Dec 1 02:51:00 GMT 2003


------- Additional Comments From giovannibajo at libero dot it  2003-12-01 02:51 -------
Just another fallback of two-stage lookup, similar to c++/12573. This patch 
should fix both, but I'll test it later.

Index: pt.c
===================================================================
RCS file: /cvsroot/gcc/gcc/gcc/cp/pt.c,v
retrieving revision 1.797
diff -c -p -r1.797 pt.c
*** pt.c        22 Nov 2003 09:11:01 -0000      1.797
--- pt.c        1 Dec 2003 02:48:39 -0000
*************** value_dependent_expression_p (tree expre
*** 11713,11718 ****
--- 11713,11724 ----
      }
    if (TREE_CODE (expression) == SCOPE_REF)
      return dependent_scope_ref_p (expression, value_dependent_expression_p);
+   if (TREE_CODE (expression) == COMPONENT_REF)
+     return (value_dependent_expression_p (TREE_OPERAND (expression, 0)) ||
+             value_dependent_expression_p (TREE_OPERAND (expression, 1)));
+   if (TREE_CODE (expression) == ARRAY_REF)
+     return (value_dependent_expression_p (TREE_OPERAND (expression, 0)) ||
+             value_dependent_expression_p (TREE_OPERAND (expression, 1)));
    /* A constant expression is value-dependent if any subexpression is
       value-dependent.  */
    if (IS_EXPR_CODE_CLASS (TREE_CODE_CLASS (TREE_CODE (expression))))


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13243



More information about the Gcc-bugs mailing list