aboutsummaryrefslogtreecommitdiff
path: root/gcc/c-decl.c
diff options
context:
space:
mode:
authorJoseph Myers <jsm@polyomino.org.uk>2004-07-23 20:22:13 +0100
committerJoseph Myers <jsm28@gcc.gnu.org>2004-07-23 20:22:13 +0100
commit7eb01bd8296eda52b215c3047ce4bc6a2040c875 (patch)
tree679296ae674e05a9bc0acd3399eb16f236fe81f9 /gcc/c-decl.c
parentf67376e4ba0e45670eac3d3f0ace808a576ef2f0 (diff)
downloadgcc-7eb01bd8296eda52b215c3047ce4bc6a2040c875.zip
gcc-7eb01bd8296eda52b215c3047ce4bc6a2040c875.tar.gz
gcc-7eb01bd8296eda52b215c3047ce4bc6a2040c875.tar.bz2
c-decl.c (start_function): Form composite type of function types rather than copying type from previous...
* c-decl.c (start_function): Form composite type of function types rather than copying type from previous prototype declaration. testsuite: * gcc.dg/comp-return-1.c: New test From-SVN: r85093
Diffstat (limited to 'gcc/c-decl.c')
-rw-r--r--gcc/c-decl.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/gcc/c-decl.c b/gcc/c-decl.c
index ac812e3..93469d9 100644
--- a/gcc/c-decl.c
+++ b/gcc/c-decl.c
@@ -5712,7 +5712,8 @@ start_function (tree declspecs, tree declarator, tree attributes)
TREE_TYPE (TREE_TYPE (old_decl)))
&& TYPE_ARG_TYPES (TREE_TYPE (decl1)) == 0)
{
- TREE_TYPE (decl1) = TREE_TYPE (old_decl);
+ TREE_TYPE (decl1) = composite_type (TREE_TYPE (old_decl),
+ TREE_TYPE (decl1));
current_function_prototype_locus = DECL_SOURCE_LOCATION (old_decl);
}