diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 344c1c32f35e367e1f746185e494ab2b9c5f8108..a81e931503ba2b14550f1d44b08893e6c823851d 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,28 @@
+2002-01-25  Jakub Jelinek  <jakub@redhat.com>
+
+	* g++.old-deja/g++.other/eh5.C: New test.
+	* g++.old-deja/g++.other/sibcall2.C: New test.
+	* g++.old-deja/g++.other/array9.C: New test.
+	* g++.old-deja/g++.other/typename2.C: New test.
+	* g++.old-deja/g++.other/crash60.C: New test.
+	* g++.old-deja/g++.other/conv9.C: New test.
+	* g++.old-deja/g++.other/mangle10.C: New test.
+	* g++.old-deja/g++.other/unchanging1.C: New test.
+	* g++.old-deja/g++.other/exprstmt1.C: New test.
+	* g++.old-deja/g++.other/inline23.C: New test.
+	* g++.old-deja/g++.eh/ia64-1.C: New test.
+	* g++.old-deja/g++.other/dwarf2-1.C: New test.
+	* g++.old-deja/g++.other/mangle11.C: New test.
+	* g++.old-deja/g++.other/reload1.C: New test.
+	* g++.old-deja/g++.other/static20.C: New test.
+	* g++.old-deja/g++.other/local-alloc1.C: New test.
+	* g++.old-deja/g++.other/conv8.C: New test.
+	* g++.old-deja/g++.other/stmtexpr2.C: New test.
+	* g++.old-deja/g++.other/storeexpr1.C: New test.
+	* g++.old-deja/g++.other/storeexpr2.C: New test.
+	* g++.dg/eh/template2.C: New test.
+	* g++.dg/warn/weak1.C: New test.
+
 2002-01-25  Hans-Peter Nilsson  <hp@bitrange.com>
 
 	* lib/scanasm.exp (scan-assembler-dem, scan-assembler-dem-not):
