incomp_array_err.hlsl 1.2 KB

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[]; /* fxc-error {{X3072: array dimensions of type must be explicit}} */
  4. static inta s_test1 = {1, 2, 3}; /* fxc-error {{X3000: unrecognized identifier 'inta'}} */
  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}} fxc-error {{X3000: unrecognized identifier 'inta'}}
  9. };
  10. struct foo2 {
  11. int a[]; // expected-error {{array dimensions of struct/class members must be explicit}} fxc-error {{X3072: 'foo2::a': 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}} fxc-error {{X3000: unrecognized identifier 'inta'}}
  17. };
  18. class foo4 {
  19. float4 member;
  20. int a[]; // expected-error {{array dimensions of struct/class members must be explicit}} fxc-error {{X3072: 'foo4::a': array dimensions of struct/class members must be explicit}}
  21. };