Might want to ask on cfe-dev or irc for more visibility since this review thread isn't getting much action <br><div class="gmail_quote"><div dir="ltr">On Thu, Jun 29, 2017 at 5:12 AM Kim Gräsman via Phabricator <<a href="mailto:reviews@reviews.llvm.org">reviews@reviews.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">kimgr added a comment.<br>
<br>
I did some more debugging today. This happens when we attempt to analyze llvm/Support/MathExtras.h, and only for the function templates that use Microsoft intrinsics (e.g. `_BitScanForward` in `TrailingZerosCounter<T>`.) So there's something in the parsing of builtins/intrinsics that requires `TUScope` to be non-null.<br>
<br>
Can we seed Sema with a valid `TUScope` before invoking `LateTemplateParser`, and if so, how? Or is this because we invoke the parser multiple times? I'm guessing Clang is already done parsing when we invoke the late template parsing.<br>
<br>
Grateful for any ideas here.<br>
<br>
<br>
<a href="https://reviews.llvm.org/D31697" rel="noreferrer" target="_blank">https://reviews.llvm.org/D31697</a><br>
<br>
<br>
<br>
</blockquote></div>