+2000-05-23 Zack Weinberg <zack@wolery.cumb.org>
+
+ * c-decl.c (pushdecl): Invert sense of test for non-global types.
+
Tue May 23 18:11:42 2000 J"orn Rennecke <amylaar@cygnus.co.uk>
* reload1.c (reload_cse_move2add): Honor TRULY_NOOP_TRUNCATION.
{
if (type == error_mark_node)
break;
- if (! TYPE_CONTEXT (type))
+ if (TYPE_CONTEXT (type))
{
warning_with_decl (x, "type of external `%s' is not global");
/* By exiting the loop early, we leave TYPE nonzero,
--- /dev/null
+/* Test for the warning about external functions with non-global
+ types. In -traditional mode, these functions are globally visible
+ even if declared in an inner scope, so their return types should
+ also be visible. */
+
+/* { dg-do compile } */
+/* { dg-options -traditional } */
+
+int
+main ()
+{
+ struct foo { int a, b; };
+
+ extern struct foo *bar(); /* { dg-warning "type of external" "good warn" } */
+ extern int baz(); /* { dg-bogus "type of external" "bad warn" } */
+
+ return 0;
+}