diff options
author | Chris B <chris.bieneman@me.com> | 2024-02-15 14:58:06 -0600 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-02-15 14:58:06 -0600 |
commit | 5c57fd717d5d6a285efeb8402c6fe0c8f70592f3 (patch) | |
tree | cd4b71c05decd37f40090f06456570ad485e044e /clang/lib/Sema/SemaInit.cpp | |
parent | edfc859af89e44207bf499b5d702aa26a7357da4 (diff) | |
download | llvm-5c57fd717d5d6a285efeb8402c6fe0c8f70592f3.zip llvm-5c57fd717d5d6a285efeb8402c6fe0c8f70592f3.tar.gz llvm-5c57fd717d5d6a285efeb8402c6fe0c8f70592f3.tar.bz2 |
[HLSL] Vector standard conversions (#71098)
HLSL supports vector truncation and element conversions as part of
standard conversion sequences. The vector truncation conversion is a C++
second conversion in the conversion sequence. If a vector truncation is
in a conversion sequence an element conversion may occur after it before
the standard C++ third conversion.
Vector element conversions can be boolean conversions, floating point or
integral conversions or promotions.
[HLSL Draft
Specification](https://microsoft.github.io/hlsl-specs/specs/hlsl.pdf)
---------
Co-authored-by: Aaron Ballman <aaron@aaronballman.com>
Diffstat (limited to 'clang/lib/Sema/SemaInit.cpp')
-rw-r--r-- | clang/lib/Sema/SemaInit.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/lib/Sema/SemaInit.cpp b/clang/lib/Sema/SemaInit.cpp index b6de064..0fd4588 100644 --- a/clang/lib/Sema/SemaInit.cpp +++ b/clang/lib/Sema/SemaInit.cpp @@ -6432,7 +6432,7 @@ void InitializationSequence::InitializeFrom(Sema &S, // For HLSL ext vector types we allow list initialization behavior for C++ // constructor syntax. This is accomplished by converting initialization // arguments an InitListExpr late. - if (S.getLangOpts().HLSL && DestType->isExtVectorType() && + if (S.getLangOpts().HLSL && Args.size() > 1 && DestType->isExtVectorType() && (SourceType.isNull() || !Context.hasSameUnqualifiedType(SourceType, DestType))) { |