* c-decl.c (declspecs_add_type): Don't pedwarn for _Complex in
authorjsm28 <jsm28@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 5 Oct 2004 19:58:39 +0000 (19:58 +0000)
committerjsm28 <jsm28@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 5 Oct 2004 19:58:39 +0000 (19:58 +0000)
system headers.

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

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@88571 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/c-decl.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/complex-2.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/complex-2.h [new file with mode: 0644]

index 71f86e0..f3b9b84 100644 (file)
@@ -1,5 +1,10 @@
 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
        refers to a visible entity with internal linkage, use the old DECL
        rather than the new one.
index 415a757..a723c25 100644 (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 "
index b95a6ee..2ade3dd 100644 (file)
@@ -1,5 +1,9 @@
 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.
 
 2004-10-05  Nathan Sidwell  <nathan@codesourcery.com>
diff --git a/gcc/testsuite/gcc.dg/complex-2.c b/gcc/testsuite/gcc.dg/complex-2.c
new file mode 100644 (file)
index 0000000..85adcde
--- /dev/null
@@ -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"
diff --git a/gcc/testsuite/gcc.dg/complex-2.h b/gcc/testsuite/gcc.dg/complex-2.h
new file mode 100644 (file)
index 0000000..752d7f2
--- /dev/null
@@ -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;