Commit fa56377d by Jakub Jelinek Committed by Richard Henderson

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
parent 40cae311
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> 1999-08-02 Jason Merrill <jason@yorick.cygnus.com>
* class.c (mark_overriders): Fix order of args to overrides. * class.c (mark_overriders): Fix order of args to overrides.
......
...@@ -31,6 +31,7 @@ Boston, MA 02111-1307, USA. */ ...@@ -31,6 +31,7 @@ Boston, MA 02111-1307, USA. */
#include "flags.h" #include "flags.h"
#include "rtl.h" #include "rtl.h"
#include "toplev.h" #include "toplev.h"
#include "expr.h"
#include "obstack.h" #include "obstack.h"
#define obstack_chunk_alloc xmalloc #define obstack_chunk_alloc xmalloc
...@@ -3827,12 +3828,11 @@ convert_default_arg (type, arg, fn) ...@@ -3827,12 +3828,11 @@ convert_default_arg (type, arg, fn)
arg = convert_for_initialization (0, type, arg, LOOKUP_NORMAL, arg = convert_for_initialization (0, type, arg, LOOKUP_NORMAL,
"default argument", 0, 0); "default argument", 0, 0);
#ifdef PROMOTE_PROTOTYPES if (PROMOTE_PROTOTYPES
if ((TREE_CODE (type) == INTEGER_TYPE && (TREE_CODE (type) == INTEGER_TYPE
|| TREE_CODE (type) == ENUMERAL_TYPE) || TREE_CODE (type) == ENUMERAL_TYPE)
&& (TYPE_PRECISION (type) < TYPE_PRECISION (integer_type_node))) && (TYPE_PRECISION (type) < TYPE_PRECISION (integer_type_node)))
arg = default_conversion (arg); arg = default_conversion (arg);
#endif
} }
return arg; return arg;
...@@ -3943,12 +3943,11 @@ build_over_call (cand, args, flags) ...@@ -3943,12 +3943,11 @@ build_over_call (cand, args, flags)
val = convert_like (conv, TREE_VALUE (arg)); val = convert_like (conv, TREE_VALUE (arg));
} }
#ifdef PROMOTE_PROTOTYPES if (PROMOTE_PROTOTYPES
if ((TREE_CODE (type) == INTEGER_TYPE && (TREE_CODE (type) == INTEGER_TYPE
|| TREE_CODE (type) == ENUMERAL_TYPE) || TREE_CODE (type) == ENUMERAL_TYPE)
&& (TYPE_PRECISION (type) < TYPE_PRECISION (integer_type_node))) && (TYPE_PRECISION (type) < TYPE_PRECISION (integer_type_node)))
val = default_conversion (val); val = default_conversion (val);
#endif
converted_args = expr_tree_cons (NULL_TREE, val, converted_args); converted_args = expr_tree_cons (NULL_TREE, val, converted_args);
} }
......
...@@ -42,6 +42,7 @@ Boston, MA 02111-1307, USA. */ ...@@ -42,6 +42,7 @@ Boston, MA 02111-1307, USA. */
#include "except.h" #include "except.h"
#include "toplev.h" #include "toplev.h"
#include "../hash.h" #include "../hash.h"
#include "expr.h"
#define obstack_chunk_alloc xmalloc #define obstack_chunk_alloc xmalloc
#define obstack_chunk_free free #define obstack_chunk_free free
...@@ -11652,12 +11653,11 @@ grokparms (first_parm, funcdef_flag) ...@@ -11652,12 +11653,11 @@ grokparms (first_parm, funcdef_flag)
/* Since there is a prototype, args are passed in their own types. */ /* Since there is a prototype, args are passed in their own types. */
DECL_ARG_TYPE (decl) = TREE_TYPE (decl); DECL_ARG_TYPE (decl) = TREE_TYPE (decl);
#ifdef PROMOTE_PROTOTYPES if (PROMOTE_PROTOTYPES
if ((TREE_CODE (type) == INTEGER_TYPE && (TREE_CODE (type) == INTEGER_TYPE
|| TREE_CODE (type) == ENUMERAL_TYPE) || TREE_CODE (type) == ENUMERAL_TYPE)
&& TYPE_PRECISION (type) < TYPE_PRECISION (integer_type_node)) && TYPE_PRECISION (type) < TYPE_PRECISION (integer_type_node))
DECL_ARG_TYPE (decl) = integer_type_node; DECL_ARG_TYPE (decl) = integer_type_node;
#endif
if (!any_error && init) if (!any_error && init)
{ {
any_init++; any_init++;
......
...@@ -41,6 +41,7 @@ Boston, MA 02111-1307, USA. */ ...@@ -41,6 +41,7 @@ Boston, MA 02111-1307, USA. */
#include "toplev.h" #include "toplev.h"
#include "rtl.h" #include "rtl.h"
#include "varray.h" #include "varray.h"
#include "expr.h"
/* The type of functions taking a tree, and some additional data, and /* The type of functions taking a tree, and some additional data, and
returning an int. */ returning an int. */
...@@ -5839,12 +5840,11 @@ tsubst_decl (t, args, type, in_decl) ...@@ -5839,12 +5840,11 @@ tsubst_decl (t, args, type, in_decl)
/*complain=*/1, in_decl); /*complain=*/1, in_decl);
DECL_CONTEXT (r) = NULL_TREE; DECL_CONTEXT (r) = NULL_TREE;
#ifdef PROMOTE_PROTOTYPES if (PROMOTE_PROTOTYPES
if ((TREE_CODE (type) == INTEGER_TYPE && (TREE_CODE (type) == INTEGER_TYPE
|| TREE_CODE (type) == ENUMERAL_TYPE) || TREE_CODE (type) == ENUMERAL_TYPE)
&& TYPE_PRECISION (type) < TYPE_PRECISION (integer_type_node)) && TYPE_PRECISION (type) < TYPE_PRECISION (integer_type_node))
DECL_ARG_TYPE (r) = integer_type_node; DECL_ARG_TYPE (r) = integer_type_node;
#endif
if (TREE_CHAIN (t)) if (TREE_CHAIN (t))
TREE_CHAIN (r) = tsubst (TREE_CHAIN (t), args, TREE_CHAIN (r) = tsubst (TREE_CHAIN (t), args,
/*complain=*/1, TREE_CHAIN (t)); /*complain=*/1, TREE_CHAIN (t));
......
...@@ -3204,13 +3204,12 @@ convert_arguments (typelist, values, fndecl, flags) ...@@ -3204,13 +3204,12 @@ convert_arguments (typelist, values, fndecl, flags)
parmval = convert_for_initialization parmval = convert_for_initialization
(NULL_TREE, type, val, flags, (NULL_TREE, type, val, flags,
"argument passing", fndecl, i); "argument passing", fndecl, i);
#ifdef PROMOTE_PROTOTYPES if (PROMOTE_PROTOTYPES
if ((TREE_CODE (type) == INTEGER_TYPE && (TREE_CODE (type) == INTEGER_TYPE
|| TREE_CODE (type) == ENUMERAL_TYPE) || TREE_CODE (type) == ENUMERAL_TYPE)
&& (TYPE_PRECISION (type) && (TYPE_PRECISION (type)
< TYPE_PRECISION (integer_type_node))) < TYPE_PRECISION (integer_type_node)))
parmval = default_conversion (parmval); parmval = default_conversion (parmval);
#endif
} }
if (parmval == error_mark_node) if (parmval == error_mark_node)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment