[PATCH] D66646: Ensure that statements, expressions and types are trivially destructible with a static_assert

Bruno Ricci via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sun Aug 25 04:19:42 PDT 2019


riccibruno added a comment.

> I was looking at SpecificBumpPtrAllocator, which knows it's type.
>  But if i look down the indirection, i think AllocatorBase::Allocate<T>()/AllocatorBase::Deallocate<T>() is the place.

I did look at that, but I think it won't work for two reasons:

1. AST nodes are very often allocated with some trailing objects and so the typed version of `Allocate` is not used.
2. It would be difficult to add exceptions as done in this patch. The two exceptions I added are (I think!) latent bugs, but they seem to be relatively harmless (for `ConstantArrayType` you would need to have an array with a size which do not fit inline in the `APInt`, and then it would only cause a leak).

In time it would be nice to just remove the two exceptions, but then point 1 still apply.


Repository:
  rC Clang

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D66646/new/

https://reviews.llvm.org/D66646





More information about the cfe-commits mailing list