ahatanak added a comment.

In https://reviews.llvm.org/D44536#1039428, @rjmccall wrote:

> 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'm looking at a similar problem where clang crashes in IRGen because the 
destructor of a class hasn't been added to the AST.

I'm not sure why Sema has to add the declaration lazily on demand rather than 
always adding it after the class definition has been parsed, for example. Could 
you explain the reason for this behavior? Does doing so break something or 
cause mis-compile?

It seems that DeclareImplicitDestructor should be called somewhere, but it's 
not clear to me where it should be called. Calling it at the end of 
Sema::CheckCompletedCXXClass fixes the crash I'm seeing, but that doesn't seem 
to be the right fix.


Repository:
  rC Clang

https://reviews.llvm.org/D44536



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to