------- Comment #3 from reichelt at gcc dot gnu dot org  2006-04-12 12:11 
-------
Here's a shorter testcase for the wrong-code problem (using "-O"):
It should return 0, but returns something else since GCC 4.0.2.
The compiler crashes on this testcase with GCC 3.3 - 4.0.1.

=========================================================
struct A
{
  int i;
  A (int j) : i(j) {}
  A (const A &j) : i(j.i) {}
  A& operator= (const A &j) { i = j.i; return *this; }
};

A foo(int j)
{
  return ({ j ? A(1) : A(0); });
}

int main()
{
  return foo(1).i-1;
}
=========================================================


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27115

Reply via email to