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
This commit is contained in:
parent
40cae311f5
commit
fa56377de3
@ -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.
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
@ -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++;
|
||||
|
@ -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));
|
||||
|
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user