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
This commit is contained in:
Alexandre Oliva 1999-08-06 20:44:44 +00:00 committed by Alexandre Oliva
parent 7339705d94
commit f05f680ac0
3 changed files with 11 additions and 9 deletions

View File

@ -1,3 +1,10 @@
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>
* typeck2.c (add_exception_specifier): Use complete_type.

View File

@ -10054,10 +10054,8 @@ grokdeclarator (declarator, declspecs, decl_context, initialized, attrlist)
size = t;
}
itype = make_node (INTEGER_TYPE);
TYPE_MIN_VALUE (itype) = size_zero_node;
TYPE_MAX_VALUE (itype) = build_min
(MINUS_EXPR, sizetype, size, integer_one_node);
itype = build_index_type (build_min
(MINUS_EXPR, sizetype, size, integer_one_node));
goto dont_grok_size;
}

View File

@ -6193,11 +6193,8 @@ tsubst (t, args, complain, in_decl)
not PROCESSING_TEMPLATE_DECL. */
|| TREE_CODE (max) != INTEGER_CST)
{
tree itype = make_node (INTEGER_TYPE);
TYPE_MIN_VALUE (itype) = size_zero_node;
TYPE_MAX_VALUE (itype) = build_min (MINUS_EXPR, sizetype, max,
integer_one_node);
return itype;
return build_index_type (build_min
(MINUS_EXPR, sizetype, max, integer_one_node));
}
if (integer_zerop (omax))