diff options
author | Joseph Myers <jsm@polyomino.org.uk> | 2004-08-16 21:35:21 +0100 |
---|---|---|
committer | Joseph Myers <jsm28@gcc.gnu.org> | 2004-08-16 21:35:21 +0100 |
commit | 580b3958265f6bca27126b24f20d95c32d00c854 (patch) | |
tree | 1956edd1a7728d948fb52e28f45a268e9d0f1b4d /gcc/c-decl.c | |
parent | 93f90be62c1d84539017ab6d73b061993b367f54 (diff) | |
download | gcc-580b3958265f6bca27126b24f20d95c32d00c854.zip gcc-580b3958265f6bca27126b24f20d95c32d00c854.tar.gz gcc-580b3958265f6bca27126b24f20d95c32d00c854.tar.bz2 |
c-decl.c (grokdeclarator): Allow for function definition where innermost declarator has attributes.
* c-decl.c (grokdeclarator): Allow for function definition where
innermost declarator has attributes.
testsuite:
* gcc.dg/funcdef-attr-1.c: New test.
From-SVN: r86075
Diffstat (limited to 'gcc/c-decl.c')
-rw-r--r-- | gcc/c-decl.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/gcc/c-decl.c b/gcc/c-decl.c index c7ba8d2..e867ebb 100644 --- a/gcc/c-decl.c +++ b/gcc/c-decl.c @@ -4176,12 +4176,17 @@ grokdeclarator (tree declarator, tree declspecs, } else if (TREE_CODE (declarator) == CALL_EXPR) { - /* Say it's a definition only for the CALL_EXPR closest to - the identifier. */ - bool really_funcdef = (funcdef_flag - && (TREE_CODE (TREE_OPERAND (declarator, 0)) - == IDENTIFIER_NODE)); + /* Say it's a definition only for the declarator closest to + the identifier, apart possibly from some attributes. */ + bool really_funcdef = false; tree arg_types; + if (funcdef_flag) + { + tree t = TREE_OPERAND (declarator, 0); + while (TREE_CODE (t) == TREE_LIST) + t = TREE_VALUE (t); + really_funcdef = (TREE_CODE (t) == IDENTIFIER_NODE); + } /* Declaring a function type. Make sure we have a valid type for the function to return. */ |