New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
A testcase for iwyu crash while analyzing llvm 7+ #601
A testcase for iwyu crash while analyzing llvm 7+ #601
Conversation
No surprise checks are failing. |
A link to the clang change. |
I ran this crash through a debugger, and this actually seems to hit So I don't think this has anything to do with late-parsed templates, but rather is a more pressing problem with us trying to force-instantiate implicit ctors/dtors. |
This is most likely related to #419 (it's crashing on a NULL |
This is a good testcase, but we don't have any XFAIL facility in the current infrastructure, so we can |
In some scenarios when looking up and defining implicit methods, Sema assumes that its TUScope member is non-null. It turns out Sema resets TUScope at the end of parsing the translation unit, so the AST visitors are not expected to need a translation unit decl scope. Since our function template parsing and instantiation of implicit methods triggers quite a lot of Sema code, we've hit quite a few crashes on this in more complex scenarios with templates. Explicitly wire TUScope to Sema::getCurScope, to ensure there is a scope available for lookup and method synthesis. This fixes examples posted in include-what-you-use#151, include-what-you-use#419, include-what-you-use#601 and include-what-you-use#820.
In some scenarios when looking up and defining implicit methods, Sema assumes that its TUScope member is non-null. It turns out Sema resets TUScope at the end of parsing the translation unit, so the AST visitors are not expected to need a translation unit decl scope. Since our function template parsing and instantiation of implicit methods triggers quite a lot of Sema code, we've hit quite a few crashes on this in more complex scenarios with templates. Explicitly wire TUScope to Sema::getCurScope, to ensure there is a scope available for lookup and method synthesis. This fixes examples posted in include-what-you-use#151, include-what-you-use#419, include-what-you-use#601 and include-what-you-use#820.
In some scenarios when looking up and defining implicit methods, Sema assumes that its TUScope member is non-null. It turns out Sema resets TUScope at the end of parsing the translation unit, so the AST visitors are not expected to need a translation unit decl scope. Since our function template parsing and instantiation of implicit methods triggers quite a lot of Sema code, we've hit quite a few crashes on this in more complex scenarios with templates. Explicitly wire TUScope to Sema::getCurScope, to ensure there is a scope available for lookup and method synthesis. This fixes examples posted in include-what-you-use#151, include-what-you-use#419, include-what-you-use#601 and include-what-you-use#820.
In some scenarios when looking up and defining implicit methods, Sema assumes that its TUScope member is non-null. It turns out Sema resets TUScope at the end of parsing the translation unit, so the AST visitors are not expected to need a translation unit decl scope. Since our function template parsing and instantiation of implicit methods triggers quite a lot of Sema code, we've hit quite a few crashes on this in more complex scenarios with templates. Explicitly wire TUScope to Sema::getCurScope, to ensure there is a scope available for lookup and method synthesis. This fixes examples posted in include-what-you-use#151, include-what-you-use#419, include-what-you-use#601, include-what-you-use#673 and include-what-you-use#820. Use minimal repro from include-what-you-use#673 to build a half-hearted testcase.
In some scenarios when looking up and defining implicit methods, Sema assumes that its TUScope member is non-null. It turns out Sema resets TUScope at the end of parsing the translation unit, so the AST visitors are not expected to need a translation unit decl scope. Since our function template parsing and instantiation of implicit methods triggers quite a lot of Sema code, we've hit quite a few crashes on this in more complex scenarios with templates. Explicitly wire TUScope to Sema::getCurScope, to ensure there is a scope available for lookup and method synthesis. This fixes examples posted in #151, #419, #601, #673 and #820. Use minimal repro from #673 to build a half-hearted testcase.
This testcase reproduces a problem with iwyu-ing llvm.
The problem still exists.
I am testing a fix on the clang side.
Irregardless of where the fix happens, a reproducing test is needed.