diff options
author | jsm28 <jsm28@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-08-16 20:35:21 +0000 |
---|---|---|
committer | jsm28 <jsm28@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-08-16 20:35:21 +0000 |
commit | a021a5a651999cf512165dedb8de3fef5377890d (patch) | |
tree | 1956edd1a7728d948fb52e28f45a268e9d0f1b4d /gcc/testsuite/gcc.dg/funcdef-attr-1.c | |
parent | 952159483d7efd13f85c16189481bc1ec5808b46 (diff) | |
download | gcc-a021a5a651999cf512165dedb8de3fef5377890d.tar.gz |
* c-decl.c (grokdeclarator): Allow for function definition where
innermost declarator has attributes.
testsuite:
* gcc.dg/funcdef-attr-1.c: New test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@86075 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/testsuite/gcc.dg/funcdef-attr-1.c')
-rw-r--r-- | gcc/testsuite/gcc.dg/funcdef-attr-1.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/funcdef-attr-1.c b/gcc/testsuite/gcc.dg/funcdef-attr-1.c new file mode 100644 index 00000000000..17249a0cb9e --- /dev/null +++ b/gcc/testsuite/gcc.dg/funcdef-attr-1.c @@ -0,0 +1,14 @@ +/* The declarator in a function definition should be able to take the + form of an attributed function declarator, not just a plain + function declarator. This was formerly allowed by some of the code + but then the wrong constraint checks were made because other code + didn't recognise the declarator as being that of the function + definition. */ +/* Origin: Joseph Myers <jsm@polyomino.org.uk>. */ + +int (__attribute__((const)) x) (a, b) + int a; + int b; +{ + return a + b; +} |