summaryrefslogtreecommitdiffstats
path: root/gcc/c-decl.c
diff options
context:
space:
mode:
authorjsm28 <jsm28@138bc75d-0d04-0410-961f-82ee72b054a4>2009-04-19 18:25:07 +0000
committerjsm28 <jsm28@138bc75d-0d04-0410-961f-82ee72b054a4>2009-04-19 18:25:07 +0000
commit577f47740bc44e2a757d4891a5a0cccb7742540e (patch)
treec0ec87d29c84a7b657046e08c6456078a5ce5c3f /gcc/c-decl.c
parent9ed5b1f51fab0a96dfa17dfec099a73f4fdeb730 (diff)
downloadppe42-gcc-577f47740bc44e2a757d4891a5a0cccb7742540e.tar.gz
ppe42-gcc-577f47740bc44e2a757d4891a5a0cccb7742540e.zip
PR c/38243
* c-decl.c (shadow_tag_warned): Diagnose use of restrict when declaring a tag. testsuite: * gcc.dg/c99-restrict-3.c: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@146356 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/c-decl.c')
-rw-r--r--gcc/c-decl.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/gcc/c-decl.c b/gcc/c-decl.c
index 62262034d8c..796f1eaadf3 100644
--- a/gcc/c-decl.c
+++ b/gcc/c-decl.c
@@ -2883,6 +2883,12 @@ shadow_tag_warned (const struct c_declspecs *declspecs, int warned)
found_tag = true;
+ if (declspecs->restrict_p)
+ {
+ error ("invalid use of %<restrict%>");
+ warned = 1;
+ }
+
if (name == 0)
{
if (warned != 1 && code != ENUMERAL_TYPE)
OpenPOWER on IntegriCloud