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