Commit f05f680a by Alexandre Oliva Committed by Alexandre Oliva

pt.c (tsubst): Use build_index_type to build in-template array index type.

* pt.c (tsubst): Use build_index_type to build in-template array
index type.  Fixes g++.oliva/dwarf1.C.
* decl.c (grokdeclarator): Likewise, just for consistency, as it
doesn't seem to trigger the bug without it.

From-SVN: r28556
parent 7339705d
1999-08-06 Alexandre Oliva <oliva@dcc.unicamp.br>
* pt.c (tsubst): Use build_index_type to build in-template array
index type. Fixes g++.oliva/dwarf1.C.
* decl.c (grokdeclarator): Likewise, just for consistency, as it
doesn't seem to trigger the bug without it.
1999-08-06 Jason Merrill <jason@yorick.cygnus.com> 1999-08-06 Jason Merrill <jason@yorick.cygnus.com>
* typeck2.c (add_exception_specifier): Use complete_type. * typeck2.c (add_exception_specifier): Use complete_type.
......
...@@ -10054,10 +10054,8 @@ grokdeclarator (declarator, declspecs, decl_context, initialized, attrlist) ...@@ -10054,10 +10054,8 @@ grokdeclarator (declarator, declspecs, decl_context, initialized, attrlist)
size = t; size = t;
} }
itype = make_node (INTEGER_TYPE); itype = build_index_type (build_min
TYPE_MIN_VALUE (itype) = size_zero_node; (MINUS_EXPR, sizetype, size, integer_one_node));
TYPE_MAX_VALUE (itype) = build_min
(MINUS_EXPR, sizetype, size, integer_one_node);
goto dont_grok_size; goto dont_grok_size;
} }
......
...@@ -6193,11 +6193,8 @@ tsubst (t, args, complain, in_decl) ...@@ -6193,11 +6193,8 @@ tsubst (t, args, complain, in_decl)
not PROCESSING_TEMPLATE_DECL. */ not PROCESSING_TEMPLATE_DECL. */
|| TREE_CODE (max) != INTEGER_CST) || TREE_CODE (max) != INTEGER_CST)
{ {
tree itype = make_node (INTEGER_TYPE); return build_index_type (build_min
TYPE_MIN_VALUE (itype) = size_zero_node; (MINUS_EXPR, sizetype, max, integer_one_node));
TYPE_MAX_VALUE (itype) = build_min (MINUS_EXPR, sizetype, max,
integer_one_node);
return itype;
} }
if (integer_zerop (omax)) if (integer_zerop (omax))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment