(grokdeclarator): Avoid the use of macros for ..._TYPE
authorRichard Stallman <rms@gnu.org>
Tue, 22 Jun 1993 06:07:19 +0000 (06:07 +0000)
committerRichard Stallman <rms@gnu.org>
Tue, 22 Jun 1993 06:07:19 +0000 (06:07 +0000)
nodes in cases where a parameter's type is error_mark_node.

From-SVN: r4708

gcc/c-decl.c

index 5a347e31d7c351627abac63b8ab1274d18e8ead9..08f003e1f0e5098559f9890d330336789e3f0390 100644 (file)
@@ -4457,13 +4457,16 @@ grokdeclarator (declarator, declspecs, decl_context, initialized)
           When there is a prototype, this is overridden later.  */
 
        DECL_ARG_TYPE (decl) = type;
-       main_type = TYPE_MAIN_VARIANT (type);
+       main_type = (type == error_mark_node
+                    ? error_mark_node
+                    : TYPE_MAIN_VARIANT (type));
        if (main_type == float_type_node)
          DECL_ARG_TYPE (decl) = double_type_node;
        /* Don't use TYPE_PRECISION to decide whether to promote,
           because we should convert short if it's the same size as int,
           but we should not convert long if it's the same size as int.  */
-       else if (C_PROMOTING_INTEGER_TYPE_P (main_type))
+       else if (TREE_CODE (main_type) != ERROR_MARK
+                && C_PROMOTING_INTEGER_TYPE_P (main_type))
          {
            if (TYPE_PRECISION (type) == TYPE_PRECISION (integer_type_node)
                && TREE_UNSIGNED (type))