diff options
author | Joseph Myers <joseph@codesourcery.com> | 2005-04-01 17:16:38 +0100 |
---|---|---|
committer | Joseph Myers <jsm28@gcc.gnu.org> | 2005-04-01 17:16:38 +0100 |
commit | 2c83be0cf08fc0b535aec0211f599acc38fa076e (patch) | |
tree | 1a4fa012965c447b6382b9419014c82666144cec /gcc/c-decl.c | |
parent | 57ecec57492f5f3c32845a9a2cb12ae45dc0da03 (diff) | |
download | gcc-2c83be0cf08fc0b535aec0211f599acc38fa076e.zip gcc-2c83be0cf08fc0b535aec0211f599acc38fa076e.tar.gz gcc-2c83be0cf08fc0b535aec0211f599acc38fa076e.tar.bz2 |
c-decl.c (validate_proto_after_old_defn): Look at TYPE_MAIN_VARIANT of argument types.
* c-decl.c (validate_proto_after_old_defn): Look at
TYPE_MAIN_VARIANT of argument types.
testsuite:
* gcc.dg/old-style-then-proto-1.c: New test.
From-SVN: r97403
Diffstat (limited to 'gcc/c-decl.c')
-rw-r--r-- | gcc/c-decl.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/gcc/c-decl.c b/gcc/c-decl.c index cb8fd9d..9d82b9a 100644 --- a/gcc/c-decl.c +++ b/gcc/c-decl.c @@ -1043,8 +1043,7 @@ validate_proto_after_old_defn (tree newdecl, tree newtype, tree oldtype) tree newargs, oldargs; int i; - /* ??? Elsewhere TYPE_MAIN_VARIANT is not used in this context. */ -#define END_OF_ARGLIST(t) (TYPE_MAIN_VARIANT (t) == void_type_node) +#define END_OF_ARGLIST(t) ((t) == void_type_node) oldargs = TYPE_ACTUAL_ARG_TYPES (oldtype); newargs = TYPE_ARG_TYPES (newtype); @@ -1052,8 +1051,8 @@ validate_proto_after_old_defn (tree newdecl, tree newtype, tree oldtype) for (;;) { - tree oldargtype = TREE_VALUE (oldargs); - tree newargtype = TREE_VALUE (newargs); + tree oldargtype = TYPE_MAIN_VARIANT (TREE_VALUE (oldargs)); + tree newargtype = TYPE_MAIN_VARIANT (TREE_VALUE (newargs)); if (END_OF_ARGLIST (oldargtype) && END_OF_ARGLIST (newargtype)) break; |