mirror of
git://gcc.gnu.org/git/gcc.git
synced 2025-04-16 19:51:23 +08:00
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:
parent
1b36c81835
commit
7fdc3e0952
@ -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
|
||||
|
@ -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 "
|
||||
|
@ -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.
|
||||
|
7
gcc/testsuite/gcc.dg/complex-2.c
Normal file
7
gcc/testsuite/gcc.dg/complex-2.c
Normal 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"
|
6
gcc/testsuite/gcc.dg/complex-2.h
Normal file
6
gcc/testsuite/gcc.dg/complex-2.h
Normal 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;
|
Loading…
x
Reference in New Issue
Block a user