c-decl.c (finish_decl): Don't add DECL_STMTs for nested function prototypes.

* c-decl.c (finish_decl): Don't add DECL_STMTs for nested function
	prototypes.

	* gcc.c-torture/compile/20011023-1.c: New test.

From-SVN: r46463
This commit is contained in:
Jakub Jelinek 2001-10-24 16:46:44 +02:00 committed by Jakub Jelinek
parent b8c815e548
commit c0a4369a23
4 changed files with 25 additions and 1 deletions

View File

@ -1,3 +1,8 @@
2001-10-24 Jakub Jelinek <jakub@redhat.com>
* c-decl.c (finish_decl): Don't add DECL_STMTs for nested function
prototypes.
2001-10-23 Stan Shebs <shebs@apple.com>
* config/rs6000/x-darwin: Use -no-cpp-precomp instead of

View File

@ -3735,7 +3735,8 @@ finish_decl (decl, init, asmspec_tree)
SET_DECL_ASSEMBLER_NAME (decl, get_identifier (asmspec));
}
add_decl_stmt (decl);
if (TREE_CODE (decl) != FUNCTION_DECL)
add_decl_stmt (decl);
}
if (DECL_CONTEXT (decl) != 0)

View File

@ -1,3 +1,7 @@
2001-10-24 Jakub Jelinek <jakub@redhat.com>
* gcc.c-torture/compile/20011023-1.c: New test.
2001-10-23 Geoffrey Keating <geoffk@redhat.com>
* lib/g77.exp: Rewrite based on lib/g++.exp.

View File

@ -0,0 +1,14 @@
/* Test whether tree inlining works with prototyped nested functions. */
extern void foo (char *x);
void bar (void);
void bar (void)
{
auto void baz (void);
void baz (void)
{
char tmp[2];
foo (tmp);
}
baz ();
}