This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
fix c/12794
- From: Richard Henderson <rth at redhat dot com>
- To: gcc-patches at gcc dot gnu dot org
- Date: Wed, 25 Feb 2004 17:28:10 -0800
- Subject: fix c/12794
The comment outlines the failure mode. Applied to mainline as
the problem was latent there.
r~
* c-common.c (handle_alias_attribute): Reject the attribute if
current_function_decl is set.
Index: c-common.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/c-common.c,v
retrieving revision 1.344.2.61
diff -c -p -d -r1.344.2.61 c-common.c
*** c-common.c 13 Feb 2004 13:10:54 -0000 1.344.2.61
--- c-common.c 26 Feb 2004 01:11:09 -0000
*************** handle_alias_attribute (tree *node, tree
*** 4904,4910 ****
error ("%J'%D' defined both normally and as an alias", decl, decl);
*no_add_attrs = true;
}
! else if (decl_function_context (decl) == 0)
{
tree id;
--- 4904,4916 ----
error ("%J'%D' defined both normally and as an alias", decl, decl);
*no_add_attrs = true;
}
!
! /* Note that the very first time we process a nested declaration,
! decl_function_context will not be set. Indeed, *would* never
! be set except for the DECL_INITIAL/DECL_EXTERNAL frobbery that
! we do below. After such frobbery, pushdecl would set the context.
! In any case, this is never what we want. */
! else if (decl_function_context (decl) == 0 && current_function_decl == NULL)
{
tree id;