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
This commit is contained in:
parent
8633f25cf5
commit
09d2f85f41
4 changed files with 35 additions and 1 deletions
|
@ -1,3 +1,8 @@
|
|||
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
|
||||
|
|
15
gcc/cp/pt.c
15
gcc/cp/pt.c
|
@ -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)
|
||||
|
|
|
@ -1,3 +1,8 @@
|
|||
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,
|
||||
|
|
11
gcc/testsuite/g++.dg/template/dependent-name1.C
Normal file
11
gcc/testsuite/g++.dg/template/dependent-name1.C
Normal file
|
@ -0,0 +1,11 @@
|
|||
// { 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]);
|
||||
}
|
Loading…
Add table
Reference in a new issue