This is the similar way it has been fixed in gcc. They have kept a note of parent and they break the loop when it is again noticed. With the usage of global
map there are no performance issues as such. Also please suggest the alternate way of fixing this issue.
Thanks,
Mayur
------- Original Message -------
Sender : Eli Friedman<[email protected]>
Date : Sep 10, 2013 06:53 (GMT+09:00)
Title : Re: Fix for ICE in clang due to infinite loop.
On Mon, Sep 9, 2013 at 5:08 AM, MAYUR PANDEY <[email protected]> wrote:
Hi,
Attached is the fix for Compiler crash caused by infinite loop when we try to compile the following code.
struct A;
struct B
{
B (A const &);B (B &);
};struct A
{
A (B);
};B
f (B const& b)
{
return b;}
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.)
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.
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.
|
|
_______________________________________________ cfe-commits mailing list [email protected] http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

