[PATCH] D53860: [SemaCXX] Don't check base's dtor is accessible

John McCall via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Oct 30 02:21:20 PDT 2018


rjmccall added a comment.

That's interesting.  If you think of a list-initialization of an aggregate as effectively defining an *ad hoc* constructor for it, then yes, we clearly ought to have access to protected destructors of base classes.  And that aligns with the intuition that people make their destructors protected in order to prevent types from being constructed except as base sub-objects, which is still valid here.  But at the same time, at a low level, we are directly accessing a protected destructor from a context that is not code actually defined in a subclass.


Repository:
  rC Clang

https://reviews.llvm.org/D53860





More information about the cfe-commits mailing list