kimgr added a comment.

This was eventually fixed in IWYU based on @jkorous' suggestion above. I 
believe the problem is/was:

- After code is parsed and the AST is built, Sema resets its `TUScope` member 
to null
- We use Sema to lookup and define default constructors before traversing the 
AST using a RAV
- Some yet-not-fully-identified constructs cause Sema to need a TUScope for 
this (something to do with `LazilyCreateBuiltin`, but I haven't been able to 
construct a reduced testcase)

So in 
https://github.com/include-what-you-use/include-what-you-use/commit/5e7843434169a8af333305ebd6e1434cc3cffb66,
 we explicitly re-point `Sema::TUScope` to `Sema::getCurScope()`, which seems 
to have fixed the crash.

This revision can be closed.


Repository:
  rC Clang

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

https://reviews.llvm.org/D54047

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

Reply via email to