c-decl.c (declspecs_add_type): Don't pedwarn for _Complex in system headers.

* c-decl.c (declspecs_add_type): Don't pedwarn for _Complex in
	system headers.

testsuite:
	* gcc.dg/complex-2.c, gcc.dg/complex-2.h: New test.

From-SVN: r88571
This commit is contained in:
Joseph Myers 2004-10-05 20:58:39 +01:00 committed by Joseph Myers
parent 1b36c81835
commit 7fdc3e0952
5 changed files with 23 additions and 1 deletions

View File

@ -1,3 +1,8 @@
2004-10-05 Joseph S. Myers <jsm@polyomino.org.uk>
* c-decl.c (declspecs_add_type): Don't pedwarn for _Complex in
system headers.
2004-10-05 Joseph S. Myers <jsm@polyomino.org.uk>
* c-decl.c (pushdecl): When an extern declaration at block scope

View File

@ -6816,7 +6816,7 @@ declspecs_add_type (struct c_declspecs *specs, tree type)
break;
case RID_COMPLEX:
dupe = specs->complex_p;
if (pedantic && !flag_isoc99)
if (pedantic && !flag_isoc99 && !in_system_header)
pedwarn ("ISO C90 does not support complex types");
if (specs->typespec_word == cts_void)
error ("both %<complex%> and %<void%> in "

View File

@ -1,3 +1,7 @@
2004-10-05 Joseph S. Myers <jsm@polyomino.org.uk>
* gcc.dg/complex-2.c, gcc.dg/complex-2.h: New test.
2004-10-05 Joseph S. Myers <jsm@polyomino.org.uk>
* gcc.c-torture/compile/20041005-1.c: New test.

View File

@ -0,0 +1,7 @@
/* Allow complex types in system headers even with -std=iso9899:1990
-pedantic-errors. */
/* Origin: Joseph Myers <jsm@polyomino.org.uk> */
/* { dg-do compile } */
/* { dg-options "-std=iso9899:1990 -pedantic-errors" } */
#include "complex-2.h"

View File

@ -0,0 +1,6 @@
/* Allow complex types in system headers even with -std=iso9899:1990
-pedantic-errors. Header file. */
#pragma GCC system_header
_Complex double x;