summaryrefslogtreecommitdiff
path: root/gcc/cp
diff options
context:
space:
mode:
authorjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>1999-11-16 05:58:53 +0000
committerjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>1999-11-16 05:58:53 +0000
commit949d8cc7cbf5579c37eaf38fc213fef4e1cad79b (patch)
treeca6c9cce9e4129906d4a0872614e20d73ac7171c /gcc/cp
parent9ffd5d6d55f198455c1715b04476596dd7a6a898 (diff)
downloadgcc-949d8cc7cbf5579c37eaf38fc213fef4e1cad79b.tar.gz
* cp-tree.h, decl.c (compute_array_index_type): Make nonstatic.
* pt.c (tsubst, case INTEGER_TYPE): Call it. Check uses_template_parms. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@30548 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cp')
-rw-r--r--gcc/cp/ChangeLog4
-rw-r--r--gcc/cp/cp-tree.h3
-rw-r--r--gcc/cp/decl.c15
-rw-r--r--gcc/cp/pt.c10
4 files changed, 20 insertions, 12 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index cc45c1e0bda..9bdfe91f2ce 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,5 +1,9 @@
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
diff --git a/gcc/cp/cp-tree.h b/gcc/cp/cp-tree.h
index 47a88b7b9c0..dfa934e6d19 100644
--- a/gcc/cp/cp-tree.h
+++ b/gcc/cp/cp-tree.h
@@ -3497,8 +3497,9 @@ extern int in_function_p PROTO((void));
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));
diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c
index 11073f93ddb..38451dddd1e 100644
--- a/gcc/cp/decl.c
+++ b/gcc/cp/decl.c
@@ -175,7 +175,6 @@ static void destroy_local_static PROTO((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)
@@ -7033,7 +7032,9 @@ layout_var_decl (decl)
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
@@ -8679,7 +8680,7 @@ check_static_variable_definition (decl, type)
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;
@@ -13469,15 +13470,15 @@ finish_function (lineno, flags)
}
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);
@@ -13489,8 +13490,8 @@ finish_function (lineno, flags)
/* 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 ();
diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c
index 7e72accd62f..7e3a8abd088 100644
--- a/gcc/cp/pt.c
+++ b/gcc/cp/pt.c
@@ -6179,8 +6179,11 @@ tsubst (t, args, complain, in_decl)
/* 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;
@@ -6210,8 +6213,7 @@ tsubst (t, args, complain, in_decl)
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: