<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Feb 4, 2014 at 1:59 PM, Adrian Prantl <span dir="ltr"><<a href="mailto:aprantl@apple.com" target="_blank">aprantl@apple.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im"><br>
On Feb 4, 2014, at 13:48, David Blaikie <<a href="mailto:dblaikie@gmail.com">dblaikie@gmail.com</a>> wrote:<br>
<br>
><br>
><br>
><br>
> On Tue, Feb 4, 2014 at 1:29 PM, Adrian Prantl <<a href="mailto:aprantl@apple.com">aprantl@apple.com</a>> wrote:<br>
> Author: adrian<br>
> Date: Tue Feb  4 15:29:50 2014<br>
> New Revision: 200797<br>
><br>
> URL: <a href="http://llvm.org/viewvc/llvm-project?rev=200797&view=rev" target="_blank">http://llvm.org/viewvc/llvm-project?rev=200797&view=rev</a><br>
> Log:<br>
> Debug info: fix a crasher when when emitting debug info for<br>
> not-yet-completed templated types. getTypeSize() needs a complete type.<br>
><br>
> I assume this test case could be simplified further - is that not the case? Could you explain the sequence of steps that lead to the incomplete type being used here and why the test case tests for a definition when the code causes more cases to be handled as declarations?<br>

<br>
</div>It’s a test for a crasher, so the CHECK line is somewhat arbitrary. But since the fix for the crash involves emitting a (temporary) forward declaration for a type, I decided to at least test that the fwd decl doesn’t end up in the debug info.<br>
</blockquote><div><br></div><div>Seems reasonable/not very arbitrary. I considered other ways to avoid the temporary-ness, but nothing springs immediately to mind.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<div class="im">> (things in the test case that seem overly complicated - two template parameters in Derived/Base, rather than one. A ctor (and out of line at that) in Foo, a recursive call in 'all', etc... )<br>

><br>
> That said, I have encountered some fairly convoluted test cases - I'm not ruling it out, just want to better understand the potentially necessary complexity here.<br>
</div>done in r200798.</blockquote><div><br></div><div> I've further simplified and annotated this a bit in r200805 (ensuring that it still reproduces the problem). I think this is more legible/obvious and explains the issue being addressed. Let me know what you think.<br>
<br>- David</div></div></div></div>