Jakub Jelinek <jj@ultra.linux.cz>
authorJakub Jelinek <jj@ultra.linux.cz>
Mon, 2 Aug 1999 23:14:12 +0000 (01:14 +0200)
committerRichard Henderson <rth@gcc.gnu.org>
Mon, 2 Aug 1999 23:14:12 +0000 (16:14 -0700)
        * call.c (convert_default_arg, build_over_call): Change all uses of
        PROMOTE_PROTOTYPES, so that it tests it as a C expression.
        Ensure expr.h is included.
        * decl.c (grokparams): Ditto.
        * pt.c (tsubst_decl): Ditto.
        * typeck.c (convert_arguments): Ditto.

From-SVN: r28418

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

index 9ba2082157f4af097b825af6a8bd41e9d81232e2..0858a28d3221434080bef4ea605f13b60737adfb 100644 (file)
@@ -1,3 +1,12 @@
+1999-08-02  Jakub Jelinek  <jj@ultra.linux.cz>
+
+       * call.c (convert_default_arg, build_over_call): Change all uses of
+       PROMOTE_PROTOTYPES, so that it tests it as a C expression.
+       Ensure expr.h is included.
+       * decl.c (grokparams): Ditto.
+       * pt.c (tsubst_decl): Ditto.
+       * typeck.c (convert_arguments): Ditto.
+
 1999-08-02  Jason Merrill  <jason@yorick.cygnus.com>
 
        * class.c (mark_overriders): Fix order of args to overrides.
index 4ab496888fc6be1e68bbb4e418ffd0d64ab904a2..1a5f9fe550de8332d6f1c91f67947ecb4f6d0643 100644 (file)
@@ -31,6 +31,7 @@ Boston, MA 02111-1307, USA.  */
 #include "flags.h"
 #include "rtl.h"
 #include "toplev.h"
+#include "expr.h"
 
 #include "obstack.h"
 #define obstack_chunk_alloc xmalloc
@@ -3827,12 +3828,11 @@ convert_default_arg (type, arg, fn)
 
       arg = convert_for_initialization (0, type, arg, LOOKUP_NORMAL,
                                        "default argument", 0, 0);
-#ifdef PROMOTE_PROTOTYPES
-      if ((TREE_CODE (type) == INTEGER_TYPE
-          || TREE_CODE (type) == ENUMERAL_TYPE)
+      if (PROMOTE_PROTOTYPES
+         && (TREE_CODE (type) == INTEGER_TYPE
+             || TREE_CODE (type) == ENUMERAL_TYPE)
          && (TYPE_PRECISION (type) < TYPE_PRECISION (integer_type_node)))
        arg = default_conversion (arg);
-#endif
     }
 
   return arg;
@@ -3943,12 +3943,11 @@ build_over_call (cand, args, flags)
          val = convert_like (conv, TREE_VALUE (arg));
        }
 
-#ifdef PROMOTE_PROTOTYPES
-      if ((TREE_CODE (type) == INTEGER_TYPE
-          || TREE_CODE (type) == ENUMERAL_TYPE)
+      if (PROMOTE_PROTOTYPES
+         && (TREE_CODE (type) == INTEGER_TYPE
+             || TREE_CODE (type) == ENUMERAL_TYPE)
          && (TYPE_PRECISION (type) < TYPE_PRECISION (integer_type_node)))
        val = default_conversion (val);
-#endif
       converted_args = expr_tree_cons (NULL_TREE, val, converted_args);
     }
 
index bbbf7be89e181e67e2c97a618c00242ca7419ecf..94a010f16d3e9801d6a1a280f9d7ba4a9258d478 100644 (file)
@@ -42,6 +42,7 @@ Boston, MA 02111-1307, USA.  */
 #include "except.h"
 #include "toplev.h"
 #include "../hash.h"
+#include "expr.h"
 
 #define obstack_chunk_alloc xmalloc
 #define obstack_chunk_free free
@@ -11652,12 +11653,11 @@ grokparms (first_parm, funcdef_flag)
 
              /* Since there is a prototype, args are passed in their own types.  */
              DECL_ARG_TYPE (decl) = TREE_TYPE (decl);
-#ifdef PROMOTE_PROTOTYPES
-             if ((TREE_CODE (type) == INTEGER_TYPE
-                  || TREE_CODE (type) == ENUMERAL_TYPE)
+             if (PROMOTE_PROTOTYPES
+                 && (TREE_CODE (type) == INTEGER_TYPE
+                     || TREE_CODE (type) == ENUMERAL_TYPE)
                  && TYPE_PRECISION (type) < TYPE_PRECISION (integer_type_node))
                DECL_ARG_TYPE (decl) = integer_type_node;
-#endif
              if (!any_error && init)
                {
                  any_init++;
index e5e5d7ef674ee2799bdf0cbc087eb527d0b5042d..d3f1a7e6f78c5d41b558166146253a520287414f 100644 (file)
@@ -41,6 +41,7 @@ Boston, MA 02111-1307, USA.  */
 #include "toplev.h"
 #include "rtl.h"
 #include "varray.h"
+#include "expr.h"
 
 /* The type of functions taking a tree, and some additional data, and
    returning an int.  */
@@ -5839,12 +5840,11 @@ tsubst_decl (t, args, type, in_decl)
                                     /*complain=*/1, in_decl);
 
        DECL_CONTEXT (r) = NULL_TREE;
-#ifdef PROMOTE_PROTOTYPES
-       if ((TREE_CODE (type) == INTEGER_TYPE
-            || TREE_CODE (type) == ENUMERAL_TYPE)
+       if (PROMOTE_PROTOTYPES
+           && (TREE_CODE (type) == INTEGER_TYPE
+               || TREE_CODE (type) == ENUMERAL_TYPE)
            && TYPE_PRECISION (type) < TYPE_PRECISION (integer_type_node))
          DECL_ARG_TYPE (r) = integer_type_node;
-#endif
        if (TREE_CHAIN (t))
          TREE_CHAIN (r) = tsubst (TREE_CHAIN (t), args,
                                   /*complain=*/1, TREE_CHAIN (t));
index cd0652f7529aebe12cb916f71f9a1d04e8ede457..2b268f85b9d64e9e4c2fa8136823ed0f91bb00a0 100644 (file)
@@ -3204,13 +3204,12 @@ convert_arguments (typelist, values, fndecl, flags)
              parmval = convert_for_initialization
                (NULL_TREE, type, val, flags,
                 "argument passing", fndecl, i);
-#ifdef PROMOTE_PROTOTYPES
-             if ((TREE_CODE (type) == INTEGER_TYPE
-                  || TREE_CODE (type) == ENUMERAL_TYPE)
+             if (PROMOTE_PROTOTYPES
+                 && (TREE_CODE (type) == INTEGER_TYPE
+                     || TREE_CODE (type) == ENUMERAL_TYPE)
                  && (TYPE_PRECISION (type)
                      < TYPE_PRECISION (integer_type_node)))
                parmval = default_conversion (parmval);
-#endif
            }
 
          if (parmval == error_mark_node)