diff --git a/gcc/testsuite/g++.dg/eh/template2.C b/gcc/testsuite/g++.dg/eh/template2.C
new file mode 100644
index 0000000000000000000000000000000000000000..ed389328677cd3442823e95f2849582c1001be10
--- /dev/null
+++ b/gcc/testsuite/g++.dg/eh/template2.C
@@ -0,0 +1,19 @@
+// { dg-do compile }
+// { dg-options -O2 }
+
+template<class T> struct O {
+  O(T *p) : q(p) { }
+  T *q;
+};
+struct W {
+  virtual ~W();
+};
+struct S : public W {
+  S (int *);
+};
+W *bar(int);
+S::S (int *x)
+{
+  for (int *p = x; *p; p++)
+    O<W> i (bar (*p));
+}
diff --git a/gcc/testsuite/g++.dg/warn/weak1.C b/gcc/testsuite/g++.dg/warn/weak1.C
new file mode 100644
index 0000000000000000000000000000000000000000..192f6dcdf263100684d1156a3fdb584f21978369
--- /dev/null
+++ b/gcc/testsuite/g++.dg/warn/weak1.C
@@ -0,0 +1,12 @@
+// { dg-do run }
+
+extern void foo (void) __attribute__ ((weak));
+
+int
+main ()
+{
+  if (&foo)
+    foo ();
+
+  return 0;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.eh/ia64-1.C b/gcc/testsuite/g++.old-deja/g++.eh/ia64-1.C
new file mode 100644
index 0000000000000000000000000000000000000000..441c0c13898db8a869aec7bdc0da860abb1c849f
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.eh/ia64-1.C
@@ -0,0 +1,72 @@
+// Special g++ Options: -O2
+
+#include <exception>
+
+using namespace std;
+
+extern "C" void abort();
+
+int i0, i1, i2, i3, i4, i5, i6, i7, i8, i9;
+int j0, j1, j2, j3, j4, j5, j6, j7, j8, j9;
+int k0, k1, k2, k3, k4, k5, k6, k7, k8, k9;
+int l0, l1, l2, l3, l4, l5, l6, l7, l8, l9;
+#define A(x,y,n) register int *x##n = &y##n;
+#define B(x,y) \
+  A(x,y,0) A(x,y,1) A(x,y,2) A(x,y,3) A(x,y,4) \
+  A(x,y,5) A(x,y,6) A(x,y,7) A(x,y,8) A(x,y,9)
+#define C(x,n) asm volatile ("" : "=r" (x##n) : "0" (x##n));
+#define D(x) \
+  C(x,0) C(x,1) C(x,2) C(x,3) C(x,4) \
+  C(x,5) C(x,6) C(x,7) C(x,8) C(x,9)
+#define E(x,y,n) if (x##n != &y##n) abort ();
+#define F(x,y) \
+  E(x,y,0) E(x,y,1) E(x,y,2) E(x,y,3) E(x,y,4) \
+  E(x,y,5) E(x,y,6) E(x,y,7) E(x,y,8) E(x,y,9)
+
+void bar(long a0, long a1, long a2, long a3, long a4)
+{
+}
+
+void foo(long a0, long a1, long a2, long a3, long a4)
+{
+  A(p,l,0) A(p,l,1) A(p,l,2)
+  C(p,0) C(p,1) C(p,2)
+  bar (0, 1, 2, 3, 4);
+  if (a0 == 0)
+    throw exception();
+  C(p,0) C(p,1) C(p,2)
+  E(p,l,0) E(p,l,1) E(p,l,2)
+}
+
+void test(void)
+{
+  A(p,l,0) A(p,l,1) A(p,l,2) A(p,l,3) A(p,l,4) A(p,l,5) A(p,l,6)
+  C(p,0) C(p,1) C(p,2) C(p,3) C(p,4) C(p,5) C(p,6)
+  try {
+    foo(0, 1, 2, 3, 4);
+  } catch (exception) {}
+  C(p,0) C(p,1) C(p,2) C(p,3) C(p,4) C(p,5) C(p,6)
+  E(p,l,0) E(p,l,1) E(p,l,2) E(p,l,3) E(p,l,4) E(p,l,5) E(p,l,6)
+}
+
+int main()
+{
+  B(x,i)
+  B(y,j)
+  B(z,k)
+  A(p,l,0) A(p,l,1) A(p,l,2) A(p,l,3)
+  D(x)
+  D(y)
+  D(z)
+  C(p,0) C(p,1) C(p,2) C(p,3)
+  test();
+  D(x)
+  D(y)
+  D(z)
+  C(p,0) C(p,1) C(p,2) C(p,3)
+  F(x,i)
+  F(y,j)
+  F(z,k)
+  E(p,l,0) E(p,l,1) E(p,l,2) E(p,l,3)
+  return 0;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/array9.C b/gcc/testsuite/g++.old-deja/g++.other/array9.C
new file mode 100644
index 0000000000000000000000000000000000000000..7864c9b1f169ded874e843ebd4394dc653aeceb8
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/array9.C
@@ -0,0 +1,6 @@
+// Build don't link:
+
+template <class T> class A {
+  T *d;
+  public: void f() { (T[10])d; }
+};
diff --git a/gcc/testsuite/g++.old-deja/g++.other/conv8.C b/gcc/testsuite/g++.old-deja/g++.other/conv8.C
new file mode 100644
index 0000000000000000000000000000000000000000..9ab3b7421fd55a3228262188cad28dab0f589c52
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/conv8.C
@@ -0,0 +1,31 @@
+// Build don't link:
+// Origin: Jakub Jelinek <jakub@redhat.com>
+
+class bar
+{
+public:
+    bar();
+    virtual ~bar();
+    static void a();
+};
+
+class baz : public bar
+{
+};
+
+class foo : virtual public baz
+{
+public:
+    static void a();
+    void b();
+};
+
+typedef void (bar::*T)();
+T d;
+
+void foo::a()
+{
+    typedef void(foo::*t)();
+    t c = & foo::b;
+    d = (T) c;			// WARNING - pointer to member cast
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/conv9.C b/gcc/testsuite/g++.old-deja/g++.other/conv9.C
new file mode 100644
index 0000000000000000000000000000000000000000..4fd022b5ed0f9bd64ba0fd8a9d5f92b5d8ca23a8
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/conv9.C
@@ -0,0 +1,31 @@
+// Build don't link:
+
+struct
+Foo
+{
+public:
+  typedef void* (*copier_fn)(void const*);
+  void foo() const;
+  void bar(char const*, void const*) const;
+private:
+  struct
+  Bar
+  {
+    char const* key;
+    void const* item;
+  };
+};
+
+void
+Foo::foo() const
+{
+  Bar* cp = 0;
+  copier_fn copyfn = 0;
+
+  bar(cp->key, cp->item);
+  bar(cp->key, (copyfn) ? (*copyfn)(cp) : 0);
+  bar(cp->key, (copyfn) ? (*copyfn)(0) : 0);
+
+  bar(cp->key, (copyfn) ? (*copyfn)(0) : cp->item);
+  bar(cp->key, (copyfn) ? (*copyfn)(cp) : cp->item);
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/crash60.C b/gcc/testsuite/g++.old-deja/g++.other/crash60.C
new file mode 100644
index 0000000000000000000000000000000000000000..55266749b555925c575ef89bd1b3989423f262fb
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/crash60.C
@@ -0,0 +1,7 @@
+// Build don't link:
+
+void foo ()
+{
+  int e;
+  e := e;	// ERROR - parse error
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/dwarf2-1.C b/gcc/testsuite/g++.old-deja/g++.other/dwarf2-1.C
new file mode 100644
index 0000000000000000000000000000000000000000..24c8a4d43279f2d3bdeebd6fb38a076aef1afa73
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/dwarf2-1.C
@@ -0,0 +1,11 @@
+// Build don't link:
+// Special g++ Options: -gdwarf-2 -O0
+
+int foo()
+{
+  int a = 1;
+  int b = 1;
+  int e[a][b];
+  e[0][0] = 0;
+  return e[a-1][b-1];
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/eh5.C b/gcc/testsuite/g++.old-deja/g++.other/eh5.C
new file mode 100644
index 0000000000000000000000000000000000000000..9d0acf439c95f6dc8c547e8c0e811f8274f0c0af
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/eh5.C
@@ -0,0 +1,34 @@
+// Build don't link:
+// Special g++ Options: -O2
+
+struct X {};
+
+struct Y
+{
+  Y();
+  virtual ~Y();
+};
+
+struct Z
+{
+  int f (const int *x);
+  int g;
+};
+
+inline int
+operator<< (Z &os, int x)
+{
+  os.f (&x);
+  return os.g;
+}
+
+void foo (Z &a, X *b, X &c)
+{
+  X *d = b;
+  int e = 0;
+  Z &f = a;
+  if (!(f << e))
+    do { do { } while (&c == 0); throw Y(); } while (0);
+  do { } while (&d == 0);
+  do { } while (&c == 0);
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/exprstmt1.C b/gcc/testsuite/g++.old-deja/g++.other/exprstmt1.C
new file mode 100644
index 0000000000000000000000000000000000000000..028ddaddd6d8551a5930b5e5fee95d143dc31c81
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/exprstmt1.C
@@ -0,0 +1,23 @@
+// Special g++ Options: -O
+
+int main()
+{
+  unsigned int x = 1381237248;
+
+  if (sizeof (x) != 4)
+    return 0;
+
+  x =
+    ({
+      unsigned int y = x;
+      ({
+        unsigned int z = y;
+        (unsigned int)
+          ((((unsigned int)z & (unsigned int)0x000000ffUL) << 24)
+           | (((unsigned int)z & (unsigned int)0x0000ff00UL) << 8)
+           | (((unsigned int)z & (unsigned int)0x00ff0000UL) >> 8)
+           | (((unsigned int)z & (unsigned int)0xff000000UL) >> 24));
+       });
+     });
+  return x != 152658;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/inline23.C b/gcc/testsuite/g++.old-deja/g++.other/inline23.C
new file mode 100644
index 0000000000000000000000000000000000000000..3a323e02298331d87f942352e58781e69a59ee4a
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/inline23.C
@@ -0,0 +1,28 @@
+// Build don't run:
+
+struct B
+{
+  virtual ~B() {}
+};
+
+struct A : public B
+{
+  ~A();
+  void foo(void);
+  void bar(void);
+};
+
+inline void A::foo(void)
+{
+  static int i;
+  i++;
+}
+
+void A::bar()
+{
+  foo();
+}
+
+int main()
+{
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/local-alloc1.C b/gcc/testsuite/g++.old-deja/g++.other/local-alloc1.C
new file mode 100644
index 0000000000000000000000000000000000000000..d58b9b71289dc9e1ce68ad4ce2bf6a25d055bbc0
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/local-alloc1.C
@@ -0,0 +1,16 @@
+// Build don't link:
+// Origin: Jakub Jelinek <jakub@redhat.com>
+// Special g++ Options: -O0 -fpic
+
+struct bar {
+  bar() {}
+  double x[3];
+};
+
+static bar y[4];
+
+void foo(int z)
+{
+  bar w;
+  y[z] = w;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/mangle10.C b/gcc/testsuite/g++.old-deja/g++.other/mangle10.C
new file mode 100644
index 0000000000000000000000000000000000000000..8d5bb48a2129b09606d6fc3b2cffde8c6c1204b5
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/mangle10.C
@@ -0,0 +1,26 @@
+// Build don't link:
+
+template<int T>
+struct A {
+  char *a;
+  A (const char* x)
+  {
+    a = (char*) x;
+  }
+};
+
+template<int U, int V, class T>
+struct B {
+  T a[V-U+1];
+  friend A<V-U+1> f (B const &x)
+  {
+    return A<V-U+1> ((char*) x.a);
+  }
+};
+
+const int a = 8;
+
+typedef B<1,a,int> C;
+struct D {
+  C x;
+};
diff --git a/gcc/testsuite/g++.old-deja/g++.other/mangle11.C b/gcc/testsuite/g++.old-deja/g++.other/mangle11.C
new file mode 100644
index 0000000000000000000000000000000000000000..d77a4b548de8eaef657e4d5d8c882639e3bff8e5
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/mangle11.C
@@ -0,0 +1,41 @@
+struct foo {
+  static int bar ()
+  {
+    int i;
+    static int baz = 1;
+    {
+      static int baz = 2;
+      i = baz++;
+    }
+    {
+      struct baz {
+        static int m ()
+        {
+          static int n;
+          return n += 10;
+        }
+      };
+      baz a;
+      i += a.m ();
+    }
+    {
+      static int baz = 3;
+      i += baz;
+      baz += 30;
+    }
+    i += baz;
+    baz += 60;
+    return i;
+  }
+};
+
+int main ()
+{
+  foo x;
+
+  if (x.bar () != 16)
+    return 1;
+  if (x.bar() != 117)
+    return 1;
+  return 0;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/reload1.C b/gcc/testsuite/g++.old-deja/g++.other/reload1.C
new file mode 100644
index 0000000000000000000000000000000000000000..4ad0d6838838c3f480aae2eef19a92be2f674133
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/reload1.C
@@ -0,0 +1,46 @@
+extern "C" void abort ();
+
+struct A {
+  unsigned long long u;
+} *a;
+
+struct B {
+  unsigned long long v;
+  unsigned long long w ()
+  {
+    return a->u - v;
+  }
+} b;
+
+struct C {
+  static unsigned long long x;
+  static void y (unsigned long long z);
+};
+
+unsigned long long C::x = 0;
+
+int main ()
+{
+  a = new A;
+  b.v = 333418;
+  a->u = 1132270;
+  C::x = 0;
+  C::y (799016);
+}
+
+void foo (unsigned long long a, unsigned long long b, unsigned long long c)
+{
+}
+
+void C::y (unsigned long long z)
+{
+  unsigned long long c = b.w () - x;
+  if (z < b.w ())
+    {
+      if ((long long) c < 0)
+	{
+	  foo (b.w (), a->u, b.v);
+	  abort ();
+	}
+    }
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/sibcall2.C b/gcc/testsuite/g++.old-deja/g++.other/sibcall2.C
new file mode 100644
index 0000000000000000000000000000000000000000..0248574b52177ba12c31ddc6e60b29a432c02a5e
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/sibcall2.C
@@ -0,0 +1,19 @@
+// Build don't link:
+// Special g++ Options: -O2 -foptimize-sibling-calls -fno-exceptions
+
+struct X
+{
+  const char *c() const { return b; };
+  char *b;
+};
+extern "C" int f (const char *);
+struct A
+{
+   X x;
+   void y();
+};
+void A::y()
+{
+  const char *const a[] = { x.c() };
+  f (a[0]);
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/static20.C b/gcc/testsuite/g++.old-deja/g++.other/static20.C
new file mode 100644
index 0000000000000000000000000000000000000000..08db2db6e97469613ab883a9d90f713bfdb47dc0
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/static20.C
@@ -0,0 +1,13 @@
+// Build don't run:
+struct foo
+{
+  foo() {};
+  ~foo() {};
+  void func() { static foo x; };
+};
+
+int main()
+{
+   foo f;
+   return 0;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/stmtexpr2.C b/gcc/testsuite/g++.old-deja/g++.other/stmtexpr2.C
new file mode 100644
index 0000000000000000000000000000000000000000..3b35fd3a443497a3b32ed23510f0d19e98fbe8cc
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/stmtexpr2.C
@@ -0,0 +1,9 @@
+// Build don't link:
+// Special g++ Options: -O2
+// Origin: Jakub Jelinek <jakub@redhat.com>
+
+void bar(int);
+void foo(int x)
+{
+  bar(({ int y; y = x; }));
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/store-expr1.C b/gcc/testsuite/g++.old-deja/g++.other/store-expr1.C
new file mode 100644
index 0000000000000000000000000000000000000000..ea7c3527835590883743e8fc4dbbc0177cbf7ead
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/store-expr1.C
@@ -0,0 +1,87 @@
+// Skip if not target: i?86-*-*
+// Special g++ Options: -mcpu=i686 -O2 -fpic
+class G {};
+
+struct N {
+  N *a;
+};
+
+struct V {
+  typedef N *W;
+  W *m, *n;
+  int s() const { return int(n - m); }
+  const W &operator[](int x) const { return *(m + x); }
+};
+
+struct H;
+
+struct J {
+  N *c;
+  H *d;
+  J(N *x, H *y) : c(x), d(y) {}
+};
+
+struct K {
+  const N *c;
+  const H *d;
+  K(const N *x, const H *y) : c(x), d(y) {}
+  K(const J &x) : c(x.c), d(x.d) {}
+};
+
+struct H {
+  V e;
+  int f;
+
+  J u()
+  {
+    for (int x = 0; x < e.s(); ++x)
+      if (e[x])
+        return J(e[x], this);
+    return v();
+  }
+  J v() { return J((N*)64, this); }
+};
+
+struct I {
+  H d;
+  J u() { return d.u(); }
+  J v() { return d.v(); }
+};
+
+struct bar {
+  virtual ~bar() {}
+};
+
+struct E {
+  K g;
+  E(K x) : g(x) {}
+};
+
+struct foo : public bar {
+  K h;
+  E i;
+  foo(const K x, const E &y) : h(x), i(y) {}
+};
+
+struct A {
+  I *l;
+  foo *baz() const;
+};
+
+foo *A::baz() const
+{
+  return new foo(l->u(), E(l->v()));
+}
+
+A x;
+I i;
+foo *f;
+
+int main ()
+{
+  x.l = &i;
+  f = x.baz();
+  if (f->h.c != f->i.g.c || f->h.d != f->i.g.d)
+    return 1;
+  return 0;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/store-expr2.C b/gcc/testsuite/g++.old-deja/g++.other/store-expr2.C
new file mode 100644
index 0000000000000000000000000000000000000000..8724e19fdb5b0f7718a2a96f2d464ea32bf91e4e
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/store-expr2.C
@@ -0,0 +1,87 @@
+// Skip if not target: i?86-*-*
+// Special g++ Options: -mcpu=i686 -O2
+class G {};
+
+struct N {
+  N *a;
+};
+
+struct V {
+  typedef N *W;
+  W *m, *n;
+  int s() const { return int(n - m); }
+  const W &operator[](int x) const { return *(m + x); }
+};
+
+struct H;
+
+struct J {
+  N *c;
+  H *d;
+  J(N *x, H *y) : c(x), d(y) {}
+};
+
+struct K {
+  const N *c;
+  const H *d;
+  K(const N *x, const H *y) : c(x), d(y) {}
+  K(const J &x) : c(x.c), d(x.d) {}
+};
+
+struct H {
+  V e;
+  int f;
+
+  J u()
+  {
+    for (int x = 0; x < e.s(); ++x)
+      if (e[x])
+        return J(e[x], this);
+    return v();
+  }
+  J v() { return J((N*)64, this); }
+};
+
+struct I {
+  H d;
+  J u() { return d.u(); }
+  J v() { return d.v(); }
+};
+
+struct bar {
+  virtual ~bar() {}
+};
+
+struct E {
+  K g;
+  E(K x) : g(x) {}
+};
+
+struct foo : public bar {
+  K h;
+  E i;
+  foo(const K x, const E &y) : h(x), i(y) {}
+};
+
+struct A {
+  I *l;
+  foo *baz() const;
+};
+
+foo *A::baz() const
+{
+  return new foo(l->u(), E(l->v()));
+}
+
+A x;
+I i;
+foo *f;
+
+int main ()
+{
+  x.l = &i;
+  f = x.baz();
+  if (f->h.c != f->i.g.c || f->h.d != f->i.g.d)
+    return 1;
+  return 0;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/typename2.C b/gcc/testsuite/g++.old-deja/g++.other/typename2.C
new file mode 100644
index 0000000000000000000000000000000000000000..78df7b213de9159f9881f5b61c515f4682262fa3
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/typename2.C
@@ -0,0 +1,7 @@
+// Build don't link:
+
+template<typename T>
+void f()
+{
+  typename T::u;  // ERROR - declare anything
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/unchanging1.C b/gcc/testsuite/g++.old-deja/g++.other/unchanging1.C
new file mode 100644
index 0000000000000000000000000000000000000000..6bad7a45ccda27969b6081d4d73992601b5d6d25
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/unchanging1.C
@@ -0,0 +1,45 @@
+// Special g++ Options: -O2
+
+#include <iostream>
+#include <complex>
+
+using namespace std;
+
+class A {
+protected:
+  int a;
+  complex<double> *b;
+public:
+  A(int n);
+  inline complex<double>& operator[] (int x);
+};
+
+A::A(int n)
+{
+  a = n;
+  b = new complex<double>[a];
+  for (int i=0; i<a; i++) b[i] = complex<double>(0.0,0.0);
+}
+
+inline complex<double>& A::operator[](int x)
+{
+  if (x < 0 || x >= a)
+    cout << "x error" << endl;
+  return b[x];
+}
+
+void foo ()
+{
+  int n = 5;
+  A *o = new A(n);
+  A *p = new A(n);
+  for (int i = 0; i < n; i++) {
+    cout << i << endl;
+    (*o)[i] *= complex<double>((*p)[i].real(), (*p)[i].imag());
+  }
+}
+
+int main()
+{
+  foo();
+}