]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
pt.c (tsubst): Use build_index_type to build in-template array index type.
authorAlexandre Oliva <oliva@dcc.unicamp.br>
Fri, 6 Aug 1999 20:42:55 +0000 (20:42 +0000)
committerAlexandre Oliva <oliva@gcc.gnu.org>
Fri, 6 Aug 1999 20:42:55 +0000 (20:42 +0000)
* 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

gcc/cp/ChangeLog
gcc/cp/decl.c
gcc/cp/pt.c

index 8457fdd13189f3572c50e9ac10c12d7bde293b98..153c4260bb5c6fb86c07192c1ee358e07bb31ef2 100644 (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.
+
 Thu Aug  5 02:40:42 1999  Jeffrey A Law  (law@cygnus.com)
 
         * typeck2.c: Update URLs and mail addresses.
index 36f6baed068f12caa0c87639a20f45a7ae331473..a3e18798056ae3938bf39379c8efc8a8a6712be1 100644 (file)
@@ -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;
                  }
 
index e1860ed719e47c0378e49f94ecbae52e424f5245..5789c3f74a6a00f9ac6b283d176734fcec61fa8a 100644 (file)
@@ -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))