diff options
author | Jakub Jelinek <jj@ultra.linux.cz> | 1999-08-03 01:14:12 +0200 |
---|---|---|
committer | Richard Henderson <rth@gcc.gnu.org> | 1999-08-02 16:14:12 -0700 |
commit | fa56377de3213de3b1f2cc263cfda2843a610685 (patch) | |
tree | 54437d1d5bb898c54fd276ecda231468f447b527 | |
parent | 40cae311f5c7317fcc247e334517fb8c431e973f (diff) | |
download | gcc-fa56377de3213de3b1f2cc263cfda2843a610685.zip gcc-fa56377de3213de3b1f2cc263cfda2843a610685.tar.gz gcc-fa56377de3213de3b1f2cc263cfda2843a610685.tar.bz2 |
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.
From-SVN: r28418
-rw-r--r-- | gcc/cp/ChangeLog | 9 | ||||
-rw-r--r-- | gcc/cp/call.c | 15 | ||||
-rw-r--r-- | gcc/cp/decl.c | 8 | ||||
-rw-r--r-- | gcc/cp/pt.c | 8 | ||||
-rw-r--r-- | gcc/cp/typeck.c | 7 |
5 files changed, 27 insertions, 20 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 9ba2082..0858a28 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -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. diff --git a/gcc/cp/call.c b/gcc/cp/call.c index 4ab4968..1a5f9fe 100644 --- a/gcc/cp/call.c +++ b/gcc/cp/call.c @@ -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); } diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c index bbbf7be..94a010f 100644 --- a/gcc/cp/decl.c +++ b/gcc/cp/decl.c @@ -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++; diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c index e5e5d7e..d3f1a7e 100644 --- a/gcc/cp/pt.c +++ b/gcc/cp/pt.c @@ -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)); diff --git a/gcc/cp/typeck.c b/gcc/cp/typeck.c index cd0652f..2b268f8 100644 --- a/gcc/cp/typeck.c +++ b/gcc/cp/typeck.c @@ -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) |