[clang] [LifetimeSafety] Refactor function handlng invalidating calls (PR #195064)

via cfe-commits cfe-commits at lists.llvm.org
Thu Apr 30 04:56:53 PDT 2026


================
@@ -387,6 +387,15 @@ bool isInvalidationMethod(const CXXMethodDecl &MD) {
   return InvalidatingMethods->contains(MD.getName());
 }
 
+bool isDestructionFunc(const FunctionDecl &FD) {
+  if (isa<CXXDestructorDecl>(FD))
+    return true;
+  if (const auto *II = FD.getIdentifier();
+      isInStlNamespace(&FD) && II && II->getName() == "destroy_at")
+    return true;
----------------
NeKon69 wrote:

Supporting `std::destroy` and `std::destroy_n` will be much harder than this, so I decided to keep it simple and limited to `std::destroy_at` for now.

https://github.com/llvm/llvm-project/pull/195064


More information about the cfe-commits mailing list