[PATCH] D28162: [ADT] Delete RefCountedBaseVPTR.

David Blaikie via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Dec 29 10:45:11 PST 2016

dblaikie accepted this revision.
dblaikie added a comment.
This revision is now accepted and ready to land.

Looks good - thanks for the cleanup!

Comment at: llvm/unittests/ADT/IntrusiveRefCntPtrTest.cpp:14-37
+struct VirtualRefCounted : public llvm::RefCountedBase<VirtualRefCounted> {
+  VirtualRefCounted() { ++NumInstances; }
+  VirtualRefCounted(const VirtualRefCounted &) { ++NumInstances; }
+  virtual ~VirtualRefCounted() { --NumInstances; }
   virtual void f() {}
+  static int NumInstances;
I'm not sure we even need test coverage for this anymore.

If IntrusiveRefCntPtr calls any dtor (& we should have some coverage of that, to be sure) then it'd be basically impossible for it to call the dtor in a way that wouldn't be compatible with that dtor dispatching if it was virtual. (ie: this test sort of boils down to testing virtual dispatch of virtual dtors - a feature of the compiler, not of this library)

But up to you.


More information about the cfe-commits mailing list