diff options
author | jason <jason@138bc75d-0d04-0410-961f-82ee72b054a4> | 1999-11-16 05:58:53 +0000 |
---|---|---|
committer | jason <jason@138bc75d-0d04-0410-961f-82ee72b054a4> | 1999-11-16 05:58:53 +0000 |
commit | 949d8cc7cbf5579c37eaf38fc213fef4e1cad79b (patch) | |
tree | ca6c9cce9e4129906d4a0872614e20d73ac7171c /gcc/cp/pt.c | |
parent | 9ffd5d6d55f198455c1715b04476596dd7a6a898 (diff) | |
download | gcc-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/pt.c')
-rw-r--r-- | gcc/cp/pt.c | 10 |
1 files changed, 6 insertions, 4 deletions
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: |