+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
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,
--- /dev/null
+// { 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]);
+}