1// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.3-library -x hlsl -fsyntax-only -verify %s 2 3// Some bad declarations 4hlsl::vector ShouldWorkSomeday; // expected-error{{use of alias template 'hlsl::vector' requires template arguments}} 5 6hlsl::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}} 9 10 11hlsl::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}} 13 14hlsl::vector<int, 2, 3> YABV; // expected-error{{too many template arguments for alias template 'vector'}} 15// expected-note@*:* {{template is declared here}} 16 17// This code is rejected by clang because clang puts the HLSL built-in types 18// into the HLSL namespace. 19namespace hlsl { 20 struct vector {}; // expected-error {{redefinition of 'vector'}} 21} 22 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 25// vector template. 26struct vector {}; // expected-note {{candidate found by name lookup is 'vector'}} 27 28vector<int,2> VecInt2; // expected-error {{reference to 'vector' is ambiguous}} 29 30// expected-note@*:* {{candidate found by name lookup is 'hlsl::vector'}} 31