[clang] [HLSL] Fix vector list initialization (PR #161421)
Farzon Lotfi via cfe-commits
cfe-commits at lists.llvm.org
Tue Sep 30 12:04:04 PDT 2025
================
@@ -9,12 +9,23 @@ struct S2 { float f; int i; };
[numthreads(1,1,1)]
void entry() {
float2 LilVec = float2(1.0, 2.0);
- float2 BrokenVec = float2(1.0, 2.0, 3.0); // expected-error{{excess elements in vector initializer}}
- float3 NormieVec = float3(LilVec, 3.0, 4.0); // expected-error{{excess elements in vector initializer}}
- float3 BrokenNormie = float3(3.0, 4.0); // expected-error{{too few elements in vector initialization (expected 3 elements, have 2)}}
- float3 OverwhemledNormie = float3(3.0, 4.0, 5.0, 6.0); // expected-error{{excess elements in vector initializer}}
+ float2 BrokenVec = float2(1.0, 2.0, 3.0); // expected-error{{too many initializers in list for type 'float2' (vector of 2 'float' values) (expected 2 but found 3)}}
----------------
farzonl wrote:
Rename this file to `clang/test/SemaHLSL/BuiltIns/vector-constructors-errors.hlsl`
https://github.com/llvm/llvm-project/pull/161421
More information about the cfe-commits
mailing list