diff options
author | J"orn Rennecke <amylaar@redhat.com> | 2001-01-25 02:03:14 +0000 |
---|---|---|
committer | Joern Rennecke <amylaar@gcc.gnu.org> | 2001-01-25 02:03:14 +0000 |
commit | 91239b939c222c178e872bbe673c7d37f62969f0 (patch) | |
tree | 488d581146c642d892325add8df753789b577761 /gcc/c-decl.c | |
parent | e57cabac809559538ae7f3bf2866b66401a321e7 (diff) | |
download | gcc-91239b939c222c178e872bbe673c7d37f62969f0.zip gcc-91239b939c222c178e872bbe673c7d37f62969f0.tar.gz gcc-91239b939c222c178e872bbe673c7d37f62969f0.tar.bz2 |
c-decl.c (duplicate_decls): If different_binding_level is nonzero...
* c-decl.c (duplicate_decls): If different_binding_level is nonzero,
olddecl has argument types and newdecl has none, use the argument
types from olddecl.
From-SVN: r39254
Diffstat (limited to 'gcc/c-decl.c')
-rw-r--r-- | gcc/c-decl.c | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/gcc/c-decl.c b/gcc/c-decl.c index 97ae2ba..06bbbef 100644 --- a/gcc/c-decl.c +++ b/gcc/c-decl.c @@ -1800,11 +1800,17 @@ duplicate_decls (newdecl, olddecl, different_binding_level) if (TREE_CODE (newdecl) != FUNCTION_DECL || !DECL_BUILT_IN (olddecl)) { if (different_binding_level) - TREE_TYPE (newdecl) - = build_type_attribute_variant - (newtype, - merge_attributes (TYPE_ATTRIBUTES (newtype), - TYPE_ATTRIBUTES (oldtype))); + { + if (TYPE_ARG_TYPES (oldtype) != 0 + && TYPE_ARG_TYPES (newtype) == 0) + TREE_TYPE (newdecl) = common_type (newtype, oldtype); + else + TREE_TYPE (newdecl) + = build_type_attribute_variant + (newtype, + merge_attributes (TYPE_ATTRIBUTES (newtype), + TYPE_ATTRIBUTES (oldtype))); + } else TREE_TYPE (newdecl) = TREE_TYPE (olddecl) |