================
@@ -3637,6 +3637,15 @@ FunctionProtoType::FunctionProtoType(QualType result, 
ArrayRef<QualType> params,
     auto &EllipsisLoc = *getTrailingObjects<SourceLocation>();
     EllipsisLoc = epi.EllipsisLoc;
   }
+
+  if (epi.FunctionEffects) {
+    auto &ExtraBits = *getTrailingObjects<FunctionTypeExtraBitfields>();
+    ExtraBits.HasFunctionEffects = true;
+
+    // N.B. This is uninitialized storage.
+    FunctionEffectSet *PFX = getTrailingObjects<FunctionEffectSet>();
+    new (PFX) FunctionEffectSet(epi.FunctionEffects);
----------------
dougsonos wrote:

It would also appear that neither `FunctionProtoType` nor `TrailingObjects` has 
any provision for invoking the destructors of the trailing objects. Is it okay 
that they are leaked?

https://github.com/llvm/llvm-project/pull/84983
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to