]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
c-common.c (handle_alias_attribute): Reject the attribute if current_function_decl...
authorRichard Henderson <rth@redhat.com>
Thu, 26 Feb 2004 01:24:37 +0000 (17:24 -0800)
committerRichard Henderson <rth@gcc.gnu.org>
Thu, 26 Feb 2004 01:24:37 +0000 (17:24 -0800)
        * c-common.c (handle_alias_attribute): Reject the attribute if
        current_function_decl is set.

From-SVN: r78472

gcc/ChangeLog
gcc/c-common.c

index 284ef088d478fac4fd40afdff8bbac908914d94f..80a9c564d0c426256e460f99fc5c0b3568fa57d6 100644 (file)
@@ -1,3 +1,8 @@
+2004-02-25  Richard Henderson  <rth@redhat.com>
+
+       * c-common.c (handle_alias_attribute): Reject the attribute if
+       current_function_decl is set.
+
 2004-02-25  Kelley Cook  <kcook@gcc.gnu.org>
 
        * config.gcc: Add comment describing extra_gcc_objs.
index 3d9dbfa3297b374661ec810bb2309d9b5677a35b..4c0ce271077cc5323907c8c7fb21a4c7ac9e2e9f 100644 (file)
@@ -4827,7 +4827,13 @@ handle_alias_attribute (tree *node, tree name, tree args,
       error ("%J'%D' defined both normally and as an alias", decl, decl);
       *no_add_attrs = true;
     }
-  else if (decl_function_context (decl) == 0)
+
+  /* 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;