[PATCH] D121993: Mark derived destructors as `override`

Antonio Frighetto via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 18 09:39:17 PDT 2022


antoniofrighetto added inline comments.


================
Comment at: llvm/include/llvm/Analysis/ScalarEvolution.h:227
   SCEVPredicateKind Kind;
-  ~SCEVPredicate() = default;
+  virtual ~SCEVPredicate() = default;
   SCEVPredicate(const SCEVPredicate &) = default;
----------------
dblaikie wrote:
> Why is this being made virtual?
Might be wrong, but, considering that `SCEVPredicate` is being inherited, the order of destruction object should be carried out correctly, when a derived object goes out of scope (even if no instance of the derived object is reachable through a pointer to the base class) . That actually should be added at every level of the hirearchy.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D121993



More information about the llvm-commits mailing list