================
@@ -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);
----------------
Sirraide wrote:

Ah yes, that is on purpose. All AST nodes (and everything stored in them) must 
be trivially destructible. The AST nodes are all allocated in a bump pointer 
allocator, so to free them, we just free that allocator. That also means that 
you can never put e.g. a `SmallVector` in an AST node (or anything else that 
has a non-trivial destructor).

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