X-Git-Url: https://oss.titaniummirror.com/gitweb/?a=blobdiff_plain;f=gcc%2Ftestsuite%2Fg%2B%2B.old-deja%2Fg%2B%2B.other%2Funchanging1.C;fp=gcc%2Ftestsuite%2Fg%2B%2B.old-deja%2Fg%2B%2B.other%2Funchanging1.C;h=0000000000000000000000000000000000000000;hb=6fed43773c9b0ce596dca5686f37ac3fc0fa11c0;hp=6bad7a45ccda27969b6081d4d73992601b5d6d25;hpb=27b11d56b743098deb193d510b337ba22dc52e5c;p=msp430-gcc.git diff --git a/gcc/testsuite/g++.old-deja/g++.other/unchanging1.C b/gcc/testsuite/g++.old-deja/g++.other/unchanging1.C deleted file mode 100644 index 6bad7a45..00000000 --- a/gcc/testsuite/g++.old-deja/g++.other/unchanging1.C +++ /dev/null @@ -1,45 +0,0 @@ -// Special g++ Options: -O2 - -#include -#include - -using namespace std; - -class A { -protected: - int a; - complex *b; -public: - A(int n); - inline complex& operator[] (int x); -}; - -A::A(int n) -{ - a = n; - b = new complex[a]; - for (int i=0; i(0.0,0.0); -} - -inline complex& 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((*p)[i].real(), (*p)[i].imag()); - } -} - -int main() -{ - foo(); -}