[clang] [HLSL][Matrix] Add implicit type conversions for constant matrix types (PR #181939)
Farzon Lotfi via cfe-commits
cfe-commits at lists.llvm.org
Wed Feb 18 09:15:26 PST 2026
================
@@ -238,9 +238,10 @@ void matOrVec3(float4x4 F) {}
export void Case8(float2x3 f23, float4x4 f44, float3x3 f33, float3x2 f32) {
int2x2 i22 = f23;
- // expected-warning at -1{{implicit conversion truncates matrix: 'float2x3' (aka 'matrix<float, 2, 3>') to 'int2x2' (aka 'matrix<int, 2, 2>')}}
+ // expected-warning at -1{{implicit conversion truncates matrix: 'float2x3' (aka 'matrix<float, 2, 3>') to 'matrix<int, 2, 2>'}}
//CHECK: VarDecl {{.*}} i22 'int2x2':'matrix<int, 2, 2>' cinit
- //CHECK-NEXT: ImplicitCastExpr {{.*}} 'int2x2':'matrix<int, 2, 2>' <FloatingToIntegral>
+ //CHECK-NEXT: ImplicitCastExpr {{.*}} 'matrix<int, 2, 2>' <HLSLMatrixTruncation>
----------------
farzonl wrote:
hmm, this seems more correct than before. suprising we could do the implicit cast without `HLSLMatrixTruncation`
https://github.com/llvm/llvm-project/pull/181939
More information about the cfe-commits
mailing list