================
@@ -7170,10 +7282,13 @@ static bool HandleConstructorCall(const Expr *E, const 
LValue &This,
 
   // Reserve space for the struct members.
   if (!Result.hasValue()) {
-    if (!RD->isUnion())
-      Result = APValue(APValue::UninitStruct(), RD->getNumBases(),
-                       RD->getNumFields());
-    else
+    if (!RD->isUnion()) {
+      unsigned NonVirtualBases =
+          llvm::count_if(RD->bases(), [](auto &B) { return !B.isVirtual(); });
----------------
yronglin wrote:

I see multiple calculations of NonVirtualBase. Can we add a new helper 
function? 

https://github.com/llvm/llvm-project/pull/204289
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to