================
@@ -5069,14 +5069,30 @@ bool Compiler<Emitter>::visitAPValueInitializer(const
APValue &Val,
}
if (Val.isUnion()) {
const FieldDecl *UnionField = Val.getUnionField();
- const Record *R = this->getRecord(UnionField->getParent());
+ if (!UnionField)
+ // no active fields
+ return true;
+ const Record *R = this->getRecord(T);
assert(R);
const APValue &F = Val.getUnionValue();
const Record::Field *RF = R->getField(UnionField);
- PrimType T = classifyPrim(RF->Decl->getType());
- if (!this->visitAPValue(F, T, E))
+ QualType FieldType = RF->Decl->getType();
+
+ if (OptPrimType PT = classify(FieldType)) {
+ if (!this->visitAPValue(F, *PT, E))
+ return false;
+ if (RF->isBitField())
+ return this->emitInitBitFieldActivate(*PT, RF, E);
----------------
tbaederr wrote:
Of course, not sure why I was confused about that.
https://github.com/llvm/llvm-project/pull/179899
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits