File tree Expand file tree Collapse file tree 2 files changed +23
-0
lines changed Expand file tree Collapse file tree 2 files changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -820,6 +820,19 @@ bool ByteCodeExprGen<Emitter>::VisitImplicitValueInitExpr(const ImplicitValueIni
820
820
return true ;
821
821
}
822
822
823
+ if (QT->isAnyComplexType ()) {
824
+ assert (Initializing);
825
+ QualType ElemQT = QT->getAs <ComplexType>()->getElementType ();
826
+ PrimType ElemT = classifyPrim (ElemQT);
827
+ for (unsigned I = 0 ; I < 2 ; ++I) {
828
+ if (!this ->visitZeroInitializer (ElemT, ElemQT, E))
829
+ return false ;
830
+ if (!this ->emitInitElem (ElemT, I, E))
831
+ return false ;
832
+ }
833
+ return true ;
834
+ }
835
+
823
836
return false ;
824
837
}
825
838
Original file line number Diff line number Diff line change @@ -102,6 +102,16 @@ static_assert(__imag(I3) == 0, "");
102
102
// constexpr _Complex _BitInt(8) A = 0;// = {4};
103
103
104
104
105
+ constexpr _Complex double Doubles[4 ] = {{1.0 , 2.0 }};
106
+ static_assert (__real(Doubles[0 ]) == 1.0, "");
107
+ static_assert (__imag(Doubles[0 ]) == 2.0, "");
108
+ static_assert (__real(Doubles[1 ]) == 0.0, "");
109
+ static_assert (__imag(Doubles[1 ]) == 0.0, "");
110
+ static_assert (__real(Doubles[2 ]) == 0.0, "");
111
+ static_assert (__imag(Doubles[2 ]) == 0.0, "");
112
+ static_assert (__real(Doubles[3 ]) == 0.0, "");
113
+ static_assert (__imag(Doubles[3 ]) == 0.0, "");
114
+
105
115
void func (void ) {
106
116
__complex__ int arr;
107
117
_Complex int result;
You can’t perform that action at this time.
0 commit comments