From: Richard Kenner Date: Tue, 14 Jun 1994 21:44:58 +0000 (-0400) Subject: (staticp, case FUNCTION_DECL): A nested function isn't static. X-Git-Tag: misc/cutover-egcs-0~6477 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=86270344f372ea02de71326b452e9d9434977b0f;p=thirdparty%2Fgcc.git (staticp, case FUNCTION_DECL): A nested function isn't static. From-SVN: r7466 --- diff --git a/gcc/tree.c b/gcc/tree.c index 6e15640f9446..1839b31a0909 100644 --- a/gcc/tree.c +++ b/gcc/tree.c @@ -1903,8 +1903,13 @@ staticp (arg) { switch (TREE_CODE (arg)) { - case VAR_DECL: case FUNCTION_DECL: + /* Nested functions aren't static. Since taking their address + involves a trampoline. */ + if (decl_function_context (arg) != 0) + return 0; + /* ... fall through ... */ + case VAR_DECL: return TREE_STATIC (arg) || DECL_EXTERNAL (arg); case CONSTRUCTOR: