================
@@ -6938,7 +6938,12 @@ void InitializationSequence::InitializeFrom(Sema &S,
// For HLSL ext vector types we allow list initialization behavior for C++
// functional cast expressions which look like constructor syntax. This is
// accomplished by converting initialization arguments to InitListExpr.
- if (S.getLangOpts().HLSL && Args.size() > 1 &&
+ bool IsHLSLMatToVecOrVecToMatInit =
+ S.getLangOpts().HLSL && Args.size() == 1 &&
+ ((SourceType->isExtVectorType() && DestType->isConstantMatrixType()) ||
+ (SourceType->isConstantMatrixType() && DestType->isExtVectorType()));
+ if (S.getLangOpts().HLSL &&
+ (IsHLSLMatToVecOrVecToMatInit || Args.size() > 1) &&
(DestType->isExtVectorType() || DestType->isConstantMatrixType()) &&
(SourceType.isNull() ||
!Context.hasSameUnqualifiedType(SourceType, DestType))) {
----------------
Icohedron wrote:
I replaced the condition with a call to a boolean lambda expression with early
exits
https://github.com/llvm/llvm-project/pull/177486
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits