1 // RUN: %clang_cc1 -triple dxil-pc-shadermodel6.3-library -x hlsl -fsyntax-only -verify %s
3 // Some bad declarations
4 hlsl::vector ShouldWorkSomeday; // expected-error{{use of alias template 'hlsl::vector' requires template arguments}}
6 hlsl::vector<1> BadVec; // expected-error{{template argument for template type parameter must be a type}}
7 // expected-note@*:* {{template is declared here}}
8 // expected-note@*:* {{template parameter is declared here}}
11 hlsl::vector<int, float> AnotherBadVec; // expected-error{{template argument for non-type template parameter must be an expression}}
12 // expected-note@*:* {{template parameter is declared here}}
14 hlsl::vector<int, 2, 3> YABV; // expected-error{{too many template arguments for alias template 'vector'}}
15 // expected-note@*:* {{template is declared here}}
17 // This code is rejected by clang because clang puts the HLSL built-in types
18 // into the HLSL namespace.
20 struct vector {}; // expected-error {{redefinition of 'vector'}}
23 // This code is rejected by dxc because dxc puts the HLSL built-in types
24 // into the global space, but clang will allow it even though it will shadow the
26 struct vector {}; // expected-note {{candidate found by name lookup is 'vector'}}
28 vector<int,2> VecInt2; // expected-error {{reference to 'vector' is ambiguous}}
30 // expected-note@*:* {{candidate found by name lookup is 'hlsl::vector'}}