------- Comment #7 from jakub at gcc dot gnu dot org  2010-01-27 11:33 -------
int *foo ();

struct A
{
  static int a ();
};

template <class T>
struct B
{
  B (unsigned);
  int b1 (const T &);
  T *b2;
  unsigned b3, b4;
};

template <class T>
int
B <T>::b1 (const T &x)
{
  unsigned i = 0;
  for (; i < b3; i++)
    if (i < b4)
      {
        b2[i] = x;
        *foo () = 12;
        return -1;
      }
}

struct C
{
  C operator= (C x) { c3 = x.c1 (); return *this; }
  ~C () {}
  int c1 () { return c3; }
  void c2 (int x) { c3 = x; }
  int c3;
};

void
bar ()
{
  B <C> b (100);
  C c[100];
  for (int i = 0; i < 100; i++)
    {
      c[i].c2 (i);
      b.b1 (c[i]);
      if (b.b1 (c[i]))
        A::a ();
    }
}


-- 

jakub at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|WAITING                     |NEW
     Ever Confirmed|0                           |1
   Last reconfirmed|2010-01-27 10:46:28         |2010-01-27 11:33:25
               date|                            |


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

Reply via email to