================ @@ -5811,9 +5811,12 @@ LValue CodeGenFunction::EmitBinaryOperatorLValue(const BinaryOperator *E) { // This function implements trivial copy assignment for HLSL's // assignable constant arrays. LValue CodeGenFunction::EmitHLSLArrayAssignLValue(const BinaryOperator *E) { - LValue TrivialAssignmentRHS = EmitLValue(E->getRHS()); + // Don't emit an LValue for the RHS because it might not be an LValue LValue LHS = EmitLValue(E->getLHS()); - EmitAggregateAssign(LHS, TrivialAssignmentRHS, E->getLHS()->getType()); + // In C assignment operator RHS is often an RValue. + // EmitAggregateAssign expects an LValue for the RHS so call the below + // function instead. ---------------- llvm-beanz wrote:
minor nit, accept/reject/rework as you see fit.: ```suggestion // In C the RHS of an assignment operator is an RValue. // EmitAggregateAssign takesan LValue for the RHS. Instead we can call // EmitInitializationToLValue to emit an RValue into an LValue. ``` https://github.com/llvm/llvm-project/pull/111047 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits