summaryrefslogtreecommitdiffstats
path: root/gcc/testsuite/gcc.dg/decl-nospec-3.c
diff options
context:
space:
mode:
authorjsm28 <jsm28@138bc75d-0d04-0410-961f-82ee72b054a4>2004-10-26 21:01:51 +0000
committerjsm28 <jsm28@138bc75d-0d04-0410-961f-82ee72b054a4>2004-10-26 21:01:51 +0000
commitd878092fddb38d5f7d52388662245297c1185e5b (patch)
tree27131b16b103bcceb7957c8f4449fd9bdff56e04 /gcc/testsuite/gcc.dg/decl-nospec-3.c
parent6675f2d9b1779ec5c8c5a3e1d74b08977d61c45c (diff)
downloadppe42-gcc-d878092fddb38d5f7d52388662245297c1185e5b.tar.gz
ppe42-gcc-d878092fddb38d5f7d52388662245297c1185e5b.zip
* c-parse.in (datadef): Use pedwarn rather than error and warning
for diagnostic in case of no declaration specifiers. testsuite: * gcc.dg/decl-nospec-1.c, gcc.dg/decl-nospec-2.c, gcc.dg/decl-nospec-3.c: New tests. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@89605 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/testsuite/gcc.dg/decl-nospec-3.c')
-rw-r--r--gcc/testsuite/gcc.dg/decl-nospec-3.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/decl-nospec-3.c b/gcc/testsuite/gcc.dg/decl-nospec-3.c
new file mode 100644
index 00000000000..6c04e94429d
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/decl-nospec-3.c
@@ -0,0 +1,8 @@
+/* Data definition with no type or storage class should receive a
+ pedwarn, rather than a warning which becomes an error with
+ -pedantic. Test with -pedantic-errors. */
+/* Origin: Joseph Myers <jsm@polyomino.org.uk> */
+/* { dg-do compile } */
+/* { dg-options "-pedantic-errors" } */
+
+foo(); /* { dg-error "error: data definition has no type or storage class" } */
OpenPOWER on IntegriCloud