incomp_array_err.hlsl 724 B

1234567891011121314151617181920212223242526272829
  1. // RUN: %clang_cc1 -fsyntax-only -ffreestanding -verify %s
  2. // Verify error on on incomplete array in a struct or class
  3. typedef const int inta[];
  4. static inta s_test1 = {1, 2, 3};
  5. static int s_test2[] = { 4, 5, 6 };
  6. struct foo1 {
  7. float4 member;
  8. inta a; // expected-error {{array dimensions of struct/class members must be explicit}}
  9. };
  10. struct foo2 {
  11. int a[]; // expected-error {{array dimensions of struct/class members must be explicit}}
  12. float4 member;
  13. };
  14. class foo3 {
  15. float4 member;
  16. inta a; // expected-error {{array dimensions of struct/class members must be explicit}}
  17. };
  18. class foo4 {
  19. float4 member;
  20. int a[]; // expected-error {{array dimensions of struct/class members must be explicit}}
  21. };