Skip to content

[HLSL] Missing LValue to RValue cast in implicit cast for HLSLAggregateSplatCast #163593

@spall

Description

@spall

HLSLAggregateSplatCast should always contain an lvalue to rvalue cast.

int1 A = {1};
int4 B = (int4)A;

In this example there is a missing LValue to RValue cast, so the truncation is resulting in an LValue. But before the HLSLVectorTruncation there should be an LValue to RValue cast.

-CStyleCastExpr 0x193fb1c0 <col:15, col:23> 'float4':'vector<float, 4>' <HLSLAggregateSplatCast>
  |     `-ImplicitCastExpr 0x193fb1a8 <col:23> 'float' lvalue <HLSLVectorTruncation> part_of_explicit_cast
  |       `-DeclRefExpr 0x193fb170 <col:23> 'float1':'vector<float, 1>' lvalue ParmVar 0x193faec8 'I4' 'float1':'vector<float, 1>'

Metadata

Metadata

Assignees

Labels

HLSLHLSL Language Supportclang:frontendLanguage frontend issues, e.g. anything involving "Sema"

Type

Projects

Status

Closed

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions