aboutsummaryrefslogtreecommitdiff
path: root/gcc/c-common.c
diff options
context:
space:
mode:
authorRichard Henderson <rth@redhat.com>2004-02-25 17:24:37 -0800
committerRichard Henderson <rth@gcc.gnu.org>2004-02-25 17:24:37 -0800
commitf6a76b9f5d22765d951ea7d92e7e24b6b54c7843 (patch)
tree259232151172287ef6bbde3e486554b4b92b2a0c /gcc/c-common.c
parent6ce7631670c254d52eddcdf5cd53257a6ca4a7e8 (diff)
downloadgcc-f6a76b9f5d22765d951ea7d92e7e24b6b54c7843.zip
gcc-f6a76b9f5d22765d951ea7d92e7e24b6b54c7843.tar.gz
gcc-f6a76b9f5d22765d951ea7d92e7e24b6b54c7843.tar.bz2
c-common.c (handle_alias_attribute): Reject the attribute if current_function_decl is set.
* c-common.c (handle_alias_attribute): Reject the attribute if current_function_decl is set. From-SVN: r78472
Diffstat (limited to 'gcc/c-common.c')
-rw-r--r--gcc/c-common.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/gcc/c-common.c b/gcc/c-common.c
index 3d9dbfa..4c0ce27 100644
--- a/gcc/c-common.c
+++ b/gcc/c-common.c
@@ -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;