diff options
author | Richard Henderson <rth@cygnus.com> | 1999-09-07 21:51:16 -0700 |
---|---|---|
committer | Richard Henderson <rth@gcc.gnu.org> | 1999-09-07 21:51:16 -0700 |
commit | c530479e15d804667c83dfb738ce9cae035de9f2 (patch) | |
tree | cc01394964ac75996779fc8fc5ebdb1781aeb69c /gcc/cp | |
parent | 472236af04ca7daa01b6b5b1a00dafaf91d31f1f (diff) | |
download | gcc-c530479e15d804667c83dfb738ce9cae035de9f2.zip gcc-c530479e15d804667c83dfb738ce9cae035de9f2.tar.gz gcc-c530479e15d804667c83dfb738ce9cae035de9f2.tar.bz2 |
c-typeck.c (type_lists_compatible_p): Use simple_type_promotes_to.
* c-typeck.c (type_lists_compatible_p): Use simple_type_promotes_to.
(self_promoting_type_p): Delete.
(self_promoting_args_p): Move ...
* c-common.c: ... here.
(c_common_nodes_and_builtins): Initialize lang_type_promotes_to.
(simple_type_promotes_to): New.
* builtins.c (lang_type_promotes_to): New.
(expand_builtin_va_arg): Use it to give diagnostic for illegal types.
* c-tree.h (C_PROMOTING_INTEGER_TYPE_P): Move ...
* c-common.h: ... here.
(self_promoting_args_p, simple_type_promotes_to): Declare.
* c-decl.c (duplicate_decls): Use simple_type_promotes_to.
(grokdeclarator): Likewise.
* tree.h (lang_type_promotes_to): Declare.
* cp-tree.h (C_PROMOTING_INTEGER_TYPE_P): Delete.
* typeck.c (self_promoting_args_p): Delete.
* gcc.dg/va-arg-1.c: New.
From-SVN: r29180
Diffstat (limited to 'gcc/cp')
-rw-r--r-- | gcc/cp/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/cp/cp-tree.h | 12 | ||||
-rw-r--r-- | gcc/cp/typeck.c | 27 |
3 files changed, 5 insertions, 39 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 5ee4674..55c4045 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,8 @@ +1999-09-07 Richard Henderson <rth@cygnus.com> + + * cp-tree.h (C_PROMOTING_INTEGER_TYPE_P): Delete. + * typeck.c (self_promoting_args_p): Delete. + 1999-09-07 Jason Merrill <jason@yorick.cygnus.com> * search.c (binfo_for_vtable): Use CLASSTYPE_VFIELD_PARENT. diff --git a/gcc/cp/cp-tree.h b/gcc/cp/cp-tree.h index d7ca7a7..5b6e8f5 100644 --- a/gcc/cp/cp-tree.h +++ b/gcc/cp/cp-tree.h @@ -1902,17 +1902,6 @@ extern int flag_new_for_scope; #define SET_DECL_C_BIT_FIELD(NODE) \ (DECL_LANG_SPECIFIC (NODE)->decl_flags.bitfield = 1) -/* Nonzero if the type T promotes to itself. - ANSI C states explicitly the list of types that promote; - in particular, short promotes to int even if they have the same width. */ -#define C_PROMOTING_INTEGER_TYPE_P(t) \ - (TREE_CODE ((t)) == INTEGER_TYPE \ - && (TYPE_MAIN_VARIANT (t) == char_type_node \ - || TYPE_MAIN_VARIANT (t) == signed_char_type_node \ - || TYPE_MAIN_VARIANT (t) == unsigned_char_type_node \ - || TYPE_MAIN_VARIANT (t) == short_integer_type_node \ - || TYPE_MAIN_VARIANT (t) == short_unsigned_type_node)) - #define INTEGRAL_CODE_P(CODE) \ (CODE == INTEGER_TYPE || CODE == ENUMERAL_TYPE || CODE == BOOLEAN_TYPE) @@ -3751,7 +3740,6 @@ extern int compparms PROTO((tree, tree)); extern int comp_target_types PROTO((tree, tree, int)); extern int comp_cv_qualification PROTO((tree, tree)); extern int comp_cv_qual_signature PROTO((tree, tree)); -extern int self_promoting_args_p PROTO((tree)); extern tree unsigned_type PROTO((tree)); extern tree signed_type PROTO((tree)); extern tree signed_or_unsigned_type PROTO((int, tree)); diff --git a/gcc/cp/typeck.c b/gcc/cp/typeck.c index 0a8eb87..6b0bc3b 100644 --- a/gcc/cp/typeck.c +++ b/gcc/cp/typeck.c @@ -1623,33 +1623,6 @@ comp_target_parms (parms1, parms2, strict) } return warn_contravariance ? -1 : 1; } - -/* Return 1 if PARMS specifies a fixed number of parameters - and none of their types is affected by default promotions. */ - -int -self_promoting_args_p (parms) - tree parms; -{ - register tree t; - for (t = parms; t; t = TREE_CHAIN (t)) - { - register tree type = TREE_VALUE (t); - - if (TREE_CHAIN (t) == 0 && type != void_type_node) - return 0; - - if (type == 0) - return 0; - - if (TYPE_MAIN_VARIANT (type) == float_type_node) - return 0; - - if (C_PROMOTING_INTEGER_TYPE_P (type)) - return 0; - } - return 1; -} /* Compute the value of the `sizeof' operator. */ |