[PATCH] D44536: Avoid segfault when destructor is not yet known

John McCall via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Mar 15 13:52:04 PDT 2018


rjmccall added a comment.

Hmm.  Sema is lazy about actually creating implicit destructor declarations, but it's supposed to only do it whenever the destructor is actually used for something.  I suspect that Sema just thinks that nothing is using c::~c, because the only thing that does use it is d::~d, which is inline and has no apparent users.  But from the stack trace, it seems that IRGen is in fact emitting d::~d.  So the question is, why is IRGen emitting d::~d?  Because AFAIK a non-array new-expression never requires the destructor to exist.


Repository:
  rC Clang

https://reviews.llvm.org/D44536





More information about the cfe-commits mailing list