================
@@ -1877,6 +1887,93 @@ void InitListChecker::CheckReferenceType(const 
InitializedEntity &Entity,
     AggrDeductionCandidateParamTypes->push_back(DeclType);
 }
 
+void InitListChecker::CheckMatrixType(const InitializedEntity &Entity,
----------------
farzonl wrote:

Well three things  First SemaHLSL is validating vectors and yet we still have 
`CheckVectorType` which even has HLSL copy initalization.

Second removing 
```cpp
} else if (DeclType->isMatrixType()) {
    CheckMatrixType(Entity, IList, DeclType, Index, StructuredList,
                    StructuredIndex);
  }
```
causes us to hit this else case:
https://github.com/llvm/llvm-project/blob/0c2913afc82a683d82f16f09442d49b1fb25ca67/clang/lib/Sema/SemaInit.cpp#L1481-L1486

Third even if we do something like below to avoid the 
err_illegal_initializer_type diag message
```cpp
} else if (DeclType->isMatrixType()) {
    return;
  }
```
we still error with `excess elements in matrix initializer`. So 
`CheckMatrixType` is necessary. 

https://github.com/llvm/llvm-project/pull/162743
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to