*** empty log message ***
authorRichard Stallman <rms@gnu.org>
Mon, 4 May 1992 03:04:19 +0000 (03:04 +0000)
committerRichard Stallman <rms@gnu.org>
Mon, 4 May 1992 03:04:19 +0000 (03:04 +0000)
From-SVN: r879

gcc/c-typeck.c

index 70bebe4795ac86d4c04b06e82d718a3c9e5e3ab6..464e5f483f9e85feb555cc487fd4f6efe4aae839 100644 (file)
@@ -1147,7 +1147,6 @@ build_array_ref (array, index)
     {
       tree rval, type;
 
-      index = default_conversion (index);
       if (index != error_mark_node
          && TREE_CODE (TREE_TYPE (index)) != INTEGER_TYPE)
        {
@@ -1165,6 +1164,9 @@ build_array_ref (array, index)
          && TYPE_MAIN_VARIANT (TREE_TYPE (index)) == char_type_node)
        warning ("array subscript has type `char'");
 
+      /* Apply default promotions *after* noticing character types.  */
+      index = default_conversion (index);
+
       /* An array that is indexed by a non-constant
         cannot be stored in a register; we must be able to do
         address arithmetic on its address.