struct-ns2.c 473 B

1234567891011121314151617181920212223242526
  1. static void
  2. g (struct Bar { int i; } *x)
  3. {
  4. struct Bar y;
  5. y.i = 1;
  6. }
  7. static void
  8. h (void)
  9. {
  10. // This is not in scope and should barf loudly.
  11. struct Bar y;
  12. y.i = 1;
  13. }
  14. /*
  15. * check-name: struct not in scope
  16. * check-known-to-fail
  17. *
  18. * check-error-start
  19. struct-ns2.c:2:11: warning: bad scope for 'struct Bar'
  20. struct-ns2.c:12:14: error: incomplete type/unknown size for 'y'
  21. struct-ns2.c:13:5: error: using member 'i' in incomplete 'struct Bar'
  22. * check-error-end
  23. */