Commit 09d2f85f by Kriang Lerdsuwanakij Committed by Kriang Lerdsuwanakij

re PR c++/10347 (tree check ICE in dependent_type_p)

	PR c++/10347
	* pt.c (type_dependent_expression_p): Handle array new.

	g++.dg/template/dependent-name1.C: New test.

From-SVN: r65742
parent 8633f25c
2003-04-17 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
PR c++/10347
* pt.c (type_dependent_expression_p): Handle array new.
2003-04-15 Mark Mitchell <mark@codesourcery.com>
PR c++/10381
......
......@@ -11562,7 +11562,20 @@ type_dependent_expression_p (expression)
by the expression. */
else if (TREE_CODE (expression) == NEW_EXPR
|| TREE_CODE (expression) == VEC_NEW_EXPR)
return dependent_type_p (TREE_OPERAND (expression, 1));
{
/* For NEW_EXPR tree nodes created inside a template, either
the object type itself or a TREE_LIST may appear as the
operand 1. */
tree type = TREE_OPERAND (expression, 1);
if (TREE_CODE (type) == TREE_LIST)
/* This is an array type. We need to check array dimensions
as well. */
return dependent_type_p (TREE_VALUE (TREE_PURPOSE (type)))
|| value_dependent_expression_p
(TREE_OPERAND (TREE_VALUE (type), 1));
else
return dependent_type_p (type);
}
if (TREE_CODE (expression) == FUNCTION_DECL
&& DECL_LANG_SPECIFIC (expression)
......
2003-04-17 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
PR c++/10347
g++.dg/template/dependent-name1.C: New test.
2003-04-17 J"orn Rennecke <joern.rennecke@superh.com>
* gcc.dg/warn-1.c (tourist_guide): New array,
......
// { dg-do compile }
// Origin: Wolfgang Bangerth <bangerth@ticam.utexas.edu>
// PR c++/10347: Dependent type checking of array new expression
void bar (int *);
template <int> void foo() {
bar(new int[1]);
}
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