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:44:44 +0000 (20:44 +0000)
committerAlexandre Oliva <oliva@gcc.gnu.org>
Fri, 6 Aug 1999 20:44:44 +0000 (20:44 +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: r28556

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

index 88180be64b47c05014b46de22c140d9ad11adaf7..c861db667f6497c89ede7924bebccca3b477ff86 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.
+
 1999-08-06  Jason Merrill  <jason@yorick.cygnus.com>
 
        * typeck2.c (add_exception_specifier): Use complete_type.
index 67b71088deee86fdc0b19b34ff9c0818922f3c72..93eb61f4ca9ac6c63318967b6e5dec9afe4d04a5 100644 (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;
                  }
 
index b516cb9981f30f580eb9922d9a0fd35a70445689..357b1d1694d0b77fed8b75b7540f3103d3c5890c 100644 (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))