File tree Expand file tree Collapse file tree 2 files changed +18
-1
lines changed Expand file tree Collapse file tree 2 files changed +18
-1
lines changed Original file line number Diff line number Diff line change @@ -651,7 +651,14 @@ bool ByteCodeExprGen<Emitter>::VisitLogicalBinOp(const BinaryOperator *E) {
651
651
652
652
template <class Emitter >
653
653
bool ByteCodeExprGen<Emitter>::VisitComplexBinOp(const BinaryOperator *E) {
654
- assert (Initializing);
654
+ // Prepare storage for result.
655
+ if (!Initializing) {
656
+ std::optional<unsigned > LocalIndex = allocateLocal (E, /* IsExtended=*/ false );
657
+ if (!LocalIndex)
658
+ return false ;
659
+ if (!this ->emitGetPtrLocal (*LocalIndex, E))
660
+ return false ;
661
+ }
655
662
656
663
const Expr *LHS = E->getLHS ();
657
664
const Expr *RHS = E->getRHS ();
Original file line number Diff line number Diff line change @@ -93,6 +93,16 @@ static_assert(__imag(I3) == 0, "");
93
93
// / FIXME: This should work in the new interpreter as well.
94
94
// constexpr _Complex _BitInt(8) A = 0;// = {4};
95
95
96
+
97
+ void func (void ) {
98
+ __complex__ int arr;
99
+ _Complex int result;
100
+ int ii = 0 ;
101
+ int bb = 0 ;
102
+ // / The following line will call into the constant interpreter.
103
+ result = arr * ii;
104
+ }
105
+
96
106
namespace CastToBool {
97
107
constexpr _Complex int F = {0 , 1 };
98
108
static_assert (F, " " );
You can’t perform that action at this time.
0 commit comments