This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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;
  


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]