Commit 663174d3 by Joseph Myers Committed by Joseph Myers

c-parse.in (datadef): Use pedwarn rather than error and warning for diagnostic in case of no...

	* 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.

From-SVN: r89605
parent 9d069a4f
2004-10-26 Joseph S. Myers <jsm@polyomino.org.uk>
* c-parse.in (datadef): Use pedwarn rather than error and warning
for diagnostic in case of no declaration specifiers.
2004-10-26 Richard Sandiford <rsandifo@redhat.com>
PR bootstrap/15747
......
......@@ -407,11 +407,7 @@ save_obstack_position:
datadef:
setspecs notype_initdecls ';'
{ if (pedantic)
error ("ISO C forbids data definition with no type or storage class");
else
warning ("data definition has no type or storage class");
{ pedwarn ("data definition has no type or storage class");
POP_DECLSPEC_STACK; }
| declspecs_nots setspecs notype_initdecls ';'
{ POP_DECLSPEC_STACK; }
......
2004-10-26 Joseph S. Myers <jsm@polyomino.org.uk>
* gcc.dg/decl-nospec-1.c, gcc.dg/decl-nospec-2.c,
gcc.dg/decl-nospec-3.c: New tests.
2004-10-26 Ziemowit Laski <zlaski@apple.com>
* objc.dg/super-class-3.m: New test.
......
/* Data definition with no type or storage class should receive a
pedwarn, rather than a warning which becomes an error with
-pedantic. Test with no options. */
/* Origin: Joseph Myers <jsm@polyomino.org.uk> */
/* { dg-do compile } */
/* { dg-options "" } */
foo(); /* { dg-warning "warning: data definition has no type or storage class" } */
/* 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. */
/* Origin: Joseph Myers <jsm@polyomino.org.uk> */
/* { dg-do compile } */
/* { dg-options "-pedantic" } */
foo(); /* { dg-warning "warning: data definition has no type or storage class" } */
/* 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" } */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment