* cp-tree.h, decl.c (compute_array_index_type): Make nonstatic.
* pt.c (tsubst, case INTEGER_TYPE): Call it.
Check uses_template_parms.
From-SVN: r30548
1999-11-15 Jason Merrill <jason@casey.cygnus.com>
+ * cp-tree.h, decl.c (compute_array_index_type): Make nonstatic.
+ * pt.c (tsubst, case INTEGER_TYPE): Call it.
+ Check uses_template_parms.
+
* class.c (finish_struct): If we're a local class in a template
function, add a TAG_DEFN.
* pt.c (lookup_template_class): If this is a local class in a
extern void replace_defarg PROTO((tree, tree));
extern void print_other_binding_stack PROTO((struct binding_level *));
extern void revert_static_member_fn PROTO((tree*, tree*, tree*));
-extern void fixup_anonymous_aggr PROTO((tree));
+extern void fixup_anonymous_aggr PROTO((tree));
extern int check_static_variable_definition PROTO((tree, tree));
+extern tree compute_array_index_type PROTO((tree, tree));
extern void push_local_binding PROTO((tree, tree, int));
extern int push_class_binding PROTO((tree, tree));
extern tree check_default_argument PROTO((tree, tree));
static void destroy_local_var PROTO((tree));
static void finish_constructor_body PROTO((void));
static void finish_destructor_body PROTO((void));
-static tree compute_array_index_type PROTO((tree, tree));
static tree create_array_type_for_decl PROTO((tree, tree, tree));
#if defined (DEBUG_CP_BINDING_LEVELS)
tree decl;
{
tree type = TREE_TYPE (decl);
+#if 0
tree ttype = target_type (type);
+#endif
/* If we haven't already layed out this declaration, do so now.
Note that we must not call complete type for an external object
appropriate index type for the array. If non-NULL, NAME is the
name of the thing being declared. */
-static tree
+tree
compute_array_index_type (name, size)
tree name;
tree size;
}
else
{
+#if 0
if (write_symbols != NO_DEBUG /*&& TREE_CODE (fntype) != METHOD_TYPE*/)
{
- tree ttype = target_type (fntype);
- tree parmdecl;
-
-#if 0
/* Keep this code around in case we later want to control debug info
based on whether a type is "used". (jason 1999-11-11) */
+ tree ttype = target_type (fntype);
+ tree parmdecl;
+
if (IS_AGGR_TYPE (ttype))
/* Let debugger know it should output info for this type. */
note_debug_info_needed (ttype);
/* Let debugger know it should output info for this type. */
note_debug_info_needed (ttype);
}
-#endif
}
+#endif
/* Clean house because we will need to reorder insns here. */
do_pending_stack_adjust ();
/* When providing explicit arguments to a template
function, but leaving some arguments for subsequent
deduction, MAX may be template-dependent even if we're
- not PROCESSING_TEMPLATE_DECL. */
- || TREE_CODE (max) != INTEGER_CST)
+ not PROCESSING_TEMPLATE_DECL. We still need to check for
+ template parms, though; MAX won't be an INTEGER_CST for
+ dynamic arrays, either. */
+ || (TREE_CODE (max) != INTEGER_CST
+ && uses_template_parms (max)))
{
tree itype = make_node (INTEGER_TYPE);
TYPE_MIN_VALUE (itype) = size_zero_node;
return error_mark_node;
}
- max = fold (build_binary_op (MINUS_EXPR, max, integer_one_node));
- return build_index_type (max);
+ return compute_array_index_type (NULL_TREE, max);
}
case TEMPLATE_TYPE_PARM: