(grokdeclarator): For PARM_DECLs, only call
authorRichard Stallman <rms@gnu.org>
Sun, 5 Sep 1993 22:35:15 +0000 (22:35 +0000)
committerRichard Stallman <rms@gnu.org>
Sun, 5 Sep 1993 22:35:15 +0000 (22:35 +0000)
c_build_type_variant is constp or volatilep is true.

From-SVN: r5263

gcc/c-decl.c

index 4d9424ff660cbaceb13277aeccf8d829da2a3e4d..df0a515b9c6cf17a087d98ef813dfcab2e8edafb 100644 (file)
@@ -4481,8 +4481,10 @@ grokdeclarator (declarator, declspecs, decl_context, initialized)
        if (TREE_CODE (type) == ARRAY_TYPE)
          {
            /* Transfer const-ness of array into that of type pointed to.  */
-           type = build_pointer_type
-                   (c_build_type_variant (TREE_TYPE (type), constp, volatilep));
+           type = TREE_TYPE (type);
+           if (constp || volatilep)
+             type = c_build_type_variant (type, constp, volatilep);
+           type = build_pointer_type (type);
            volatilep = constp = 0;
            size_varies = 0;
          }
@@ -4490,7 +4492,9 @@ grokdeclarator (declarator, declspecs, decl_context, initialized)
          {
            if (pedantic && (constp || volatilep))
              pedwarn ("ANSI C forbids const or volatile function types");
-           type = build_pointer_type (c_build_type_variant (type, constp, volatilep));
+           if (constp || volatilep)
+             type = c_build_type_variant (type, constp, volatilep);
+           type = build_pointer_type (type);
            volatilep = constp = 0;
          }