From: Alexandre Oliva Date: Fri, 6 Aug 1999 20:44:44 +0000 (+0000) Subject: pt.c (tsubst): Use build_index_type to build in-template array index type. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=f05f680ac04280bdc08ecb82385a603a69866c93;p=gcc.git 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 --- diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 88180be64b4..c861db667f6 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,10 @@ +1999-08-06 Alexandre Oliva + + * 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 * typeck2.c (add_exception_specifier): Use complete_type. diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c index 67b71088dee..93eb61f4ca9 100644 --- a/gcc/cp/decl.c +++ b/gcc/cp/decl.c @@ -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; } diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c index b516cb9981f..357b1d1694d 100644 --- a/gcc/cp/pt.c +++ b/gcc/cp/pt.c @@ -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))