From: Alexandre Oliva Date: Fri, 6 Aug 1999 20:42:55 +0000 (+0000) Subject: pt.c (tsubst): Use build_index_type to build in-template array index type. X-Git-Tag: releases/gcc-2.95.1~31 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=86527298182590b9339fd41779218933caa35413;p=thirdparty%2Fgcc.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: r28555 --- diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 8457fdd13189..153c4260bb5c 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. + Thu Aug 5 02:40:42 1999 Jeffrey A Law (law@cygnus.com) * typeck2.c: Update URLs and mail addresses. diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c index 36f6baed068f..a3e18798056a 100644 --- a/gcc/cp/decl.c +++ b/gcc/cp/decl.c @@ -10387,10 +10387,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 e1860ed719e4..5789c3f74a6a 100644 --- a/gcc/cp/pt.c +++ b/gcc/cp/pt.c @@ -6136,11 +6136,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))