This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [3.4 PATCH] Fix inline nested functions (PR middle-end/15345,c/16450)
- From: Mark Mitchell <mark at codesourcery dot com>
- To: Richard Henderson <rth at redhat dot com>
- Cc: Jakub Jelinek <jakub at redhat dot com>, jh at suse dot cz, gcc-patches at gcc dot gnu dot org
- Date: Tue, 20 Jul 2004 12:03:32 -0700
- Subject: Re: [3.4 PATCH] Fix inline nested functions (PR middle-end/15345,c/16450)
- Organization: CodeSourcery, LLC
- References: <20040720152211.GT21264@devserv.devel.redhat.com> <20040720182948.GB20213@redhat.com>
Richard Henderson wrote:
On Tue, Jul 20, 2004 at 11:22:11AM -0400, Jakub Jelinek wrote:
+ || (cgraph_n_nodes > 0 && cgraph_node (decl)->origin))
decl_function_context (decl) is the canonical way to test for nested.
Just to be clear, in C++, with:
void f() { struct S { void g() { } }; };
the "g" function will have a non-NULL decl_function_context, but is not
"nested" in the sense of GNU C nested functions; for example, "g" cannot
refer to automatic variables in "f".
--
Mark Mitchell
CodeSourcery, LLC
(916) 791-8304
mark@codesourcery.com