This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/49165] [4.3/4.4/4.5 Regression] ICE on for-loop/throw combination
- From: "gcc at portuosus dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 27 May 2011 07:58:56 +0000
- Subject: [Bug c++/49165] [4.3/4.4/4.5 Regression] ICE on for-loop/throw combination
- Auto-submitted: auto-generated
- References: <bug-49165-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49165
--- Comment #11 from Vijay Rao <gcc at portuosus dot com> 2011-05-27 07:58:25 UTC ---
Does this fix the situation when the 2nd operand of the conditional operator is
of type int?
extern "C" void abort ();
int bar (bool x, int y)
{
if (y < 10 && (x ? 1 : throw 1))
y++;
if (y > 20 || (x ? 1 : throw 2))
y++;
return y;
}
int main ()
{
if (bar (true, 0) != 2
|| bar (true, 10) != 11
|| bar (false, 30) != 31)
abort ();
try
{
bar (false, 0);
abort ();
}
catch (int i)
{
if (i != 1)
abort ();
}
try
{
bar (false, 10);
abort ();
}
catch (int i)
{
if (i != 2)
abort ();
}
}