From d878092fddb38d5f7d52388662245297c1185e5b Mon Sep 17 00:00:00 2001 From: jsm28 Date: Tue, 26 Oct 2004 21:01:51 +0000 Subject: * 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 --- gcc/testsuite/gcc.dg/decl-nospec-3.c | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 gcc/testsuite/gcc.dg/decl-nospec-3.c (limited to 'gcc/testsuite/gcc.dg/decl-nospec-3.c') 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 */ +/* { dg-do compile } */ +/* { dg-options "-pedantic-errors" } */ + +foo(); /* { dg-error "error: data definition has no type or storage class" } */ -- cgit v1.2.1