<div dir="ltr"><div>On Mon, Sep 9, 2013 at 5:08 AM, MAYUR PANDEY <span dir="ltr"><<a href="mailto:mayur.p@samsung.com" target="_blank">mayur.p@samsung.com</a>></span> wrote:<br></div><div class="gmail_extra"><div class="gmail_quote">
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">




<div>
<p><span style="font-family:Arial">Hi,</span></p>
<p><span style="font-family:Arial">Attached is the fix for Compiler crash caused by infinite loop when we try to compile the following code.</span></p>
<p><span style="font-family:Arial"></span> </p>
<p><span style="font-family:Arial">struct A;</span></p>
<p><span style="font-family:Arial">struct B<br>{<br>  B (A const &); </span></p>
<p><span style="font-family:Arial">  B (B &); <br>};</span></p>
<p><span style="font-family:Arial">struct A<br>{<br>  A (B);<br>};</span></p>
<p><span style="font-family:Arial">B<br>f (B const& b)<br>{<br>  return b; </span></p>
<p><span style="font-family:Arial">}</span></p></div></blockquote><div>The patch is missing a testcase.  Patches should generally include a corresponding change to clang/test/.  (In this case, somewhere in clang/test/SemaCXX/ is probably appropriate.) <br>
</div><div><br></div><div>This is not the right approach to fixing this issue.  One, we're supposed to detect issues like this inside the InitializationSequence constructor, when we actually check the initialization.  Not handling this correctly will break overload resolution.  Second, using a global map like this is rather suspect: I'm not sure it will cause issues, but introducing global state for something like this makes it more difficult to understand the code.</div>
<div><br></div><div>My guess is that the right fix is somewhere in SemaOverload.cpp: we're probably mishandling this case in the user-defined conversion code somewhere.</div><div><br></div></div>-Eli</div></div>