diff options
Diffstat (limited to 'gcc/testsuite/g++.old-deja/g++.mike')
354 files changed, 0 insertions, 16030 deletions
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/.cvsignore b/gcc/testsuite/g++.old-deja/g++.mike/.cvsignore deleted file mode 100644 index 7abff1dbead..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/.cvsignore +++ /dev/null @@ -1,2 +0,0 @@ -Makefile -config.status diff --git a/gcc/testsuite/g++.old-deja/g++.mike/align1.C b/gcc/testsuite/g++.old-deja/g++.mike/align1.C deleted file mode 100644 index df6faa6ed01..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/align1.C +++ /dev/null @@ -1,56 +0,0 @@ -// Check to make sure we align virtual base classes properly - -class eel_base { -public: -}; - -class markable_eel_base : public eel_base { -private: - int mark; -}; - -class eel_edge : public markable_eel_base { -public: -private: - int foo; -}; - -class edge : public virtual eel_edge { -public: - edge() { - _weight = 0.0; - } -private: - double _weight; -}; -class eel_branch_edge : public virtual edge { -}; -class branch_edge : public eel_branch_edge { -}; - -class eel_interproc_branch_edge : public branch_edge { -}; - -class interproc_edge : public virtual edge { -}; - -class eel_jump_edge : public virtual edge { -protected: -}; - -class jump_edge : public eel_jump_edge { -public: -}; - -class eel_interproc_jump_edge : public jump_edge { -protected: -}; - -class interproc_jump_edge : public eel_interproc_jump_edge, - public interproc_edge { -public: -}; - -int main () { - void *vp = new interproc_jump_edge(); -} diff --git a/gcc/testsuite/g++.old-deja/g++.mike/align2.C b/gcc/testsuite/g++.old-deja/g++.mike/align2.C deleted file mode 100644 index 758e43cdda6..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/align2.C +++ /dev/null @@ -1,16 +0,0 @@ -class Foo { -}; - -class Bar : virtual Foo { -public: - int b; -} x; - -int main() -{ - // printf("Foo offset %d\n", (int)(Foo*)&x - (int)&x); - // printf("b offset %d\n", (int)&x.b - (int)&x); - // printf("sizeof is %d\n", sizeof(Bar)); - // This core dumps on a SPARC is alignment is wrong. - Bar blist[10]; -} diff --git a/gcc/testsuite/g++.old-deja/g++.mike/ambig1.C b/gcc/testsuite/g++.old-deja/g++.mike/ambig1.C deleted file mode 100644 index 4552791ad5e..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/ambig1.C +++ /dev/null @@ -1,32 +0,0 @@ -extern "C" int printf(const char *, ...); - -struct VB { - virtual void f() { - printf("VB\n"); - } -}; - -class M : public virtual VB { -public: - int i; - void f() { - printf("M(%d)\n", i); - } -}; - -class lM : public M { -}; - -class rM : public M { -}; - -class D : public lM, rM { -} d; // ERROR - ambiguous function - -int main() { - ((lM*)&d)->i = 1; - ((rM*)&d)->i = 2; - ((rM*)&d)->f(); - ((lM*)&d)->f(); - ((VB*)&d)->f(); -} diff --git a/gcc/testsuite/g++.old-deja/g++.mike/asm1.C b/gcc/testsuite/g++.old-deja/g++.mike/asm1.C deleted file mode 100644 index f6c4fe5feff..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/asm1.C +++ /dev/null @@ -1,9 +0,0 @@ -// Build don't link: -// Special g++ Options: - -struct A { - static void foo() asm("_my_routine"); -}; - -void A::foo() { -} diff --git a/gcc/testsuite/g++.old-deja/g++.mike/asm2.C b/gcc/testsuite/g++.old-deja/g++.mike/asm2.C deleted file mode 100644 index 59771d6c6a3..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/asm2.C +++ /dev/null @@ -1,27 +0,0 @@ -// Compile with -S, there should be no references to -// LTRAMP in the output. - -extern "C" -{ - int printf (char *, ...); -} - -void -sub2 (void (*func) ()) -{ - (*func) (); -} - -int -main(void) -{ - extern void sub (void); - - sub2 (sub); -} - -void -sub (void) -{ - printf ("hello world\n"); -} diff --git a/gcc/testsuite/g++.old-deja/g++.mike/bool1.C b/gcc/testsuite/g++.old-deja/g++.mike/bool1.C deleted file mode 100644 index c8ff0e8416a..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/bool1.C +++ /dev/null @@ -1,16 +0,0 @@ -// bool test case - -// Build don't link: - -void foo(int i) { - foo (true); -} - -struct C { - void foo(int i) { - foo(true); - } - void bar(bool b) { - bar(0); - } -}; diff --git a/gcc/testsuite/g++.old-deja/g++.mike/bool2.C b/gcc/testsuite/g++.old-deja/g++.mike/bool2.C deleted file mode 100644 index ce2a1f86024..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/bool2.C +++ /dev/null @@ -1,57 +0,0 @@ -// Special g++ Options: -class A { -public: - operator bool () { - return true; - } -} a; -class A1 { -public: - operator int () { - return true; - } -} a1; -class A2 { -public: - operator char * () { - return ""; - } -} a2; -class A3 { -public: - operator unsigned long long int () { - return true; - } -} a3; -class A4 { -public: - operator char * () { - return ""; - } - operator unsigned long long int () { - return true; - } -} a4; -class A5 { -public: - operator double () { - return 256.0e0*256.0e0*256.0e0*256.0e0*256.0e0*256.0e0*256.0e0*256.0e0 - *256.0e0*256.0e0*256.0e0*256.0e0*256.0e0*256.0e0*256.0e0*256.0e0 - *256.0e0*256.0e0*256.0e0*256.0e0*256.0e0*256.0e0*256.0e0*256.0e0 - *256.0e0*256.0e0*256.0e0*256.0e0*256.0e0*256.0e0*256.0e0*256.0e0; - } -} a5; -int i = true; -bool b = true; -bool c = (bool)(void (A::*)())0; -bool d = 256; -main() { - if (!d) return 1; - if (!a) return 1; - if (!(bool)a) return 1; - // if (!(long long)a) return 1; - if (!a1) return 1; - if (!a2) return 1; - if (!a3) return 1; - if (!a5) return 1; -} diff --git a/gcc/testsuite/g++.old-deja/g++.mike/bool4.C b/gcc/testsuite/g++.old-deja/g++.mike/bool4.C deleted file mode 100644 index 96e4a6c2a52..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/bool4.C +++ /dev/null @@ -1,3 +0,0 @@ -// Build don't link: - -void foo(bool arg = (1==0)) {} diff --git a/gcc/testsuite/g++.old-deja/g++.mike/conv1.C b/gcc/testsuite/g++.old-deja/g++.mike/conv1.C deleted file mode 100644 index 468bc423130..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/conv1.C +++ /dev/null @@ -1,10 +0,0 @@ -enum E { C }; - -E foo() { - return C; -} - -int main() { - if (foo() != C) - return 1; -} diff --git a/gcc/testsuite/g++.old-deja/g++.mike/debug1.C b/gcc/testsuite/g++.old-deja/g++.mike/debug1.C deleted file mode 100644 index 9f7bc39a3ba..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/debug1.C +++ /dev/null @@ -1,14 +0,0 @@ -// Build don't link: -// Special g++ Options: -g -O -fkeep-inline-functions - -class c { -public: - ~c () { }; -}; - -int -foo (const c& lhs) -{ - c str (lhs); - return 0; -} diff --git a/gcc/testsuite/g++.old-deja/g++.mike/dyncast1.C b/gcc/testsuite/g++.old-deja/g++.mike/dyncast1.C deleted file mode 100644 index 3bddb3ce1e4..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/dyncast1.C +++ /dev/null @@ -1,22 +0,0 @@ -// Special g++ Options: -fexceptions -w -// excess errors test - XFAIL a29k-*-* sparc64-*-elf sh-*-* arm-*-pe - -#include <typeinfo> - -struct B { - virtual int f() { } -}; - -struct D { - virtual int f() { } -}; - -main() { - B b; - try { - (void)dynamic_cast<D&>(b); - } catch (std::bad_cast) { - return 0; - } - return 1; -} diff --git a/gcc/testsuite/g++.old-deja/g++.mike/dyncast2.C b/gcc/testsuite/g++.old-deja/g++.mike/dyncast2.C deleted file mode 100644 index fcf625e8c69..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/dyncast2.C +++ /dev/null @@ -1,25 +0,0 @@ -// Special g++ Options: -fexceptions -w -// excess errors test - XFAIL a29k-*-* sparc64-*-elf sh-*-* arm-*-pe - -// Ensure reference handling works. - -#include <typeinfo> - -struct B { - virtual int f() { } -} ob; - -struct D : public B { - virtual int f() { } -} od; - -main() { - B *b=&ob; - try { - void *vp = &dynamic_cast<D&>(*b); - return 1; - } catch (std::bad_cast) { - return 0; - } - return 1; -} diff --git a/gcc/testsuite/g++.old-deja/g++.mike/dyncast3.C b/gcc/testsuite/g++.old-deja/g++.mike/dyncast3.C deleted file mode 100644 index 627a7da23b5..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/dyncast3.C +++ /dev/null @@ -1,19 +0,0 @@ -// Special g++ Options: -fexceptions -w -// excess errors test - XFAIL a29k-*-* sparc64-*-elf sh-*-* arm-*-pe**-* -// Ensure that the return type of dynamic_cast is the real type. - -struct B { - virtual int f() { } -}; - -struct D : public B { - virtual int f() { } - int i; -} od; - -main() { - B *b=&od; - if (dynamic_cast<D*>(b)->i) - return 1; - return 0; -} diff --git a/gcc/testsuite/g++.old-deja/g++.mike/dyncast4.C b/gcc/testsuite/g++.old-deja/g++.mike/dyncast4.C deleted file mode 100644 index 43cb6ef5292..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/dyncast4.C +++ /dev/null @@ -1,4 +0,0 @@ -int main() { - int* d; - dynamic_cast<void*>(d); // ERROR - -} diff --git a/gcc/testsuite/g++.old-deja/g++.mike/dyncast5.C b/gcc/testsuite/g++.old-deja/g++.mike/dyncast5.C deleted file mode 100644 index f46d81e4935..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/dyncast5.C +++ /dev/null @@ -1,71 +0,0 @@ -#include <stddef.h> - -void *p; -int fail; - -class HeapTracked { -public: - virtual ~HeapTracked() = 0; - void *operator new(size_t size); - void operator delete(void *ptr); - static bool isObjectAllocation(const HeapTracked *ptr); -}; - -HeapTracked::~HeapTracked(){} -void * HeapTracked::operator new(size_t size) -{ - void * memPtr = ::operator new(size); - p = memPtr; - return memPtr; -} - -void HeapTracked::operator delete(void *ptr) -{ - if (p != ptr) - fail = 1; - ::operator delete(ptr); -} - -bool HeapTracked::isObjectAllocation(const HeapTracked *ptr) -{ - if (p != const_cast<void*>(dynamic_cast<const void*>(ptr))) - fail = 1; - return false; -} - -class Mumble1: public virtual HeapTracked { - double d; -public: - virtual ~Mumble1(){} -}; - -class Mumble2: public virtual HeapTracked { - double d; -public: - virtual ~Mumble2(){} -}; - -class Foo: virtual public HeapTracked, - virtual public Mumble1, - virtual public Mumble2 { -public: - ~Foo(){} -}; - -int main() -{ - Foo *pf = new Foo; - pf->isObjectAllocation(pf); - - Mumble1 *pm1 = pf; - pm1->isObjectAllocation(pm1); - - Mumble2 *pm2 = pf; - pm2->isObjectAllocation(pm2); - - // delete pf; - // delete pm1; - delete pm2; - - return fail; -} diff --git a/gcc/testsuite/g++.old-deja/g++.mike/dyncast6.C b/gcc/testsuite/g++.old-deja/g++.mike/dyncast6.C deleted file mode 100644 index 546561dda50..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/dyncast6.C +++ /dev/null @@ -1,12 +0,0 @@ -#include <typeinfo> - -class A { -public: - virtual void j () {} -}; - -class B : public A { }; - -void x (A& a) { - const B& b1 = dynamic_cast<B&>((const A&)a); // ERROR - opps -} diff --git a/gcc/testsuite/g++.old-deja/g++.mike/dyncast7.C b/gcc/testsuite/g++.old-deja/g++.mike/dyncast7.C deleted file mode 100644 index b1a55a43592..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/dyncast7.C +++ /dev/null @@ -1,28 +0,0 @@ -// Special g++ Options: -fexceptions - -#include <typeinfo> -#include <stdexcept> - -class A { -public: - virtual void j () {} -}; - -class B : public A { }; - -void x (A& a) { - // These should all work. - const B& b2 = dynamic_cast<B&>(a); - const B& b3 = dynamic_cast<const B&>((const A&)a); - const B& b4 = dynamic_cast<const B&>(a); -} - -int main() { - try { - B b; - x (b); - } catch (std::exception& e) { - // If we get a bad_cast, it is wrong. - return 1; - } -} diff --git a/gcc/testsuite/g++.old-deja/g++.mike/dyncast8.C b/gcc/testsuite/g++.old-deja/g++.mike/dyncast8.C deleted file mode 100644 index 5addfe07e73..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/dyncast8.C +++ /dev/null @@ -1,18 +0,0 @@ -#include <typeinfo> - -class Base -{ -public: - virtual ~Base() { } -}; - -class Derived : public Base { }; - -int main() -{ - const Derived b; - const Base* ap = &b; - - const Derived* p1 = dynamic_cast<const Derived*>(ap); - return p1 == 0; -} diff --git a/gcc/testsuite/g++.old-deja/g++.mike/dyncast9.C b/gcc/testsuite/g++.old-deja/g++.mike/dyncast9.C deleted file mode 100644 index 23db8c912bc..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/dyncast9.C +++ /dev/null @@ -1,16 +0,0 @@ -class S1 { int i; }; -class S2 { int i; }; -class VB { -public: - virtual void foo() { } -}; - -class D : public S1, virtual public VB { -} d; - -class E : public S2, public D { -} e; - -int main() { - return (char *)&e - (char *)dynamic_cast<E*>((D*)&e); -} diff --git a/gcc/testsuite/g++.old-deja/g++.mike/eh1.C b/gcc/testsuite/g++.old-deja/g++.mike/eh1.C deleted file mode 100644 index 95da594c2fc..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/eh1.C +++ /dev/null @@ -1,38 +0,0 @@ -// Build don't link: -// Special g++ Options: -fexceptions -O -S - -extern "C" void printf (char *, ...); -extern "C" int atoi (const char *); -extern "C" void exit (int); - -struct Exception - { - int v; - Exception(int i) { v = i; }; - }; - - void inc(int &i) - { - try { - if (i == 0) - throw Exception(i); - else - i++; - } - catch (Exception v) { - i = v.v; - } - } - -main (int argc, const char *argv[]) -{ - if (argc != 2) - { - printf ("usage: a.out <num>\n"); - exit (1); - } - int count = atoi (argv[1]); - inc (count); - printf ("success\n"); - exit (0); -} diff --git a/gcc/testsuite/g++.old-deja/g++.mike/eh10.C b/gcc/testsuite/g++.old-deja/g++.mike/eh10.C deleted file mode 100644 index 2541f2799c7..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/eh10.C +++ /dev/null @@ -1,28 +0,0 @@ -// Special g++ Options: -fexceptions -// excess errors test - XFAIL a29k-*-* sparc64-*-elf sh-*-* arm-*-pe**-* - -void foo() { - int i; - i = 42; - throw i; -} - -void ee(int *); - -void bar() { - int i = 2; - ee(&i); -} - -void ee(int *) { } - -main() { - try { - foo(); - return 3; - } catch (int& i) { - bar(); - return i != 42; - } - return 2; -} diff --git a/gcc/testsuite/g++.old-deja/g++.mike/eh11.C b/gcc/testsuite/g++.old-deja/g++.mike/eh11.C deleted file mode 100644 index 781521f8fee..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/eh11.C +++ /dev/null @@ -1,15 +0,0 @@ -// Special g++ Options: -fexceptions -// Build don't link: - -struct A { - ~A(); -}; - -int main(int argc, char** argv) { - A a; - return 0; -} - - -A::~A() { -} diff --git a/gcc/testsuite/g++.old-deja/g++.mike/eh12.C b/gcc/testsuite/g++.old-deja/g++.mike/eh12.C deleted file mode 100644 index 1a42e52c82c..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/eh12.C +++ /dev/null @@ -1,14 +0,0 @@ -// Special g++ Options: -fexceptions -// excess errors test - XFAIL a29k-*-* sparc64-*-elf sh-*-* arm-*-pe**-* - -class MyError { }; - -int main (int argc, char **argv) { - try { - throw MyError(); - } - catch (MyError x) { - } - - return 0; -} diff --git a/gcc/testsuite/g++.old-deja/g++.mike/eh13.C b/gcc/testsuite/g++.old-deja/g++.mike/eh13.C deleted file mode 100644 index 841202f349c..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/eh13.C +++ /dev/null @@ -1,6 +0,0 @@ -// Special g++ Options: -fexceptions -// excess errors test - XFAIL a29k-*-* sh-*-* arm-*-pe**-* - -#include <string> - -main() { } diff --git a/gcc/testsuite/g++.old-deja/g++.mike/eh14.C b/gcc/testsuite/g++.old-deja/g++.mike/eh14.C deleted file mode 100644 index e7c321397a2..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/eh14.C +++ /dev/null @@ -1,25 +0,0 @@ -// Special g++ Options: -fexceptions -// excess errors test - XFAIL a29k-*-* sparc64-*-elf sh-*-* arm-*-pe**-* - -class arghh { -public: - int n; - arghh (int v) { n = v; } -}; - -int main () { - try { - throw arghh (11); - } - catch (arghh& a) { - if (a.n != 11) - return 1; - } - try { - throw arghh (22); - } - catch (arghh& a) { - if (a.n != 22) - return 2; - } -} diff --git a/gcc/testsuite/g++.old-deja/g++.mike/eh15.C b/gcc/testsuite/g++.old-deja/g++.mike/eh15.C deleted file mode 100644 index 9ed673fc87d..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/eh15.C +++ /dev/null @@ -1,6 +0,0 @@ -// Build don't link: -// Special g++ Options: -fexceptions - -struct A { - A() throw (int); -}; diff --git a/gcc/testsuite/g++.old-deja/g++.mike/eh16.C b/gcc/testsuite/g++.old-deja/g++.mike/eh16.C deleted file mode 100644 index 2a986d54466..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/eh16.C +++ /dev/null @@ -1,26 +0,0 @@ -// Special g++ Options: -fexceptions -// excess errors test - XFAIL a29k-*-* sparc64-*-elf sh-*-* arm-*-pe**-* - -int err = 1; - -struct A { - ~A() { - --err; - } -}; - -struct B { - A a; - B() { - throw 1; - } -}; - -main() { - try { - B b; - } catch (...) { - return err; - } - return 1; -} diff --git a/gcc/testsuite/g++.old-deja/g++.mike/eh17.C b/gcc/testsuite/g++.old-deja/g++.mike/eh17.C deleted file mode 100644 index 482ea0434f9..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/eh17.C +++ /dev/null @@ -1,25 +0,0 @@ -// Special g++ Options: -fexceptions -// excess errors test - XFAIL a29k-*-* sparc64-*-elf sh-*-* arm-*-pe**-* - -int err = 1; - -struct A { - ~A() { - --err; - } -}; - -struct B : public A { - B() { - throw 1; - } -}; - -main() { - try { - B b; - } catch (...) { - return err; - } - return 1; -} diff --git a/gcc/testsuite/g++.old-deja/g++.mike/eh18.C b/gcc/testsuite/g++.old-deja/g++.mike/eh18.C deleted file mode 100644 index cf98bce4902..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/eh18.C +++ /dev/null @@ -1,63 +0,0 @@ -// Special g++ Options: -fexceptions -// excess errors test - XFAIL a29k-*-* sparc64-*-elf sh-*-* arm-*-pe**-* - -class VB { -public: - int n; - VB (int v) { n = v; } - VB (const VB& o) { - n = o.n; -// printf("copying VB from %d to %d\n", &o, this); - } -}; - -class D : public virtual VB { - int j; -public: - D(int i1, int i2) : VB(i2) { j = i1; } - VB& vb() { return *(VB*)this; } - const VB& vb() const { return *(const VB*)this; } -}; - -class pD : private virtual VB { - int j; -public: - pD(int i1, int i2) : VB(i2) { j = i1; } - VB& vb() { return *(VB*)this; } - const VB& vb() const { return *(const VB*)this; } -}; - - -int main () { - D d(1943, 4279); - pD pd(3621, 9527); - VB *vb = &d.vb(); - VB *pvb = &pd.vb(); - - // A catch of a public virtual base. - try { -// printf("Throwing D at %d (VB at %d)\n", &d, vb); - throw d; - } - catch (VB& vb) { -// printf("Catching VB at %d\n", &vb); - if (vb.n != 4279) - return 1; - } - catch (...) { - return 1; - } - - // A catch of a private virtual base. - try { -// printf("Throwing D at %d (VB at %d)\n", &pd, pvb); - throw pd; - } - catch (VB& vb) { -// printf("Catching VB at %d\n", &vb); - // This was a private base of the throw object, don't catch it. - return 1; - } - catch (...) { - } -} diff --git a/gcc/testsuite/g++.old-deja/g++.mike/eh19.C b/gcc/testsuite/g++.old-deja/g++.mike/eh19.C deleted file mode 100644 index 6e4fe155a48..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/eh19.C +++ /dev/null @@ -1,23 +0,0 @@ -// Special g++ Options: -fexceptions -// Build don't link: - -class test1 { -public: - class fehler{public:fehler(){};}; - void func(int a) { - if( a == 0 ) - throw fehler(); - } -}; - -int main() { - test1 var; - - try { - var.func(1); - var.func(0); - } catch(test1::fehler()) // function type promoted to pointer - { - ; - } -} diff --git a/gcc/testsuite/g++.old-deja/g++.mike/eh2.C b/gcc/testsuite/g++.old-deja/g++.mike/eh2.C deleted file mode 100644 index d808a65d135..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/eh2.C +++ /dev/null @@ -1,71 +0,0 @@ -// Special g++ Options: -fexceptions -// excess errors test - XFAIL a29k-*-* sparc64-*-elf sh-*-* arm-*-pe**-* - -#include <stdlib.h> -#include <iostream.h> - -class Vector { -private: - int *p; - int sz; - -public: - // Exception class - class Range { - private: - int value_i; - - public: - Range( int i ) { value_i = i; }; - int value() { return value_i; }; - }; - - Vector( int s ); - ~Vector(); - int size() { return sz; }; - int& operator []( int i ); -}; - -Vector::Vector(int s) { - sz = s; - p = new int[sz]; -} - -Vector::~Vector() { - delete [] p; -} - -int& -Vector::operator [](int i) { - if (0<=i && i<sz) { - return p[i]; - } else { - throw Range( i ); - } -} - -void crash(Vector& v ) { - v[v.size()+10]; // Triggers range error! -} - -void do_something(Vector& v) { - crash( v ); -} - -void -f(Vector& v) { - try { - do_something( v ); - } catch (Vector::Range& r) { - cout << "Invalid vector range " << r.value() - << " caught in f()" << endl; - exit(0); - } -} - -main() { - Vector v(10); - - f( v ); - return 1; -} diff --git a/gcc/testsuite/g++.old-deja/g++.mike/eh20.C b/gcc/testsuite/g++.old-deja/g++.mike/eh20.C deleted file mode 100644 index 10535bb9609..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/eh20.C +++ /dev/null @@ -1,7 +0,0 @@ -// Build don't link: -// Special g++ Options: -fexceptions -Wall - -int -main() { - throw 1; -} diff --git a/gcc/testsuite/g++.old-deja/g++.mike/eh21.C b/gcc/testsuite/g++.old-deja/g++.mike/eh21.C deleted file mode 100644 index 261e6ea5c6e..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/eh21.C +++ /dev/null @@ -1,14 +0,0 @@ -// Special g++ Options: -fexceptions -// excess errors test - XFAIL a29k-*-* sparc64-*-elf sh-*-* arm-*-pe**-* - -int main () { - try { - try { - throw 1; - } catch ( char * ) { - } - } catch ( int ) { - return 0; - } - return 1; -} diff --git a/gcc/testsuite/g++.old-deja/g++.mike/eh23.C b/gcc/testsuite/g++.old-deja/g++.mike/eh23.C deleted file mode 100644 index 27fc53d8eeb..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/eh23.C +++ /dev/null @@ -1,46 +0,0 @@ -// Special g++ Options: -fexceptions -// excess errors test - XFAIL a29k-*-* sparc64-*-elf sh-*-* arm-*-pe**-* - -#include <exception> - -struct double_fault { }; -int fault_now; - -class E { -public: - E() { } - E(const E&) { - if (fault_now) - throw double_fault(); - } -}; - -void foo() { - try { - throw E(); - } catch (...) { - fault_now = 1; - throw; - } -} - -void bar() { - try { - foo(); - } catch (E e) { // double fault here - } -} - -void my_terminate() { - exit (0); // double faults should call terminate -} - -main() { - std::set_terminate (my_terminate); - try { - bar(); - } catch (...) { - return 1; - } - return 1; -} diff --git a/gcc/testsuite/g++.old-deja/g++.mike/eh24.C b/gcc/testsuite/g++.old-deja/g++.mike/eh24.C deleted file mode 100644 index c9dd382f469..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/eh24.C +++ /dev/null @@ -1,33 +0,0 @@ -// Special g++ Options: -fexceptions -// excess errors test - XFAIL a29k-*-* sparc64-*-elf sh-*-* arm-*-pe**-* - -int fail = 0; - -struct A { - int ok; - A() { - ok = 1; - } - ~A() { - if (! ok) - fail = 1; - ok = 0; - } -}; - -main() { - try { - try { - A a; - throw 1.0; - } catch (double i) { - A a1; - throw 1; // make sure both a1 and a2 are not destroyed when we throw! - } catch (int i) { - A a2; - throw 1.0; - } - } catch (int i) { - } - return fail; -} diff --git a/gcc/testsuite/g++.old-deja/g++.mike/eh25.C b/gcc/testsuite/g++.old-deja/g++.mike/eh25.C deleted file mode 100644 index 52754b53359..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/eh25.C +++ /dev/null @@ -1,30 +0,0 @@ -// Special g++ Options: -fexceptions -// excess errors test - XFAIL a29k-*-* sparc64-*-elf sh-*-* arm-*-pe**-* - -#include <exception> - -void my_terminate() { - exit (0); // Double faults should call terminate -} - -struct A { - A() { } - ~A() { - std::set_terminate (my_terminate); - throw 1; // This throws from EH dtor, should call my_terminate - } -}; - -main() { - try { - try { - throw 1; - } catch (int i) { - A a; // A hit on this EH dtor went to the wrong place - throw 1; - } - } catch (...) { - return 1; - } - return 1; -} diff --git a/gcc/testsuite/g++.old-deja/g++.mike/eh26.C b/gcc/testsuite/g++.old-deja/g++.mike/eh26.C deleted file mode 100644 index 35cafa4286a..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/eh26.C +++ /dev/null @@ -1,15 +0,0 @@ -// Special g++ Options: -fexceptions -// excess errors test - XFAIL a29k-*-* sparc64-*-elf sh-*-* arm-*-pe**-* - -class MyExceptionHandler { }; - -main() { - try { - throw MyExceptionHandler(); - } catch(const MyExceptionHandler& eh) { - return 0; - } catch(...) { - return 1; - } - return 1; -} diff --git a/gcc/testsuite/g++.old-deja/g++.mike/eh27.C b/gcc/testsuite/g++.old-deja/g++.mike/eh27.C deleted file mode 100644 index bd07138c753..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/eh27.C +++ /dev/null @@ -1,17 +0,0 @@ -// Special g++ Options: -fexceptions -// excess errors test - XFAIL a29k-*-* sparc64-*-elf sh-*-* arm-*-pe**-* - -#include <typeinfo> - -class MyExceptionHandler { }; - -main() { - try { - throw MyExceptionHandler(); - } catch(const MyExceptionHandler& eh) { - return 0; - } catch(...) { - return 1; - } - return 1; -} diff --git a/gcc/testsuite/g++.old-deja/g++.mike/eh28.C b/gcc/testsuite/g++.old-deja/g++.mike/eh28.C deleted file mode 100644 index 3f2d0a6d68b..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/eh28.C +++ /dev/null @@ -1,17 +0,0 @@ -// Special g++ Options: -fexceptions -// excess errors test - XFAIL a29k-*-* sparc64-*-elf sh-*-* arm-*-pe**-* - -#include <typeinfo> - -int fail = 1; - -class X { public: virtual void p() { } }; -class Y : public X { public: virtual void p() { fail = 0; } }; - -main() -{ - try { Y y; throw y; } - catch (X& x) { x.p(); } - catch (...) { } - return fail; -} diff --git a/gcc/testsuite/g++.old-deja/g++.mike/eh29.C b/gcc/testsuite/g++.old-deja/g++.mike/eh29.C deleted file mode 100644 index 58c1f0b3f82..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/eh29.C +++ /dev/null @@ -1,27 +0,0 @@ -// Special g++ Options: -fexceptions -// excess errors test - XFAIL a29k-*-* sparc64-*-elf sh-*-* arm-*-pe**-* - -int count; - -class A { -public: - A() { -// printf("ctor %x\n", (int)this); - if (count==3) - throw 1; - ++count; - } - ~A() { - --count; -// printf("dtor %x\n", (int)this); - } -}; - -main() { - try { - A a[5]; - } catch (...) { - return count; - } - return 1; -} diff --git a/gcc/testsuite/g++.old-deja/g++.mike/eh3.C b/gcc/testsuite/g++.old-deja/g++.mike/eh3.C deleted file mode 100644 index e8b87bf30f7..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/eh3.C +++ /dev/null @@ -1,21 +0,0 @@ -// Special g++ Options: -fexceptions -// excess errors test - XFAIL a29k-*-* sparc64-*-elf sh-*-* arm-*-pe**-* - -class foo { -public: - class error {}; - - void cause_error(void) { throw error(); } -}; - -int main(void) -{ - foo f; - try { - f.cause_error(); - } - catch (foo::error&) { - return 0; - } - return 1; -} diff --git a/gcc/testsuite/g++.old-deja/g++.mike/eh30.C b/gcc/testsuite/g++.old-deja/g++.mike/eh30.C deleted file mode 100644 index 61a30c8ddda..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/eh30.C +++ /dev/null @@ -1,5 +0,0 @@ -// Build don't link: -// Skip if not native -// Special g++ Options: -fexceptions -fPIC -S - -main() { throw 1; } diff --git a/gcc/testsuite/g++.old-deja/g++.mike/eh31.C b/gcc/testsuite/g++.old-deja/g++.mike/eh31.C deleted file mode 100644 index 65e683cf8fd..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/eh31.C +++ /dev/null @@ -1,23 +0,0 @@ -// Special g++ Options: -fexceptions -// excess errors test - XFAIL a29k-*-* sparc64-*-elf sh-*-* arm-*-pe**-* - -int count; - -class Foo { -public: - Foo() { ++count; } - Foo(const Foo&) { ++count; } - ~Foo() { --count; } -}; - - -main() { - try { - throw Foo(); - } - catch (Foo& object) { - if (count == 1) - return 0; - } - return 1; -} diff --git a/gcc/testsuite/g++.old-deja/g++.mike/eh32.C b/gcc/testsuite/g++.old-deja/g++.mike/eh32.C deleted file mode 100644 index 12d601c883f..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/eh32.C +++ /dev/null @@ -1,20 +0,0 @@ -// Build don't link: -// Special g++ Options: -fexceptions - -class Base { -public: - virtual ~Base() throw(); -}; - -Base::~Base() throw() -{ -} - -class Foo : public Base { -public: - virtual ~Foo() throw(); -}; - -Foo::~Foo() throw() -{ -} diff --git a/gcc/testsuite/g++.old-deja/g++.mike/eh33.C b/gcc/testsuite/g++.old-deja/g++.mike/eh33.C deleted file mode 100644 index 234b745f3a3..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/eh33.C +++ /dev/null @@ -1,21 +0,0 @@ -// Special g++ Options: -fexceptions -// excess errors test - XFAIL hppa*-*-* a29k-*-* sparc64-*-elf sh-*-* z8k-*-* arm-*-pe**-* - -#include <exception> - -void my_unexpected() { - throw 42; -} - -void foo() throw (int) { throw "Hi"; } - -int main() { - std::set_unexpected (my_unexpected); - try { - foo(); - } catch (int i) { - if (i == 42) - return 0; - } - return 1; -} diff --git a/gcc/testsuite/g++.old-deja/g++.mike/eh34.C b/gcc/testsuite/g++.old-deja/g++.mike/eh34.C deleted file mode 100644 index 9c7e985bbea..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/eh34.C +++ /dev/null @@ -1,16 +0,0 @@ -// Special g++ Options: -fexceptions -// excess errors test - XFAIL a29k-*-* sparc64-*-elf sh-*-* arm-*-pe**-* - -#include <exception> - -void my_unexpected() { - exit (0); -} - -void foo() throw () { throw "Hi"; } - -int main() { - std::set_unexpected (my_unexpected); - foo(); - return 1; -} diff --git a/gcc/testsuite/g++.old-deja/g++.mike/eh35.C b/gcc/testsuite/g++.old-deja/g++.mike/eh35.C deleted file mode 100644 index d9bd34c58e6..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/eh35.C +++ /dev/null @@ -1,17 +0,0 @@ -// Special g++ Options: -fexceptions -// excess errors test - XFAIL a29k-*-* sparc64-*-elf sh-*-* arm-*-pe**-* - -main() { - try { - throw 'a'; - } catch (char a) { - try { - throw 'a'; - } catch (int i) { - return 1; - } catch (char c) { - return 0; - } - } - return 1; -} diff --git a/gcc/testsuite/g++.old-deja/g++.mike/eh36.C b/gcc/testsuite/g++.old-deja/g++.mike/eh36.C deleted file mode 100644 index fbb639204a7..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/eh36.C +++ /dev/null @@ -1,29 +0,0 @@ -// Special g++ Options: -fexceptions -// excess errors test - XFAIL a29k-*-* sparc64-*-elf sh-*-* arm-*-pe**-* - -#include <typeinfo> - -class A { - int space; -}; -class B { -public: - int data; - B(int i) : data(i) { - } -}; -class D : public A, public B { -public: - D(int i) : B(i) { - } -} d(42); - -main() { - try { - throw &d; - } catch (B* b) { - if (b->data == 42) - return 0; - } - return 1; -} diff --git a/gcc/testsuite/g++.old-deja/g++.mike/eh37.C b/gcc/testsuite/g++.old-deja/g++.mike/eh37.C deleted file mode 100644 index 75f6523a3a8..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/eh37.C +++ /dev/null @@ -1,21 +0,0 @@ -// Special g++ Options: -fexceptions -// excess errors test - XFAIL a29k-*-* sparc64-*-elf sh-*-* arm-*-pe**-* - -#include <typeinfo> - -class B { -public: - int data; - B(int i) : data(i) { - } -} b(42); - -main() { - try { - throw &b; - } catch (B* b) { - if (b->data == 42) - return 0; - } - return 1; -} diff --git a/gcc/testsuite/g++.old-deja/g++.mike/eh38.C b/gcc/testsuite/g++.old-deja/g++.mike/eh38.C deleted file mode 100644 index 915ef4c89e4..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/eh38.C +++ /dev/null @@ -1,28 +0,0 @@ -// Special g++ Options: -fexceptions -// excess errors test - XFAIL a29k-*-* sparc64-*-elf sh-*-* arm-*-pe**-* - -#include <typeinfo> - -class B { -public: - int data; - B(int i) : data(i) { - } -} b(42); - -main() { - try { - throw &b; - } catch (const B* bptr) { - if (bptr->data == 42) - { - try { - throw &b; - } catch (void *bptr) { - if (((B*)bptr)->data == 42) - return 0; - } - } - } - return 1; -} diff --git a/gcc/testsuite/g++.old-deja/g++.mike/eh39.C b/gcc/testsuite/g++.old-deja/g++.mike/eh39.C deleted file mode 100644 index 54d10959a57..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/eh39.C +++ /dev/null @@ -1,28 +0,0 @@ -// Special g++ Options: -fexceptions -// excess errors test - XFAIL a29k-*-* sparc64-*-elf sh-*-* arm-*-pe**-* - -int fail = 1; -class B { -public: - B() { throw 1; } -}; -class D : public B { -public: - D(); -}; - -D::D() try : B() { - fail = 1; -} catch (...) { - fail = 0; - throw; -} - -main() { - try { - D d; - fail = 1; - } catch (...) { - } - return fail; -} diff --git a/gcc/testsuite/g++.old-deja/g++.mike/eh4.C b/gcc/testsuite/g++.old-deja/g++.mike/eh4.C deleted file mode 100644 index c87ab293b36..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/eh4.C +++ /dev/null @@ -1,6 +0,0 @@ -// Build don't link: -// Special g++ Options: -fexceptions - -void foo() { - throw 1; -} diff --git a/gcc/testsuite/g++.old-deja/g++.mike/eh40.C b/gcc/testsuite/g++.old-deja/g++.mike/eh40.C deleted file mode 100644 index 16badc2d911..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/eh40.C +++ /dev/null @@ -1,29 +0,0 @@ -// Special g++ Options: -fexceptions -// excess errors test - XFAIL a29k-*-* sparc64-*-elf sh-*-* arm-*-pe**-* - -int fail = 1; -class B { -public: - B() { throw 1; } -}; -class D : public B { -public: - D() try : B() { - fail = 1; - } catch (char c) { - fail = 1; - throw; - } catch (...) { - fail = 0; - throw; - } -}; - -main() { - try { - D d; - fail = 1; - } catch (...) { - } - return fail; -} diff --git a/gcc/testsuite/g++.old-deja/g++.mike/eh41.C b/gcc/testsuite/g++.old-deja/g++.mike/eh41.C deleted file mode 100644 index 4127402d09e..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/eh41.C +++ /dev/null @@ -1,29 +0,0 @@ -// Special g++ Options: -fexceptions -// excess errors test - XFAIL a29k-*-* sparc64-*-elf sh-*-* arm-*-pe**-* - -int fail = 0; - -struct A { - A () { a = 'a'; b = 'b'; c = 'c'; } - ~ A () { - if ( a != 'a' ) fail = 1; - if ( b != 'b' ) fail = 1; - if ( c != 'c' ) fail = 1; - } - char a, b, c; -}; - -void some_init () { throw 1; } - -struct C : A { - C () { some_init (); } -}; - -int main () { - try { - C c; - } catch (int i) { - return 0; - } - return 1; -}; diff --git a/gcc/testsuite/g++.old-deja/g++.mike/eh42.C b/gcc/testsuite/g++.old-deja/g++.mike/eh42.C deleted file mode 100644 index 6da9bd51c96..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/eh42.C +++ /dev/null @@ -1,18 +0,0 @@ -// Special g++ Options: -fexceptions -// excess errors test - XFAIL a29k-*-* sparc64-*-elf sh-*-* arm-*-pe**-* - -struct none { int i[50]; }; - -class my_ex { } a; - -none throw_it() { - throw 1; -} - -int main() { - try { - none n = throw_it(); - } catch (int ex) { - return 0; - } -} diff --git a/gcc/testsuite/g++.old-deja/g++.mike/eh44.C b/gcc/testsuite/g++.old-deja/g++.mike/eh44.C deleted file mode 100644 index e612aeb793b..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/eh44.C +++ /dev/null @@ -1,36 +0,0 @@ -// Special g++ Options: -fexceptions -// excess errors test - XFAIL a29k-*-* sparc64-*-elf sh-*-* arm-*-pe**-* -// prms-id: 9159 - -static unsigned int iCounter = 0; -static unsigned int iMax; -int fail = 0; - -class ca { -public: - ca(int) { - if (iCounter++ == iMax) - throw (const char*)"iCounter"; - } - virtual ~ca() { - } -}; - -class cc { -public: - cc(const ca &rca1, const ca &rca2) { - } - virtual ~cc() { - fail = 1; - } -}; - - -int main(int argc, char **argv) { - iMax = 1; - try { - cc sc(ca(1), ca(1)); - } catch (const char *pMsg) { - } - return fail; -} diff --git a/gcc/testsuite/g++.old-deja/g++.mike/eh45.C b/gcc/testsuite/g++.old-deja/g++.mike/eh45.C deleted file mode 100644 index bed0b921d6b..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/eh45.C +++ /dev/null @@ -1,34 +0,0 @@ -int i; -int fail; - -class ca { -public: - ca() { - if (++i != 1) - fail = 1; - } - virtual ~ca() { - if (++i != 4) - fail = 4; - } -}; - -class cb { -public: - cb(const ca &rca) { - if (++i != 2) - fail = 2; - } - virtual ~cb() { - if (++i != 3) - fail = 3; - } -}; - -void foo(const cb &rcb) { -} - -int main(int argc, char **argv) { - foo(cb(ca())); - return fail; -} diff --git a/gcc/testsuite/g++.old-deja/g++.mike/eh46.C b/gcc/testsuite/g++.old-deja/g++.mike/eh46.C deleted file mode 100644 index e0e6553f7c7..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/eh46.C +++ /dev/null @@ -1,47 +0,0 @@ -// Build don't link: -// Special g++ Options: -fexceptions -// excess errors test - XFAIL a29k-*-* sh-*-* arm-*-pe**-* - -int atoi(const char *); - -struct ios { - virtual ~ios(); -}; - -class fstreambase : virtual public ios { -}; - -class ifstream : public fstreambase { -}; - -class ofstream : public fstreambase { -}; - -extern const short O; -extern const short D; - -const short O= 0; -const short D= -3; - - -short glc(const char* const * const l, - short& n,short& x,short& y, - ifstream* i,ofstream* o) - -{ - n=atoi(l[1]); - - x=atoi(l[2]); - y=atoi(l[3]); - - if((x < 0)||(y <0)) - { - return D; - } - - i = new ifstream[n]; - o = new ofstream[2]; - - return O; - -} diff --git a/gcc/testsuite/g++.old-deja/g++.mike/eh47.C b/gcc/testsuite/g++.old-deja/g++.mike/eh47.C deleted file mode 100644 index 043a6174a6f..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/eh47.C +++ /dev/null @@ -1,23 +0,0 @@ -// Special g++ Options: -fexceptions -// excess errors test - XFAIL a29k-*-* sparc64-*-elf sh-*-* arm-*-pe**-* - -#include <cstdlib> -#include <exception> - -void myterm() { - exit (0); -} - -main() { - try { - throw ""; - } catch (...) { - } - try { - std::set_terminate (myterm); - throw; - } catch (...) { - return 1; - } - return 1; -} diff --git a/gcc/testsuite/g++.old-deja/g++.mike/eh48.C b/gcc/testsuite/g++.old-deja/g++.mike/eh48.C deleted file mode 100644 index 351fc4f60a8..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/eh48.C +++ /dev/null @@ -1,32 +0,0 @@ -// Special g++ Options: -fexceptions -// excess errors test - XFAIL a29k-*-* sparc64-*-elf sh-*-* arm-*-pe**-* - -#include <exception> -using std::uncaught_exception; -class A { -public: - ~A() { - if (uncaught_exception ()) - exit (0); - } -}; - -int main() { - if (uncaught_exception ()) - return 1; - try { - throw ""; - } catch (...) { - if (uncaught_exception ()) - return 1; - } - if (uncaught_exception ()) - return 1; - try { - A a; - throw ""; - } catch (...) { - return 1; - } - return 1; -} diff --git a/gcc/testsuite/g++.old-deja/g++.mike/eh49.C b/gcc/testsuite/g++.old-deja/g++.mike/eh49.C deleted file mode 100644 index 0505db168b2..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/eh49.C +++ /dev/null @@ -1,15 +0,0 @@ -// Special g++ Options: -fexceptions -O9 -// excess errors test - XFAIL a29k-*-* sparc64-*-elf sh-*-* arm-*-pe**-* - -void main1() { - throw 1; -} - -int main() { - try { - main1(); - } catch (...) { - return 0; - } - return 1; -} diff --git a/gcc/testsuite/g++.old-deja/g++.mike/eh5.C b/gcc/testsuite/g++.old-deja/g++.mike/eh5.C deleted file mode 100644 index 3289d975d58..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/eh5.C +++ /dev/null @@ -1,21 +0,0 @@ -// Special g++ Options: -fexceptions -// excess errors test - XFAIL a29k-*-* sparc64-*-elf sh-*-* arm-*-pe**-* - -class foo { -public: - class error {}; - - void cause_error(void) { throw "Hello World!"; } -}; - -int main(void) -{ - foo f; - try { - f.cause_error(); - } - catch (const char cp[]) { - return 0; - } - return 1; -} diff --git a/gcc/testsuite/g++.old-deja/g++.mike/eh50.C b/gcc/testsuite/g++.old-deja/g++.mike/eh50.C deleted file mode 100644 index 0747e1032ef..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/eh50.C +++ /dev/null @@ -1,21 +0,0 @@ -// Special g++ Options: -fexceptions -// excess errors test - XFAIL hppa*-*-* a29k-*-* sparc64-*-elf sh-*-* z8k-*-* arm-*-pe**-* - -#include <exception> - -void my_unexpected() { - throw 42; -} - -template <class T> int foo(T) throw (int) { throw "Hi"; } - -main() { - std::set_unexpected (my_unexpected); - try { - foo(1); - } catch (int i) { - if (i == 42) - return 0; - } - return 1; -} diff --git a/gcc/testsuite/g++.old-deja/g++.mike/eh51.C b/gcc/testsuite/g++.old-deja/g++.mike/eh51.C deleted file mode 100644 index ac7f620df42..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/eh51.C +++ /dev/null @@ -1,21 +0,0 @@ -// Special g++ Options: -fexceptions -// excess errors test - XFAIL a29k-*-* sparc64-*-elf sh-*-* z8k-*-* arm-*-pe**-* - -#include <exception> - -void my_unexpected() { - throw 42; -} - -template <class T> int foo(T) throw (T) { throw "Hi"; } - -main() { - std::set_unexpected (my_unexpected); - try { - foo(1); - } catch (int i) { - if (i == 42) - return 0; - } - return 1; -} diff --git a/gcc/testsuite/g++.old-deja/g++.mike/eh52.C b/gcc/testsuite/g++.old-deja/g++.mike/eh52.C deleted file mode 100644 index 475070caebf..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/eh52.C +++ /dev/null @@ -1,14 +0,0 @@ -// Special g++ Options: -fexceptions -O9 - -int promote_mode (int mode, int *punsignedp) -{ - int unsignedp = *punsignedp; - *punsignedp = unsignedp; - return mode; -} - -int main() { - int i; - i = promote_mode (42, &i); - return i != 42; -} diff --git a/gcc/testsuite/g++.old-deja/g++.mike/eh53.C b/gcc/testsuite/g++.old-deja/g++.mike/eh53.C deleted file mode 100644 index 7d47c6d1461..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/eh53.C +++ /dev/null @@ -1,15 +0,0 @@ -// Special g++ Options: -fexceptions -g -// excess errors test - XFAIL a29k-*-* sparc64-*-elf sh-*-* arm-*-pe**-* - -class zeroset { -public: - ~zeroset () { } -}; - -int main () { - zeroset a; - try { - ; - } catch( zeroset ) { - } -} diff --git a/gcc/testsuite/g++.old-deja/g++.mike/eh54.C b/gcc/testsuite/g++.old-deja/g++.mike/eh54.C deleted file mode 100644 index 9c2d206f092..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/eh54.C +++ /dev/null @@ -1,3 +0,0 @@ -// Special g++ Options: -fexceptions - -int main() { try { 1; } } // ERROR - diff --git a/gcc/testsuite/g++.old-deja/g++.mike/eh55.C b/gcc/testsuite/g++.old-deja/g++.mike/eh55.C deleted file mode 100644 index e64bcf82374..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/eh55.C +++ /dev/null @@ -1,18 +0,0 @@ -// Special g++ Options: -fexceptions -// excess errors test - XFAIL a29k-*-* sparc64-*-elf sh-*-* arm-*-pe**-* - -#include <exception> - -void my_terminate_handler() { - exit(0); -} - -void throw_an_unexpected_exception() throw() { - throw 1; -} - -int main() { - std::set_terminate(my_terminate_handler); - throw_an_unexpected_exception(); - return 1; -} diff --git a/gcc/testsuite/g++.old-deja/g++.mike/eh56.C b/gcc/testsuite/g++.old-deja/g++.mike/eh56.C deleted file mode 100644 index 674a82df450..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/eh56.C +++ /dev/null @@ -1,22 +0,0 @@ -// Special g++ Options: -fexceptions - -struct A { - A() { } - A(const char *) { } - A(const A&) { } - ~A() { } -}; - -struct bmf { - bmf (const A n) { } - ~bmf (void) { } - A name; -}; - -void imf (void) { - bmf Sabs ("abs"); -} - -int main(void) { - imf (); -} diff --git a/gcc/testsuite/g++.old-deja/g++.mike/eh57.C b/gcc/testsuite/g++.old-deja/g++.mike/eh57.C deleted file mode 100644 index 545a85fdfa9..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/eh57.C +++ /dev/null @@ -1,18 +0,0 @@ -// Build don't link: -// Special g++ Options: -fno-exceptions - -class Calendar_Time { -public: - ~Calendar_Time (); - int operator <= (const Calendar_Time& t) const; -}; - -class Temporal_Model_Interval { -public: - Calendar_Time start_time (); -}; - -int intersects_p (Temporal_Model_Interval* i1, Temporal_Model_Interval* i2) { - return ((i1->start_time() <= i2->start_time()) - || (i1->start_time() <= i2->start_time())); -} diff --git a/gcc/testsuite/g++.old-deja/g++.mike/eh58.C b/gcc/testsuite/g++.old-deja/g++.mike/eh58.C deleted file mode 100644 index 967e74ab12d..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/eh58.C +++ /dev/null @@ -1,18 +0,0 @@ -// Build don't link: -// Special g++ Options: -fexceptions - -struct C { - bool mem; - ~C(); -}; - -C genTemp(); - -int foo_notok(int arg) { - switch (arg) { - case 0: - return genTemp().mem; - default: - return 3; - } -} diff --git a/gcc/testsuite/g++.old-deja/g++.mike/eh6.C b/gcc/testsuite/g++.old-deja/g++.mike/eh6.C deleted file mode 100644 index b9e7c8cc46c..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/eh6.C +++ /dev/null @@ -1,19 +0,0 @@ -// Special g++ Options: -fexceptions -// excess errors test - XFAIL a29k-*-* sparc64-*-elf sh-*-* arm-*-pe**-* - -extern "C" int printf(const char *, ...); - -void main1() { - throw 1; -} - - -int main() { - try { - main1(); - } catch (...) { - printf("Unwind works!\n"); - return 0; - } - return 1; -} diff --git a/gcc/testsuite/g++.old-deja/g++.mike/eh7.C b/gcc/testsuite/g++.old-deja/g++.mike/eh7.C deleted file mode 100644 index 3e2c75a67f2..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/eh7.C +++ /dev/null @@ -1,7 +0,0 @@ -// Special g++ Options: -fexceptions -// excess errors test - XFAIL a29k-*-* sparc64-*-elf sh-*-* arm-*-pe**-* - -main() { - if (0) - throw 1 | 2; -} diff --git a/gcc/testsuite/g++.old-deja/g++.mike/eh8.C b/gcc/testsuite/g++.old-deja/g++.mike/eh8.C deleted file mode 100644 index a9f7a902f2c..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/eh8.C +++ /dev/null @@ -1,20 +0,0 @@ -// Special g++ Options: -fexceptions -// excess errors test - XFAIL a29k-*-* sparc64-*-elf sh-*-* arm-*-pe**-* - -extern "C" int printf(const char *, ...); - -int i; - -main() { - try { - try { - throw i; - } catch (char *) { - return 1; - } - return 1; - } catch (int i) { - return 0; - } - return 1; -} diff --git a/gcc/testsuite/g++.old-deja/g++.mike/eh9.C b/gcc/testsuite/g++.old-deja/g++.mike/eh9.C deleted file mode 100644 index febd1dc4b96..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/eh9.C +++ /dev/null @@ -1,4 +0,0 @@ -// Special g++ Options: -fexceptions -// excess errors test - XFAIL a29k-*-* sparc64-*-elf sh-*-* arm-*-pe* - -main() throw () { } diff --git a/gcc/testsuite/g++.old-deja/g++.mike/enum1.C b/gcc/testsuite/g++.old-deja/g++.mike/enum1.C deleted file mode 100644 index 89e8542b779..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/enum1.C +++ /dev/null @@ -1,11 +0,0 @@ -// Build don't link: -// Warn if a enum cannot fit into a small bit-field. - -enum TypeKind { ATK, BTK, CTK, DTK } ; - -struct Type { - enum TypeKind kind : 1; // WARNING - - void setBTK(); -}; - -void Type::setBTK() { kind = DTK; } diff --git a/gcc/testsuite/g++.old-deja/g++.mike/err1.C b/gcc/testsuite/g++.old-deja/g++.mike/err1.C deleted file mode 100644 index 8748c7860b1..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/err1.C +++ /dev/null @@ -1,8 +0,0 @@ -// Build don't link: - -struct gorf { - int stuff; - void snarf(); -}; - -template <class T> void gorf::snarf() { return; } // ERROR - diff --git a/gcc/testsuite/g++.old-deja/g++.mike/err2.C b/gcc/testsuite/g++.old-deja/g++.mike/err2.C deleted file mode 100644 index c3af5b47fe2..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/err2.C +++ /dev/null @@ -1,6 +0,0 @@ -class foo { -public: - void apply(foo *(foo::*memptr)()) { - this->*memptr(); // ERROR - wrong - } -}; diff --git a/gcc/testsuite/g++.old-deja/g++.mike/err3.C b/gcc/testsuite/g++.old-deja/g++.mike/err3.C deleted file mode 100644 index b42a4a908d8..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/err3.C +++ /dev/null @@ -1,9 +0,0 @@ -class cb { -}; - -class cc { -public: - cc() - : cb() { // ERROR - - } -}; diff --git a/gcc/testsuite/g++.old-deja/g++.mike/explicit1.C b/gcc/testsuite/g++.old-deja/g++.mike/explicit1.C deleted file mode 100644 index 28213ba377d..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/explicit1.C +++ /dev/null @@ -1,15 +0,0 @@ -struct A1 { - explicit A1(int) { } -} a1(1); - -struct A { - explicit A(int); -} a(1); - -A::A(int) { -} - -void foo(A a) { - foo(a); - foo(1); // ERROR - not allowed -} diff --git a/gcc/testsuite/g++.old-deja/g++.mike/explicit2.C b/gcc/testsuite/g++.old-deja/g++.mike/explicit2.C deleted file mode 100644 index a2077bffc2f..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/explicit2.C +++ /dev/null @@ -1,24 +0,0 @@ -// Build don't link: - -class string { -public: - string(const char*) { } - explicit string(int size) { } -}; - -void foo(string) { } - -string bar() { - foo("hello"); // ok - foo(string(2)); // ok - foo(2); // ERROR - no implicit conversion from int to string - string x = 2; // ERROR - no implicit conversion from int to string - string y(2); // ok - foo((string)2); // ok - return 2; // ERROR - no implicit conversion from int to string -} - -class A : string { -public: - A() : string(2) { } // ok -}; diff --git a/gcc/testsuite/g++.old-deja/g++.mike/for1.C b/gcc/testsuite/g++.old-deja/g++.mike/for1.C deleted file mode 100644 index e46213035bf..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/for1.C +++ /dev/null @@ -1,3 +0,0 @@ -int main() { - for( {int i = 0; int j = 0;} i < 10; ++i ) ; // ERROR - -} diff --git a/gcc/testsuite/g++.old-deja/g++.mike/for2.C b/gcc/testsuite/g++.old-deja/g++.mike/for2.C deleted file mode 100644 index fd01804d86b..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/for2.C +++ /dev/null @@ -1,19 +0,0 @@ -// Build don't link: - -void foo() { - for (class C {};;) - ; - C c; // ERROR - -} - -void bar() { - for (enum E {num};;) - ; - E e; // ERROR - -} - -void bee () { - int i = 0; - for (int fun() = 0; i != 2; ++i) { // ERROR - - } -} diff --git a/gcc/testsuite/g++.old-deja/g++.mike/fresco1.C b/gcc/testsuite/g++.old-deja/g++.mike/fresco1.C deleted file mode 100644 index 16fa1dbcbe9..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/fresco1.C +++ /dev/null @@ -1,13 +0,0 @@ -// Build don't link: - -// This is a Fresco found bug. - -class WhoCares {}; - -typedef float Coord; - -class BugDemo : public WhoCares { -public: - typedef Coord Matrix[4][4]; - virtual void vf1(BugDemo::Matrix m) = 0; -}; diff --git a/gcc/testsuite/g++.old-deja/g++.mike/hog1.C b/gcc/testsuite/g++.old-deja/g++.mike/hog1.C deleted file mode 100644 index 8627100f2de..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/hog1.C +++ /dev/null @@ -1,187 +0,0 @@ -class dummy { public: void operator++(void) {} - }; -class dummy_000 : private virtual dummy { public: void operator++(void) { -dummy::operator++(); } }; -class dummy_001 : private virtual dummy { public: void operator++(void) { -dummy::operator++(); } }; -class dummy_002 : private virtual dummy { public: void operator++(void) { -dummy::operator++(); } }; -class dummy_003 : private virtual dummy { public: void operator++(void) { -dummy::operator++(); } }; -class dummy_004 : private virtual dummy { public: void operator++(void) { -dummy::operator++(); } }; -class dummy_005 : private virtual dummy { public: void operator++(void) { -dummy::operator++(); } }; -class dummy_006 : private virtual dummy { public: void operator++(void) { -dummy::operator++(); } }; -class dummy_007 : private virtual dummy { public: void operator++(void) { -dummy::operator++(); } }; -class dummy_008 : private virtual dummy { public: void operator++(void) { -dummy::operator++(); } }; -class dummy_009 : private virtual dummy { public: void operator++(void) { -dummy::operator++(); } }; -class dummy_010 : private virtual dummy { public: void operator++(void) { -dummy::operator++(); } }; -class dummy_011 : private virtual dummy { public: void operator++(void) { -dummy::operator++(); } }; -class dummy_012 : private virtual dummy { public: void operator++(void) { -dummy::operator++(); } }; -class dummy_013 : private virtual dummy { public: void operator++(void) { -dummy::operator++(); } }; -class dummy_014 : private virtual dummy { public: void operator++(void) { -dummy::operator++(); } }; -class dummy_015 : private virtual dummy { public: void operator++(void) { -dummy::operator++(); } }; -class dummy_016 : private virtual dummy { public: void operator++(void) { -dummy::operator++(); } }; -class dummy_017 : private virtual dummy { public: void operator++(void) { -dummy::operator++(); } }; -class dummy_018 : private virtual dummy { public: void operator++(void) { -dummy::operator++(); } }; -class dummy_019 : private virtual dummy { public: void operator++(void) { -dummy::operator++(); } }; -class dummy_020 : private virtual dummy { public: void operator++(void) { -dummy::operator++(); } }; -class dummy_021 : private virtual dummy { public: void operator++(void) { -dummy::operator++(); } }; -class dummy_022 : private virtual dummy { public: void operator++(void) { -dummy::operator++(); } }; -class dummy_023 : private virtual dummy { public: void operator++(void) { -dummy::operator++(); } }; -class dummy_024 : private virtual dummy { public: void operator++(void) { -dummy::operator++(); } }; -class dummy_025 : private virtual dummy { public: void operator++(void) { -dummy::operator++(); } }; -class dummy_026 : private virtual dummy { public: void operator++(void) { -dummy::operator++(); } }; -class dummy_027 : private virtual dummy { public: void operator++(void) { -dummy::operator++(); } }; -class dummy_028 : private virtual dummy { public: void operator++(void) { -dummy::operator++(); } }; -class dummy_029 : private virtual dummy { public: void operator++(void) { -dummy::operator++(); } }; -class dummy_030 : private virtual dummy { public: void operator++(void) { -dummy::operator++(); } }; -class dummy_031 : private virtual dummy { public: void operator++(void) { -dummy::operator++(); } }; -class dummy_032 : private virtual dummy { public: void operator++(void) { -dummy::operator++(); } }; -class dummy_033 : private virtual dummy { public: void operator++(void) { -dummy::operator++(); } }; -class dummy_034 : private virtual dummy { public: void operator++(void) { -dummy::operator++(); } }; -class dummy_035 : private virtual dummy { public: void operator++(void) { -dummy::operator++(); } }; -class dummy_036 : private virtual dummy { public: void operator++(void) { -dummy::operator++(); } }; -class dummy_037 : private virtual dummy { public: void operator++(void) { -dummy::operator++(); } }; -class dummy_038 : private virtual dummy { public: void operator++(void) { -dummy::operator++(); } }; -class dummy_039 : private virtual dummy { public: void operator++(void) { -dummy::operator++(); } }; -class dummy_040 : private virtual dummy { public: void operator++(void) { -dummy::operator++(); } }; -class dummy_041 : private virtual dummy { public: void operator++(void) { -dummy::operator++(); } }; -class dummy_042 : private virtual dummy { public: void operator++(void) { -dummy::operator++(); } }; -class dummy_043 : private virtual dummy { public: void operator++(void) { -dummy::operator++(); } }; -class dummy_044 : private virtual dummy { public: void operator++(void) { -dummy::operator++(); } }; -class dummy_045 : private virtual dummy { public: void operator++(void) { -dummy::operator++(); } }; -class dummy_046 : private virtual dummy { public: void operator++(void) { -dummy::operator++(); } }; -class dummy_047 : private virtual dummy { public: void operator++(void) { -dummy::operator++(); } }; -class dummy_048 : private virtual dummy { public: void operator++(void) { -dummy::operator++(); } }; -class dummy_049 : private virtual dummy { public: void operator++(void) { -dummy::operator++(); } }; - -class super : - private dummy_000, private dummy_001, private dummy_002, private -dummy_003, private dummy_004, - private dummy_005, private dummy_006, private dummy_007, private -dummy_008, private dummy_009, - private dummy_010, private dummy_011, private dummy_012, private -dummy_013, private dummy_014, - private dummy_015, private dummy_016, private dummy_017, private -dummy_018, private dummy_019, - private dummy_020, private dummy_021, private dummy_022, private -dummy_023, private dummy_024, - private dummy_025, private dummy_026, private dummy_027, private -dummy_028, private dummy_029, - private dummy_030, private dummy_031, private dummy_032, private -dummy_033, private dummy_034, - private dummy_035, private dummy_036, private dummy_037, private -dummy_038, private dummy_039, - private dummy_040, private dummy_041, private dummy_042, private -dummy_043, private dummy_044, - private dummy_045, private dummy_046, private dummy_047, private -dummy_048, private dummy_049 -{ -public: - void operator++(void); -}; - -void super::operator++(void) -{ - dummy_000::operator++(); - dummy_001::operator++(); - dummy_002::operator++(); - dummy_003::operator++(); - dummy_004::operator++(); - dummy_005::operator++(); - dummy_006::operator++(); - dummy_007::operator++(); - dummy_008::operator++(); - dummy_009::operator++(); - dummy_010::operator++(); - dummy_011::operator++(); - dummy_012::operator++(); - dummy_013::operator++(); - dummy_014::operator++(); - dummy_015::operator++(); - dummy_016::operator++(); - dummy_017::operator++(); - dummy_018::operator++(); - dummy_019::operator++(); - dummy_020::operator++(); - dummy_021::operator++(); - dummy_022::operator++(); - dummy_023::operator++(); - dummy_024::operator++(); - dummy_025::operator++(); - dummy_026::operator++(); - dummy_027::operator++(); - dummy_028::operator++(); - dummy_029::operator++(); - dummy_030::operator++(); - dummy_031::operator++(); - dummy_032::operator++(); - dummy_033::operator++(); - dummy_034::operator++(); - dummy_035::operator++(); - dummy_036::operator++(); - dummy_037::operator++(); - dummy_038::operator++(); - dummy_039::operator++(); - dummy_040::operator++(); - dummy_041::operator++(); - dummy_042::operator++(); - dummy_043::operator++(); - dummy_044::operator++(); - dummy_045::operator++(); - dummy_046::operator++(); - dummy_047::operator++(); - dummy_048::operator++(); - dummy_049::operator++(); -} - - -int main(void) -{ -}; diff --git a/gcc/testsuite/g++.old-deja/g++.mike/init1.C b/gcc/testsuite/g++.old-deja/g++.mike/init1.C deleted file mode 100644 index 8d591865d10..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/init1.C +++ /dev/null @@ -1,25 +0,0 @@ -int count; - -extern "C" void _exit(int); - -struct C { - ~C() { if (count != 1) _exit(1); } -} c; - -class A { -public: - ~A () { ++count; } -}; - -void f() { - static A a; -} - -void g() { - // Since this isn't constructed, we can't destruct it. - static A a; -} - -int main () { - f(); -} diff --git a/gcc/testsuite/g++.old-deja/g++.mike/init2.C b/gcc/testsuite/g++.old-deja/g++.mike/init2.C deleted file mode 100644 index 343d76f88cc..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/init2.C +++ /dev/null @@ -1,9 +0,0 @@ -// Build don't link: - -struct Foo { - Foo (int); -}; - -int bar (Foo); - -int x = bar (3); diff --git a/gcc/testsuite/g++.old-deja/g++.mike/leak1.C b/gcc/testsuite/g++.old-deja/g++.mike/leak1.C deleted file mode 100644 index 2a6c33779d3..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/leak1.C +++ /dev/null @@ -1,38 +0,0 @@ -int count = 0; - -class T { - int i; -public: - T() { - i = 1; - ++count; - } - T(const T& o) { - i = o.i; - ++count; - } - T operator +(const T& o) { - T r; - r.i = this->i + o.i; - return r; - } - operator int () { - return i; - } - ~T() { - --count; - } -} s, b; - -void bar() { - static int j = int(s+b); - int i = int(s+b); -} - -int i = int(s+b); - -int main() { - bar(); - bar(); - return count != 2; -} diff --git a/gcc/testsuite/g++.old-deja/g++.mike/mangle1.C b/gcc/testsuite/g++.old-deja/g++.mike/mangle1.C deleted file mode 100644 index ac7d6cf92fb..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/mangle1.C +++ /dev/null @@ -1,27 +0,0 @@ -// Build don't link: -// Special g++ Options: - -// Make sure the typedef name is used in name mangling, not some random -// anonymous name - -struct foo { - typedef enum { red } color; - void bar(color r) { - } -} f; - -#ifdef sparc -void f1() asm("bar__3fooQ23foo3$_0"); -void f1() { -} -void f2() asm("_bar__3fooQ23foo3$_0"); -void f2() { -} -void f3() asm("__bar__3fooQ23foo3$_0"); -void f3() { -} -#endif - -main() { - f.bar(foo::red); -} diff --git a/gcc/testsuite/g++.old-deja/g++.mike/mangle2.C b/gcc/testsuite/g++.old-deja/g++.mike/mangle2.C deleted file mode 100644 index 174cacc6f3b..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/mangle2.C +++ /dev/null @@ -1,17 +0,0 @@ -// Build don't link: -// Special g++ Options: - -typedef struct { -} color; - -void foo(color) { -} - -#ifdef sparc -void f1() asm("foo__FG3$_0"); -void f1() { } -void f2() asm("_foo__FG3$_0"); -void f2() { } -void f3() asm("__foo__FG3$_0"); -void f3() { } -#endif diff --git a/gcc/testsuite/g++.old-deja/g++.mike/mangle3.C b/gcc/testsuite/g++.old-deja/g++.mike/mangle3.C deleted file mode 100644 index 77b92eca166..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/mangle3.C +++ /dev/null @@ -1,14 +0,0 @@ -struct ZZ { - int p; -}; - - -template <int ZZ::* ptr> -struct YY { - ZZ qq; - YY() { } -}; - -int main() { - YY<&ZZ::p> ww; -} diff --git a/gcc/testsuite/g++.old-deja/g++.mike/memoize1.C b/gcc/testsuite/g++.old-deja/g++.mike/memoize1.C deleted file mode 100644 index 9b7aadc5081..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/memoize1.C +++ /dev/null @@ -1,4 +0,0 @@ -// Build don't link: -// Special g++ Options: -fsave-memoized - -#include <iostream.h> diff --git a/gcc/testsuite/g++.old-deja/g++.mike/mi1.C b/gcc/testsuite/g++.old-deja/g++.mike/mi1.C deleted file mode 100644 index 0f5880dc145..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/mi1.C +++ /dev/null @@ -1,44 +0,0 @@ -// Special g++ Options: -w - -class A { -public: - virtual ~A(){}; - virtual int type(void) { - return -1; - } -}; - -class B : public A { -public: - virtual ~B(){}; -}; - - -class C0 : public B, public virtual A { -public: - virtual int type(void) { - return 0; - } -}; - -class C1 : public C0 -{ -public: - virtual int type(void) { - return 1; - } -}; - -class C2 : public C0 { -public: - virtual int type(void) { - return 2; - } -}; - -main() { - C1 *one = new C1; - - if (one->type() != 1) - return 1; -} diff --git a/gcc/testsuite/g++.old-deja/g++.mike/mi2.C b/gcc/testsuite/g++.old-deja/g++.mike/mi2.C deleted file mode 100644 index f3c01e383e5..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/mi2.C +++ /dev/null @@ -1,46 +0,0 @@ -class A { - char a; -public: - A(char x) : a(x) { } - virtual ~A() { } -}; - -class B : virtual public A { - char b; -public: - B(char x) : A('b'), b(x) { } - ~B() { } -}; - -class C : virtual public A { - char c; -public: - C(char x) : A('c'), c(x) { } - ~C() { } -}; - -class D : virtual public A, public B, public C { - char d; -public: - D(char x) : A('d'), B('d'), C('d'), d(x) { } - ~D() { } -}; - -class E : virtual public A, public B, public C { - char e; -public: - E(char x) : A('e'), B('e'), C('e'), e(x) { } - ~E() { } -}; - -class F : virtual public A, public D, public E { - char f; -public: - F(char x) : A('f'), D('f'), E('f'), f(x) { } - ~F() { } -}; - -int main() { - F f('x'); - return 0; -} diff --git a/gcc/testsuite/g++.old-deja/g++.mike/misc1.C b/gcc/testsuite/g++.old-deja/g++.mike/misc1.C deleted file mode 100644 index 0604eac63ac..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/misc1.C +++ /dev/null @@ -1,53 +0,0 @@ -// GROUPS passed construct-destruct -/* g++ constructs j 13 times, and destructs it once. */ - -extern "C" { - int printf(...); - void exit(int); -} - -void foo() { -} - -class C { - int val; - public: - static int count; - C(int ii) { - val = ii; - ++count; - printf("up\n"); - } - ~C() { - --count; - printf("down\n"); - } - int operator ++() { - return ++val; - } - operator int() { - return val; - } -}; - -int C::count = 0; - -void bar() { - for (int ii=0; ii<13; ++ii) - for (C j=1; j<9; ++j) - foo(); -} - -int main() { - bar(); - if (C::count) - { - printf("FAIL\n"); - exit(1); - } - else - { - printf("PASS\n"); - } - return 0; -} diff --git a/gcc/testsuite/g++.old-deja/g++.mike/misc11.C b/gcc/testsuite/g++.old-deja/g++.mike/misc11.C deleted file mode 100644 index 642fd2e474a..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/misc11.C +++ /dev/null @@ -1,4 +0,0 @@ -// Build don't link: -// GROUPS passed pt coredump -template<class T> class A; -void f () { A<int> *a; } diff --git a/gcc/testsuite/g++.old-deja/g++.mike/misc12.C b/gcc/testsuite/g++.old-deja/g++.mike/misc12.C deleted file mode 100644 index b342bb5f6c9..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/misc12.C +++ /dev/null @@ -1,8 +0,0 @@ -// Build don't link: -// GROUPS passed -struct A { virtual void f(); }; -struct B { virtual void f() ; }; -struct C : virtual A , virtual B { virtual void f(); }; - -/* This used to get an error because the DECL_CONTEXT was blown away. */ -void g(A *ptr) { ptr->f(); } diff --git a/gcc/testsuite/g++.old-deja/g++.mike/misc13.C b/gcc/testsuite/g++.old-deja/g++.mike/misc13.C deleted file mode 100644 index 166e33dce6a..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/misc13.C +++ /dev/null @@ -1,53 +0,0 @@ -// GROUPS passed vtable -extern "C" int printf(...); -enum { vf_request, vf_event } want; - -int errs = 0; - -class ivResource { -public: - virtual ~ivResource () { } -}; - -class ivHandler : public ivResource { -public: - virtual void event() { } -}; - -class ivGlyph : public ivResource { -public: - virtual ~ivGlyph () { } - virtual void request () { - if (want!=vf_request) - ++errs; - } -}; - -class ItemView : public ivGlyph, public ivHandler { -public: - virtual void event () { - if (want!=vf_event) - ++errs; - } -} a; - -ivGlyph *bar() { - return &a; -} - -ivHandler *bar2() { - return &a; -} - -int main() { - want=vf_request; - bar()->request(); - want=vf_event; - bar2()->event(); - if (errs) { - printf("FAIL\n"); - return 1; - } - printf("PASS\n"); - return 0; -} diff --git a/gcc/testsuite/g++.old-deja/g++.mike/misc14.C b/gcc/testsuite/g++.old-deja/g++.mike/misc14.C deleted file mode 100644 index 4886dcc9274..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/misc14.C +++ /dev/null @@ -1,27 +0,0 @@ -// GROUPS passed -extern "C" int printf(...); -extern "C" void exit(int); - -class A { -public: - virtual ~A() { - printf("FAIL\n"); - exit (1); - } -}; - -class B : public A { -public: - virtual ~B() { - printf("PASS\n"); - exit (0); - } -}; - -int main() { - B b; - A *ap = &b; - ap->~A(); // This should call the destructor virtually. - printf("FAIL\n"); - return 1; -} diff --git a/gcc/testsuite/g++.old-deja/g++.mike/misc2.C b/gcc/testsuite/g++.old-deja/g++.mike/misc2.C deleted file mode 100644 index d916651e164..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/misc2.C +++ /dev/null @@ -1,11 +0,0 @@ -// Build don't link: -// Special g++ Options: -ansi -pedantic -// GROUPS passed -/* -ansi -pedantic-errors should catch this. */ - -class C { - public: - extern inline int A() {// ERROR - .* - return 1; - } -}; diff --git a/gcc/testsuite/g++.old-deja/g++.mike/misc3.C b/gcc/testsuite/g++.old-deja/g++.mike/misc3.C deleted file mode 100644 index 5ac7a3b4884..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/misc3.C +++ /dev/null @@ -1,4 +0,0 @@ -// Build don't link: -// GROUPS uncaught -int a;// ERROR - .* -int a;// ERROR - .* diff --git a/gcc/testsuite/g++.old-deja/g++.mike/misc5.C b/gcc/testsuite/g++.old-deja/g++.mike/misc5.C deleted file mode 100644 index a0761b24818..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/misc5.C +++ /dev/null @@ -1,11 +0,0 @@ -// Build don't link: -// GROUPS uncaught -// Cfront bug A.3 (See Language System Release Notes for the -// SPARCompiler C++ version 3.0) - -struct S1 { - static int S1; // ERROR - uses same name 9.3 -}; -struct S2 { - union { int ii; float S2; }; // ERROR - uses same name 9.3 -}; diff --git a/gcc/testsuite/g++.old-deja/g++.mike/misc6.C b/gcc/testsuite/g++.old-deja/g++.mike/misc6.C deleted file mode 100644 index e3697527dc9..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/misc6.C +++ /dev/null @@ -1,11 +0,0 @@ -// Build don't link: -// GROUPS uncaught -// Cfront bug A.4 (See Language System Release Notes for the -// SPARCompiler C++ version 3.0) - -struct assign { - assign& operator = (const assign&); -}; -union U { - assign a; // ERROR - member of union cannot have op= 9.4// ERROR - .* -}; diff --git a/gcc/testsuite/g++.old-deja/g++.mike/misc7.C b/gcc/testsuite/g++.old-deja/g++.mike/misc7.C deleted file mode 100644 index e613ad9e6ba..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/misc7.C +++ /dev/null @@ -1,16 +0,0 @@ -// Build don't link: -// GROUPS passed MI -struct S1 { }; - -struct S2 : S1 { }; -struct S3 : S1 { }; - -struct S4 : S3, S2 { }; - -struct S1 *p1; -struct S4 *p4; - -void foobar () -{ - p1 = p4; // ERROR - this is illegal// ERROR - .* -} diff --git a/gcc/testsuite/g++.old-deja/g++.mike/misc8.C b/gcc/testsuite/g++.old-deja/g++.mike/misc8.C deleted file mode 100644 index cf15c82c761..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/misc8.C +++ /dev/null @@ -1,5 +0,0 @@ -// Build don't link: -// GROUPS passed vtable -class T { public: virtual ~T() {} }; -template<class P> class X : public virtual T {}; -int main() { X<int> x; } diff --git a/gcc/testsuite/g++.old-deja/g++.mike/misc9.C b/gcc/testsuite/g++.old-deja/g++.mike/misc9.C deleted file mode 100644 index ec02d1e63c1..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/misc9.C +++ /dev/null @@ -1,13 +0,0 @@ -// Build don't link: -// Special g++ Options: -Wall -pedantic -// GROUPS passed qualifiers -class bee { - public: - int bee::bar; // WARNING - there is an extra bee:: here -}; - -class foo { - public: - int bee::bar; // ERROR - you cannot do this - int me(); -}; diff --git a/gcc/testsuite/g++.old-deja/g++.mike/net1.C b/gcc/testsuite/g++.old-deja/g++.mike/net1.C deleted file mode 100644 index 9b2bbb835ff..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/net1.C +++ /dev/null @@ -1,19 +0,0 @@ -// Build don't link: -// Here is a net bug - -class ivAllocation { -public: - ivAllocation(); - int x_; -}; - -class TBScrollBoxInfo { -public: - ivAllocation allocation_; -}; - -TBScrollBoxInfo* items_; - -inline TBScrollBoxInfo item() { - return items_[0]; -} diff --git a/gcc/testsuite/g++.old-deja/g++.mike/net10.C b/gcc/testsuite/g++.old-deja/g++.mike/net10.C deleted file mode 100644 index 4546bf1bd0b..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/net10.C +++ /dev/null @@ -1,15 +0,0 @@ -// Build don't link: -// Special g++ Options: -pedantic-errors - -const int ci=10, *pc = &ci, *const cpc = pc, **ppc; -int i, *p, *const cp = &i; - -int main() -{ - i = ci; - *cp = ci; - pc++; - pc = cpc; - pc = p; - ppc = &pc; -} diff --git a/gcc/testsuite/g++.old-deja/g++.mike/net11.C b/gcc/testsuite/g++.old-deja/g++.mike/net11.C deleted file mode 100644 index 2030796a126..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/net11.C +++ /dev/null @@ -1,16 +0,0 @@ -// Build don't link: -// Special g++ Options: -pedantic-errors - -struct Foo { - char *p; - const char *q; - void m() const; -}; - -void other(char &x); - -void -Foo::m() const -{ - other(*p); // this is legal -} diff --git a/gcc/testsuite/g++.old-deja/g++.mike/net12.C b/gcc/testsuite/g++.old-deja/g++.mike/net12.C deleted file mode 100644 index b5fbf64ddec..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/net12.C +++ /dev/null @@ -1,16 +0,0 @@ -// Build don't link: -// Special g++ Options: -pedantic-errors - -struct Foo { - char *p; - const char *q; - void m() const; -}; - -void other(char &x); // ERROR - reference below - -void -Foo::m() const -{ - other(*q); // ERROR - this is bad -} diff --git a/gcc/testsuite/g++.old-deja/g++.mike/net13.C b/gcc/testsuite/g++.old-deja/g++.mike/net13.C deleted file mode 100644 index d56e87270e7..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/net13.C +++ /dev/null @@ -1,14 +0,0 @@ -// Build don't link: - -// make sure extern "C" friends work. - -extern "C" { void func(); } - -struct crash { - int i; - friend void func(); -} a; - -void func() { - a.i = 1; -} diff --git a/gcc/testsuite/g++.old-deja/g++.mike/net14.C b/gcc/testsuite/g++.old-deja/g++.mike/net14.C deleted file mode 100644 index 4f32fdd52ea..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/net14.C +++ /dev/null @@ -1,7 +0,0 @@ -// Build don't link: -// this probably does not have correct debugging info generated. - -typedef struct Thing { - Thing(); - int x; -} Thing; diff --git a/gcc/testsuite/g++.old-deja/g++.mike/net15.C b/gcc/testsuite/g++.old-deja/g++.mike/net15.C deleted file mode 100644 index dfe4dc5e085..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/net15.C +++ /dev/null @@ -1,46 +0,0 @@ -// InterViews (ibuild) requires this to work. - -extern "C" void exit(int); - -void *old; - -class c1 -{ - int i; -public: - c1 () {} -}; - -class c2 -{ - int j; -public: - c2 () {} -}; - -class c3 : public c1, public c2 -{ -public: - c3 () - { - old = this; - // printf("new object c3 at %x\n", (int)this); } - } -}; - -c2* f () -{ - c2* n = new c3 (); - // printf ("new object c3 casted to c2 at %x\n", (int)n); - return n; -} - -int main () -{ - c3* o = (c3*)f (); - // printf("new object c3, upcasted from c2 at %x\n", (int)o); - // if old and o are not the same, fail the test case. - if (old != o) - exit(1); - return 0; -} diff --git a/gcc/testsuite/g++.old-deja/g++.mike/net16.C b/gcc/testsuite/g++.old-deja/g++.mike/net16.C deleted file mode 100644 index 5da97a8607f..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/net16.C +++ /dev/null @@ -1,7 +0,0 @@ -// On an i386, this core dumps because the reg-stack.c code is wrong, and -// pops an fp register that it thinks is not used, but it is. - -extern "C" int printf (const char*, ...); -struct S { ~S () { } }; -double f (S) { return 5; } -int main() { S s; double dist = f (s); printf ("%g\n", dist); return 0; } diff --git a/gcc/testsuite/g++.old-deja/g++.mike/net17.C b/gcc/testsuite/g++.old-deja/g++.mike/net17.C deleted file mode 100644 index 5befc4fd41f..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/net17.C +++ /dev/null @@ -1,58 +0,0 @@ -// example from the ARM page 292 and 293 - -extern "C" int printf(const char *, ...); -extern "C" void exit(int); - -int i = 0; - -class A { -public: - A() { - printf("Doing A\n"); - if (++i != 1) - exit(1); - } -}; - -class B { -public: - B() { - printf("Doing B\n"); - if (++i != 2) - exit(1); - } -}; - -class C : public virtual A, public virtual B { -public: - C() { - printf("Doing C\n"); - if (++i != 3) - exit(1); - } -}; - -class D : public virtual B, public virtual A { -public: - D() { - printf("Doing D\n"); - if (++i != 4) - exit(1); - } -}; - -class E : public C, public D { -public: - E() { - printf("Doing E\n"); - if (++i != 5) - exit(1); - } -} e; - - -int main() { - if (++i != 6) - exit(1); - return 0; -} diff --git a/gcc/testsuite/g++.old-deja/g++.mike/net18.C b/gcc/testsuite/g++.old-deja/g++.mike/net18.C deleted file mode 100644 index 81e38d370e3..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/net18.C +++ /dev/null @@ -1,21 +0,0 @@ -// Build don't link: - -class ClassA { -public: - typedef ClassA& (*PMFV)(const char*); - static PMFV setMapper(PMFV); - static PMFV _mapper; -}; - -class ClassB { -public: - typedef ClassB& (*PMFV)(const char*); -}; - -ClassA::PMFV ClassA::setMapper(ClassA::PMFV newFunc) -{ - PMFV oldFunc = _mapper; - _mapper = newFunc; - - return oldFunc; -} diff --git a/gcc/testsuite/g++.old-deja/g++.mike/net19.C b/gcc/testsuite/g++.old-deja/g++.mike/net19.C deleted file mode 100644 index 68c47533a68..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/net19.C +++ /dev/null @@ -1,20 +0,0 @@ -// Test to make sure &<incomplete record type> works in c++ -// Build don't link: - -struct FILE { - int _flags; -}; - -extern struct _fake_filebuf __std_filebuf_2; - -class Value { - int width; -public: - Value(); - friend Value operator&( __const Value&, __const Value&); -}; - -FILE* Foo () -{ - return ((FILE*)&__std_filebuf_2); -} diff --git a/gcc/testsuite/g++.old-deja/g++.mike/net2.C b/gcc/testsuite/g++.old-deja/g++.mike/net2.C deleted file mode 100644 index ffc14ef2115..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/net2.C +++ /dev/null @@ -1,13 +0,0 @@ -// Build don't link: -// Here is another program from the net. - -class B; - -class A { - private: - A(B *); // ERROR - - public: - A(long); // ERROR - -}; - -A a(0); // ERROR - should be ambigious diff --git a/gcc/testsuite/g++.old-deja/g++.mike/net20.C b/gcc/testsuite/g++.old-deja/g++.mike/net20.C deleted file mode 100644 index 916ba434b37..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/net20.C +++ /dev/null @@ -1,11 +0,0 @@ -// Build don't link: -// A pointer to member function test case. - -struct X -{ -}; - -void (X::* fee ())() -{ - lab: goto lab; -} diff --git a/gcc/testsuite/g++.old-deja/g++.mike/net21.C b/gcc/testsuite/g++.old-deja/g++.mike/net21.C deleted file mode 100644 index 02e40b0b935..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/net21.C +++ /dev/null @@ -1,59 +0,0 @@ -// Make sure we can initialize complex (MI ambiguous) vtables. - -extern "C" int printf(const char *, ...); - -struct a -{ - virtual void f() = 0; -}; - -struct b -{ - virtual void g() { }; -}; - -struct c: public a, public b -{ - virtual void f(); - virtual void g(); -}; - -void c::f() -{ - printf("c::f()\n"); -} - -void c::g() -{ - printf("c::g()\n"); -} - -struct e: public b -{ -}; - -struct h -{ -}; - -struct d: public c, public e, public h -{ - virtual void f(); - virtual void g(); -}; -void d::f() -{ - printf("d::f()\n"); -} - -void d::g() -{ - printf("d::g()\n"); -} - -int main(int argc, char* argv[]) -{ - a* tmp = new d; - tmp->f(); - return 0; -} diff --git a/gcc/testsuite/g++.old-deja/g++.mike/net22.C b/gcc/testsuite/g++.old-deja/g++.mike/net22.C deleted file mode 100644 index f18d0563f9f..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/net22.C +++ /dev/null @@ -1,13 +0,0 @@ -class Parent { -public: - Parent() {} - Parent( char *s ) {} -}; - -class Child : public Parent { -}; // ERROR - called - -int main() { - Child c( "String initializer" ); // ERROR - bad - return 0; -} diff --git a/gcc/testsuite/g++.old-deja/g++.mike/net23.C b/gcc/testsuite/g++.old-deja/g++.mike/net23.C deleted file mode 100644 index 2fe7d4c8c01..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/net23.C +++ /dev/null @@ -1,15 +0,0 @@ -// Build don't link: - -class environment { -public: - int get_font() ; -}; - -typedef int (environment::*INT_FUNCP)(); - -void myfoo(INT_FUNCP a); - -void init_env_requests() -{ - myfoo(&environment::get_font); -} diff --git a/gcc/testsuite/g++.old-deja/g++.mike/net24.C b/gcc/testsuite/g++.old-deja/g++.mike/net24.C deleted file mode 100644 index 682fb08b17a..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/net24.C +++ /dev/null @@ -1,3 +0,0 @@ -// Build don't link: - - char HexDigit(unsigned char ch) { return ch < 'f'; } diff --git a/gcc/testsuite/g++.old-deja/g++.mike/net25.C b/gcc/testsuite/g++.old-deja/g++.mike/net25.C deleted file mode 100644 index 56356779042..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/net25.C +++ /dev/null @@ -1,17 +0,0 @@ -// Build don't link: - -void shake_zero() -{ -} - -void shake_one() -{ -} - -void (*foo)(); - -int main(int a) -{ - foo = a ? shake_zero : shake_one; - return 0; -} diff --git a/gcc/testsuite/g++.old-deja/g++.mike/net26.C b/gcc/testsuite/g++.old-deja/g++.mike/net26.C deleted file mode 100644 index 753c5f6cd2b..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/net26.C +++ /dev/null @@ -1,27 +0,0 @@ -// A test case found by InterViews testing... - -extern "C" int printf(const char *, ...); - -class A { -public: - int foo() { printf("ok nv\n"); } - virtual int vfoo() { printf("ok v\n"); } -}; - -struct S { - int (A::*pfn1)(); - int (A::*pfn2)(); - int (A::*pfn3)(); -}; - -// This failed before. -S s = { &A::foo, &A::vfoo, &A::foo }; - -A a; - -int main() { - (a.*s.pfn1)(); - (a.*s.pfn2)(); - printf("PASS\n"); - return 0; -} diff --git a/gcc/testsuite/g++.old-deja/g++.mike/net27.C b/gcc/testsuite/g++.old-deja/g++.mike/net27.C deleted file mode 100644 index afe975cc44f..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/net27.C +++ /dev/null @@ -1,9 +0,0 @@ -// Build don't link: - -class path { -public: - path (const path& r) - { "\""; - '\''; - } -}; diff --git a/gcc/testsuite/g++.old-deja/g++.mike/net28.C b/gcc/testsuite/g++.old-deja/g++.mike/net28.C deleted file mode 100644 index 3b724820fbd..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/net28.C +++ /dev/null @@ -1,28 +0,0 @@ -// From reinhard@ifki50.informatik.fh-muenchen.de against gcc 2.5.0. -// shows an InterViews problem on RS6000 and i386. Doesn't happen on -// SPARC. - -// From fbrowser.c. - -// Build don't link: - -class test { -}; - - -typedef int ( test ::* test2)(int fd); - -class ivFileBrowserImpl_IOCallback -{ - public: - - int inputReady(int fd); - test * _obj; - test2 _input; -}; - - -int ivFileBrowserImpl_IOCallback ::inputReady(int fd) -{ - return (_obj->*_input)(fd); -} diff --git a/gcc/testsuite/g++.old-deja/g++.mike/net29.C b/gcc/testsuite/g++.old-deja/g++.mike/net29.C deleted file mode 100644 index 6635241eb89..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/net29.C +++ /dev/null @@ -1,27 +0,0 @@ -// This is a test case for the recent libg++ make check problem. -// Build don't link: - -class SubString { -public: - SubString(); - SubString(const SubString& x); -}; - -class String { -public: - String(); - String(const SubString& x); -}; - -int operator!=(const String& x, const SubString& y); -int operator!=(const String& x, const String& y); - -int operator!=(const SubString& x, const String& y); -int operator!=(const SubString& x, const SubString& y); - -void comparetest() -{ - String x; - SubString s; - x != s; -} diff --git a/gcc/testsuite/g++.old-deja/g++.mike/net3.C b/gcc/testsuite/g++.old-deja/g++.mike/net3.C deleted file mode 100644 index e6dbdcbe786..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/net3.C +++ /dev/null @@ -1,16 +0,0 @@ -// Build don't link: -// Here is another program from the net. - -class BOOL { - public: - int val; - - BOOL(int i =0); - operator int(); -}; - -BOOL& foo() -{ - static BOOL status; - return status; -} diff --git a/gcc/testsuite/g++.old-deja/g++.mike/net30.C b/gcc/testsuite/g++.old-deja/g++.mike/net30.C deleted file mode 100644 index 52f7b28fe24..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/net30.C +++ /dev/null @@ -1,18 +0,0 @@ -// Build don't link: - -class X { -public: - void x(void); -}; - -class Y : public X { -}; - -class Z : private Y { -public: - void y(void); -}; - -void Z::y(void) { - x(); // should be OK -} diff --git a/gcc/testsuite/g++.old-deja/g++.mike/net31.C b/gcc/testsuite/g++.old-deja/g++.mike/net31.C deleted file mode 100644 index 3ecf81c7349..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/net31.C +++ /dev/null @@ -1,68 +0,0 @@ -// Build don't link: - -class foo_a { - protected: - double func(int xi) {return 0.0;} - public: - foo_a() {} -}; - -class foo_b { - public: - foo_b(int); - foo_b(); - ~foo_b(); - foo_b(const foo_b&); - inline double& operator()(int); - foo_b& operator=(foo_b&); - void bar_a(int); -}; - -foo_b& operator*(foo_b&, foo_b&); -foo_b& operator*(double, foo_b&); - -template <class TP> -class foo_c { - typedef double (TP::* Tmatf)(int); - int m; - Tmatf* a; - void foo_cinst (int mm); - public: - foo_c(int mm); - foo_c() {m = 0; a = 0;} - ~foo_c() {delete a;} - double (TP::*& operator()(int i))(int) {return a[i];} - foo_b& bug_func(int); -}; - -template <class TP> -foo_b& foo_c<TP>::bug_func(int x) { - static foo_b retval(m); - retval.bar_a(m); - for (register int i = 0; i < m; i++) - retval(i) = (*(operator()(i)))(x); // ERROR - - return retval; -} - -template <class TP> -class foo_d { - protected: - foo_c<TP> bar_b; - public: - foo_d() {} - virtual ~foo_d() {} - virtual void setfoo_c(); -}; - -class foo_e : public foo_a, public foo_d<foo_a> { - public: - foo_e(); - ~foo_e() {} - void setfoo_c(); -}; - -void foo_e::setfoo_c() { - bar_b(0) = func; // ERROR - -} - -template class foo_c<foo_a>; diff --git a/gcc/testsuite/g++.old-deja/g++.mike/net32.C b/gcc/testsuite/g++.old-deja/g++.mike/net32.C deleted file mode 100644 index 4ac8a94816f..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/net32.C +++ /dev/null @@ -1,10 +0,0 @@ -// Build don't link: - -class Co_obj { -public: - Co_obj() {} - }; -class Linear_list_node : virtual public Co_obj { }; -class M1 : public Linear_list_node { }; -class M2 : public Linear_list_node { }; -class New_node : public M1, public M2 { }; diff --git a/gcc/testsuite/g++.old-deja/g++.mike/net34.C b/gcc/testsuite/g++.old-deja/g++.mike/net34.C deleted file mode 100644 index 51266a35d48..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/net34.C +++ /dev/null @@ -1,36 +0,0 @@ -#include <iostream.h> - -class foo { -public: - foo(int i) {k = i;} -protected: - int k; -}; - -class bar_1 : public foo { -public: - bar_1(int i) : foo(i) {} - int get_k() {return k;} -}; - -class bar_2 : public foo { -public: - bar_2(int i) : foo(i) {}; - int get_k() {return k;} -}; - -class multiple : public bar_1, public bar_2 { -public: - multiple(int i1, int i2) : bar_1(i1), bar_2(i2) {} - void print() { - cout << "bar_1::k -> " << bar_1::k << "\n"; - cout << "bar_2::k -> " << bar_2::k << "\n"; - cout << "bar_1::get_k() -> " << bar_1::get_k() << "\n"; - cout << "bar_2::get_k() -> " << bar_2::get_k() << "\n"; - } -}; - -int main() { - multiple m(1,2); - m.print(); -} diff --git a/gcc/testsuite/g++.old-deja/g++.mike/net35.C b/gcc/testsuite/g++.old-deja/g++.mike/net35.C deleted file mode 100644 index 332bf429f3e..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/net35.C +++ /dev/null @@ -1,27 +0,0 @@ -extern "C" int printf(const char *, ...); - -class A { - public: - char *x; -}; - -class B1:public virtual A { }; - -class B2:public virtual A { }; - -class C:public B1, public B2 { -public: - C() { } -}; - -int main() { - C c; - printf("&c.x = %x\n", &c.x); - printf("&c.B1::x = %x\n", &c.B1::x); - printf("&c.B2::x = %x\n", &c.B2::x); - printf("&c.A::x = %x\n", &c.A::x); - if (&c.x != &c.B1::x - || &c.x != &c.B2::x - || &c.x != &c.A::x) - return 1; -} diff --git a/gcc/testsuite/g++.old-deja/g++.mike/net36.C b/gcc/testsuite/g++.old-deja/g++.mike/net36.C deleted file mode 100644 index 843c31421ad..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/net36.C +++ /dev/null @@ -1,19 +0,0 @@ -// Build don't link: - -class X; - -class A { -public: - void handlerFn(X*); -}; - -typedef void (A::*handler) (X*); - -class B { -public: - void setHandler(handler); -}; - -void f(B* b) { - b->setHandler(A::handlerFn); // ERROR - -}; diff --git a/gcc/testsuite/g++.old-deja/g++.mike/net37.C b/gcc/testsuite/g++.old-deja/g++.mike/net37.C deleted file mode 100644 index 1ce7834a5e2..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/net37.C +++ /dev/null @@ -1,39 +0,0 @@ -class B { -public: - int bi; - void bProc ( void ) { bi = 39; } - }; - -class D : public B { -public: - int di; - void dProc (void ){ di = 42; } - }; - -typedef void (B::*BPROC)(void); -typedef void (D::*DPROC)(void); - -union AFX_PMSG { -public: - - AFX_PMSG () {}; - AFX_PMSG ( BPROC bpr ) { bfn = bpr ; } - - operator BPROC() { return bfn; } - - BPROC bfn; - DPROC dfn; -}; - - -int main(int argc, char *argv[]) { - B b; - D d; - - BPROC bpr = &B::bProc; - AFX_PMSG pmsg(bpr); - - BPROC ppr = pmsg; - - return 0; -} diff --git a/gcc/testsuite/g++.old-deja/g++.mike/net38.C b/gcc/testsuite/g++.old-deja/g++.mike/net38.C deleted file mode 100644 index 2b7c0c4f940..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/net38.C +++ /dev/null @@ -1,28 +0,0 @@ -struct A { - virtual int a () { return 0; } -}; - -struct B { - virtual int b () { return 0; } - virtual int b2 () { return 0; } -}; - -struct C : public A, public B { - virtual int a () { return 1; } - virtual int b () { return 2; } - virtual int b2 () { return 3; } -}; - -int (C::*vmpb) () = &C::b; -int (C::*vmpb2) () = &C::b2; -int (C::*vmpa) () = &C::a; - -int main () { - C c; - if ((c.*vmpa)() != 1) - return 1; - if ((c.*vmpb)() != 2) - return 1; - if ((c.*vmpb2)() != 3) - return 1; -} diff --git a/gcc/testsuite/g++.old-deja/g++.mike/net39.C b/gcc/testsuite/g++.old-deja/g++.mike/net39.C deleted file mode 100644 index 00ad1c6bc02..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/net39.C +++ /dev/null @@ -1,30 +0,0 @@ -void *vp; - -class silly { -public: - virtual int b() { return 1; } -}; -class solly : silly { -public: - virtual int b() { return 2; } -}; -class thing { -public: - virtual int a() { return 3; } -}; -class thong : public solly, public thing { -public: - virtual int a() { - if (this != vp) return 4; - else return 0; - } -}; - -typedef int(thing::*ping)(); -ping qq = &thing::a; - -int main() { - thong b; - vp = &b; - return (b.*qq)(); -} diff --git a/gcc/testsuite/g++.old-deja/g++.mike/net4.C b/gcc/testsuite/g++.old-deja/g++.mike/net4.C deleted file mode 100644 index 4cf8e7a1387..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/net4.C +++ /dev/null @@ -1,32 +0,0 @@ -// Message-Id: <m0lLuUK-0000fRC@nix.appli.se> -// Date: Wed, 4 Mar 92 12:50 MET -// From: niklas@appli.se (Niklas Hallqvist) -// To: eichin@cygnus.com, tiemann@cygnus.com -// Cc: gcc2@cygnus.com -// Subject: nested type handling -// -// The last couple of days I've been struggling with nested types in the -// C++ compiler. Frankly, it's a mess! Was it impossible to put the stuff -// into the parser instead of the lexer? Well, anyway, to get the following -// code to compile: -// -// struct O { -// struct M { -// struct I -// {}; -// }; -// }; -// O::M::I s; -// -// a patch enclosed below is needed. I'm not sure if it causes any -// unanticipated side-effects, but it seem to work well for me. - -// Build don't link: - -struct O { - struct M { - struct I - {}; - }; -}; -O::M::I s; diff --git a/gcc/testsuite/g++.old-deja/g++.mike/net40.C b/gcc/testsuite/g++.old-deja/g++.mike/net40.C deleted file mode 100644 index 10e16e685b7..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/net40.C +++ /dev/null @@ -1,18 +0,0 @@ -#include <stddef.h> -extern "C" void abort(); - -class toto { -public: - void * operator new (size_t t) { - abort(); - } - void operator delete (void*p, size_t t) { - abort(); - } -}; - -int main() { - toto * p; - p = new toto[5]; - delete [] p; -} diff --git a/gcc/testsuite/g++.old-deja/g++.mike/net41.C b/gcc/testsuite/g++.old-deja/g++.mike/net41.C deleted file mode 100644 index 2c29e9b4410..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/net41.C +++ /dev/null @@ -1,3 +0,0 @@ -int main() { - int i = ~ false; -} diff --git a/gcc/testsuite/g++.old-deja/g++.mike/net42.C b/gcc/testsuite/g++.old-deja/g++.mike/net42.C deleted file mode 100644 index 178a0bbf5ec..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/net42.C +++ /dev/null @@ -1,25 +0,0 @@ -// Build don't link: - -typedef void (*__sighandler_t)(int); - -struct sigaction { - __sighandler_t sa_handler; -}; - -struct task_struct { - struct sigaction sigaction[32]; -}; - -void -get_stat() { - struct task_struct ** p = 0; - unsigned long bit = 1; - unsigned long sigignore = 0; - int i = 0; - switch((unsigned long) (*p)->sigaction[i].sa_handler) - { - case 1: - sigignore |= bit; - break; - } -} diff --git a/gcc/testsuite/g++.old-deja/g++.mike/net43.C b/gcc/testsuite/g++.old-deja/g++.mike/net43.C deleted file mode 100644 index 3a34c8f7e2f..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/net43.C +++ /dev/null @@ -1,11 +0,0 @@ -// Build don't link: - -class foo { - public: - friend int operator ^(const foo&, const foo&); -}; - -int main () -{ - int (*funptr) (const foo &, const foo &) = operator ^; -} diff --git a/gcc/testsuite/g++.old-deja/g++.mike/net44.C b/gcc/testsuite/g++.old-deja/g++.mike/net44.C deleted file mode 100644 index 5b6a0ad4bfe..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/net44.C +++ /dev/null @@ -1,11 +0,0 @@ -// Make sure we don't dump core - -enum request { q, w, e}; // ERROR - - -class request { // ERROR - -public: - int a; - request( int b) { - a = b; - }; -}; diff --git a/gcc/testsuite/g++.old-deja/g++.mike/net45.C b/gcc/testsuite/g++.old-deja/g++.mike/net45.C deleted file mode 100644 index 388af8fe82f..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/net45.C +++ /dev/null @@ -1,20 +0,0 @@ -// Build don't link: - -template <class T1, class T2> -struct pair { - T1 first; - T2 second; - pair(const T1& a, const T2& b) : first(a), second(b) {} -}; - -struct myint { - myint() { - } - myint(const myint& mi) { - } - myint& operator=(const myint& mi) { - } -}; - -extern pair<const myint, myint> a; -pair<const myint, myint> b(a); diff --git a/gcc/testsuite/g++.old-deja/g++.mike/net46.C b/gcc/testsuite/g++.old-deja/g++.mike/net46.C deleted file mode 100644 index ac7950117f9..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/net46.C +++ /dev/null @@ -1,16 +0,0 @@ -#include <iostream.h> -#include <stddef.h> -#include <new> - -int fail = 1; - -static void *operator new(size_t size) throw (std::bad_alloc) { - --fail; - return (void*) 0; -} - -int main() { - cout << ""; - new int; - return fail; -} diff --git a/gcc/testsuite/g++.old-deja/g++.mike/net47.C b/gcc/testsuite/g++.old-deja/g++.mike/net47.C deleted file mode 100644 index fc4a81f1266..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/net47.C +++ /dev/null @@ -1,8 +0,0 @@ -// Build don't link: -// Special g++ Options: -w -fpermissive - -class foo {}; -class bar : foo { -public: - bar () : () {} -}; diff --git a/gcc/testsuite/g++.old-deja/g++.mike/net48.C b/gcc/testsuite/g++.old-deja/g++.mike/net48.C deleted file mode 100644 index a2d674383b6..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/net48.C +++ /dev/null @@ -1,14 +0,0 @@ -// Build don't link: - -char *a="aê"; - -class A -{ -public: - A() - { - char *b="aê"; - } -}; - -char *c="aê"; diff --git a/gcc/testsuite/g++.old-deja/g++.mike/net5.C b/gcc/testsuite/g++.old-deja/g++.mike/net5.C deleted file mode 100644 index e9144320479..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/net5.C +++ /dev/null @@ -1,7 +0,0 @@ -// Build don't link: -// Special g++ Options: - -volatile void abort(); -volatile void oink() { - abort() ; -} // gets bogus error - diff --git a/gcc/testsuite/g++.old-deja/g++.mike/net6.C b/gcc/testsuite/g++.old-deja/g++.mike/net6.C deleted file mode 100644 index 6a3aef1d919..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/net6.C +++ /dev/null @@ -1,5 +0,0 @@ -// Build don't link: -// Special g++ Options: - -struct X {}; -X x = X(); // gets bogus error diff --git a/gcc/testsuite/g++.old-deja/g++.mike/net7.C b/gcc/testsuite/g++.old-deja/g++.mike/net7.C deleted file mode 100644 index 14655028ea7..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/net7.C +++ /dev/null @@ -1,7 +0,0 @@ -// Build don't link: -// Special g++ Options: - -// This should compile. - -int foo (signed char *); -int foo (char *); diff --git a/gcc/testsuite/g++.old-deja/g++.mike/net8.C b/gcc/testsuite/g++.old-deja/g++.mike/net8.C deleted file mode 100644 index 12823175a24..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/net8.C +++ /dev/null @@ -1,32 +0,0 @@ -// Build don't link: -// Special g++ Options: -pedantic-errors - -class Base { -public: - int foo; -}; - -class Derived : public Base { -public: - int bar; -}; - -void func(Base&); // ERROR - - -void func2(const Derived& d) { - func(d); // ERROR - this is bad -} - -void -foo (int& a) -{ // ERROR - -} - -int main () -{ - int b; - const int*const a = &b; - *a = 10; // ERROR - it's const - foo (*a); // ERROR - it's const - return 0; -} diff --git a/gcc/testsuite/g++.old-deja/g++.mike/net9.C b/gcc/testsuite/g++.old-deja/g++.mike/net9.C deleted file mode 100644 index 7d876dc95f4..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/net9.C +++ /dev/null @@ -1,15 +0,0 @@ -// Build don't link: -// Special g++ Options: -pedantic-errors - -const int ci=10, *pc = &ci, *const cpc = pc, **ppc; -int i, *p, *const cp = &i; - -int main() -{ - ci = 1; // ERROR - bad - ci++; // ERROR - bad - *pc = 2; // ERROR - bad - cp = &ci; // ERROR - bad - cpc++; // ERROR - bad - p = pc; // ERROR - bad -} diff --git a/gcc/testsuite/g++.old-deja/g++.mike/ns1.C b/gcc/testsuite/g++.old-deja/g++.mike/ns1.C deleted file mode 100644 index c347d2d93a4..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/ns1.C +++ /dev/null @@ -1,11 +0,0 @@ -namespace Foo { - int bar() { - return 0; - } -} - -using namespace Foo; - -int main() { - bar(); -} diff --git a/gcc/testsuite/g++.old-deja/g++.mike/ns10.C b/gcc/testsuite/g++.old-deja/g++.mike/ns10.C deleted file mode 100644 index a6b1c3aedd3..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/ns10.C +++ /dev/null @@ -1,9 +0,0 @@ -namespace Foo { - int bar() { - return 0; - } -} - -int main() { - return Foo::bar(); -} diff --git a/gcc/testsuite/g++.old-deja/g++.mike/ns11.C b/gcc/testsuite/g++.old-deja/g++.mike/ns11.C deleted file mode 100644 index bde7723bd7c..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/ns11.C +++ /dev/null @@ -1,18 +0,0 @@ -class Foo { -}; - -namespace A { - namespace Foo { - int bar() { - return 0; - } - } - - int mymain() { - return Foo::bar(); - } -} - -int main() { - return A::mymain(); -} diff --git a/gcc/testsuite/g++.old-deja/g++.mike/ns12.C b/gcc/testsuite/g++.old-deja/g++.mike/ns12.C deleted file mode 100644 index 38978109623..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/ns12.C +++ /dev/null @@ -1,14 +0,0 @@ -namespace { - int i = 10; - enum fish { one = 1, two = 2, red = 3, blue = 4 }; -} -extern "C" void printf (const char *, ...); -int main(void) -{ - if (i != 10) { - return 1; - } - if (one != 1) { - return 2; - } -} diff --git a/gcc/testsuite/g++.old-deja/g++.mike/ns13.C b/gcc/testsuite/g++.old-deja/g++.mike/ns13.C deleted file mode 100644 index 5482a43c72f..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/ns13.C +++ /dev/null @@ -1,13 +0,0 @@ -// Build don't link: - -namespace N { - struct C { - C(); - }; -} - -namespace M { - struct C { - C(); - }; -} diff --git a/gcc/testsuite/g++.old-deja/g++.mike/ns14.C b/gcc/testsuite/g++.old-deja/g++.mike/ns14.C deleted file mode 100644 index 3c3ad3fc20b..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/ns14.C +++ /dev/null @@ -1,11 +0,0 @@ -// Build don't link: - -namespace Jazz { - int horn( int h ) { return 1; } -} - -using Jazz::horn; - -namespace Jazz { - int horn ( char c ) { return 0; } -} diff --git a/gcc/testsuite/g++.old-deja/g++.mike/ns15.C b/gcc/testsuite/g++.old-deja/g++.mike/ns15.C deleted file mode 100644 index 39440526190..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/ns15.C +++ /dev/null @@ -1,31 +0,0 @@ -// Build don't link: - -#include <stdio.h> -#include <stdlib.h> - -#define MAX 256 -#define MAXSTATE 1000000 - -struct R { - int count; - int state1; - int state2; -}; - -int cmp_d(const R* a, const R* b) { - return a->count > b->count; -} - -namespace CXX { - template<class T, int i1, int i2> - inline void qsort (T b[i1][i2], int (*cmp)(const T*, const T*)) { - ::qsort ((void*)b, i1*i2, sizeof(T), (int (*)(const void *, const void *))cmp); - } -} - -using namespace CXX; - -void sort_machine() { - struct R d[MAX][MAX]; - qsort<R,MAX> (d, cmp_d); -} diff --git a/gcc/testsuite/g++.old-deja/g++.mike/ns2.C b/gcc/testsuite/g++.old-deja/g++.mike/ns2.C deleted file mode 100644 index 365eb8c0923..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/ns2.C +++ /dev/null @@ -1,9 +0,0 @@ -namespace N { - int i; -}; - -using namespace N; - -int main() { - return i; -} diff --git a/gcc/testsuite/g++.old-deja/g++.mike/ns3.C b/gcc/testsuite/g++.old-deja/g++.mike/ns3.C deleted file mode 100644 index 77da5af7f1c..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/ns3.C +++ /dev/null @@ -1,4 +0,0 @@ -int i; // ERROR - - -namespace i { // ERROR - -} diff --git a/gcc/testsuite/g++.old-deja/g++.mike/ns4.C b/gcc/testsuite/g++.old-deja/g++.mike/ns4.C deleted file mode 100644 index 7c359cf5c03..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/ns4.C +++ /dev/null @@ -1,6 +0,0 @@ -// Build don't link: - -namespace i { -} -namespace i { -} diff --git a/gcc/testsuite/g++.old-deja/g++.mike/ns5.C b/gcc/testsuite/g++.old-deja/g++.mike/ns5.C deleted file mode 100644 index d138ff3c8fb..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/ns5.C +++ /dev/null @@ -1,5 +0,0 @@ -namespace A { - int i = 1; -} - -int j = i; // ERROR - diff --git a/gcc/testsuite/g++.old-deja/g++.mike/ns6.C b/gcc/testsuite/g++.old-deja/g++.mike/ns6.C deleted file mode 100644 index dc082472ada..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/ns6.C +++ /dev/null @@ -1,9 +0,0 @@ -// Build don't link: - -namespace A { - int i = 1; -} - -namespace A { - int j = i; -} diff --git a/gcc/testsuite/g++.old-deja/g++.mike/ns7.C b/gcc/testsuite/g++.old-deja/g++.mike/ns7.C deleted file mode 100644 index ff7cda6e5ab..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/ns7.C +++ /dev/null @@ -1,9 +0,0 @@ -// Build don't link: - -namespace A { - int i = 1; -} - -namespace B { - int j = i; // ERROR - -} diff --git a/gcc/testsuite/g++.old-deja/g++.mike/ns8.C b/gcc/testsuite/g++.old-deja/g++.mike/ns8.C deleted file mode 100644 index dc082472ada..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/ns8.C +++ /dev/null @@ -1,9 +0,0 @@ -// Build don't link: - -namespace A { - int i = 1; -} - -namespace A { - int j = i; -} diff --git a/gcc/testsuite/g++.old-deja/g++.mike/ns9.C b/gcc/testsuite/g++.old-deja/g++.mike/ns9.C deleted file mode 100644 index 8d640e70fed..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/ns9.C +++ /dev/null @@ -1,11 +0,0 @@ -namespace Foo { - int bar() { - return 0; - } -} - -using Foo::bar; - -int main() { - return bar(); -} diff --git a/gcc/testsuite/g++.old-deja/g++.mike/offset1.C b/gcc/testsuite/g++.old-deja/g++.mike/offset1.C deleted file mode 100644 index 6a259d8967a..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/offset1.C +++ /dev/null @@ -1,38 +0,0 @@ -extern "C" int printf(const char *, ...); -void *vp; -int fail = 0; - -class Foo { -public: - virtual void setName() { - printf("Foo at %x\n", this); - if (vp != (void*)this) - fail = 1; - } -}; - -class Bar : public Foo { -public: - virtual void init(int argc, char **argv) { - printf("Bar's Foo at %x\n", (Foo*)this); - vp = (void*)(Foo*)this; - setName(); - } -}; - -class Barf : virtual public Bar { -public: - virtual void init(int argc, char **argv) { Bar::init(argc, argv); } -}; - -class Baz : virtual public Bar, virtual public Barf { -public: - virtual void init(int argc, char **argv) { Barf::init(argc, argv); } -}; - -Bar *theBar = new Baz(); - -int main(int argc, char **argv) { - theBar->init(argc, argv); - return fail; -} diff --git a/gcc/testsuite/g++.old-deja/g++.mike/opr-as1.C b/gcc/testsuite/g++.old-deja/g++.mike/opr-as1.C deleted file mode 100644 index 935b0bac85c..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/opr-as1.C +++ /dev/null @@ -1,11 +0,0 @@ -// Shows a problem with the default op= not being an implementation... - -class C { - int i; -}; - -C a, b; - -int main() { - a = b; -} diff --git a/gcc/testsuite/g++.old-deja/g++.mike/opr-dot1.C b/gcc/testsuite/g++.old-deja/g++.mike/opr-dot1.C deleted file mode 100644 index acef6ad9c2b..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/opr-dot1.C +++ /dev/null @@ -1,22 +0,0 @@ -// Build don't link: - -typedef struct base1 { - int x; -} base1_t; - -typedef struct base2 { - int x; -} base2_t; - -class derived1 : public base1 { -}; - -class derived2 : public derived1, public base2 { -}; - -struct test { - derived2& fails; - void test1() { - fails.base1::x = 5; - } -}; diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p10148.C b/gcc/testsuite/g++.old-deja/g++.mike/p10148.C deleted file mode 100644 index 074724a5646..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/p10148.C +++ /dev/null @@ -1,33 +0,0 @@ -// prms-id: 10148 - -int fail = 1; -void ok() { fail = 0; } - -class TC { - int s_; -}; - -class TIRD { - public: - void (*itc)(); - TIRD() { itc = ok; } -}; - -class TCCB : public TC, public TIRD { -}; - -class TCRCB : public TCCB { -public: - virtual void eat (); -}; - -void TCRCB::eat () { - void *vp = (TIRD*)this->itc; - this->itc(); -} - -int main() { - TCRCB a; - a.eat(); - return fail; -} diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p10247.C b/gcc/testsuite/g++.old-deja/g++.mike/p10247.C deleted file mode 100644 index c69bc90afdf..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/p10247.C +++ /dev/null @@ -1,6 +0,0 @@ -// prms-id: 10247 - -class a { -public: - int operator++(int) { return operator()++ ; } // ERROR - -}; diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p10416.C b/gcc/testsuite/g++.old-deja/g++.mike/p10416.C deleted file mode 100644 index aa56b5ffc2a..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/p10416.C +++ /dev/null @@ -1,9 +0,0 @@ -// Build don't link: -// Special g++ Options: -fexceptions -// excess errors test - XFAIL a29k-*-* sparc64-*-elf sh-*-* arm-*-pe* -// prms-id: 10416 - -class not_ok { -public: - void f() throw(int) { } -}; diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p10511.C b/gcc/testsuite/g++.old-deja/g++.mike/p10511.C deleted file mode 100644 index b92b4f7d7fd..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/p10511.C +++ /dev/null @@ -1,15 +0,0 @@ -// Build don't link: -// prms-id: 10511 - -class S { -public: - enum E {a, b, c}; -}; - -class C { -public: - bool f (S::E()) { } - virtual void foo(); -}; - -void C::foo() { } diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p10769a.C b/gcc/testsuite/g++.old-deja/g++.mike/p10769a.C deleted file mode 100644 index f5ff345a3fd..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/p10769a.C +++ /dev/null @@ -1,45 +0,0 @@ -// Special g++ Options: -Wno-pmf-conversions -// prms-id: 10769 - -#define PMF2PF(PMF) ((void (*)())(PMF)) - -int ok = 0; - -class A { -public: - void f1a() { ok += 3; } - void f1b() { ok += 5; } - void f2a() { ok += 7; } // gets bogus error XFAIL *-*-* - void f2b() { } - const static void (*table[2][2])(); - void main(); -} a; - -const void (*A::table[2][2])() - = { { PMF2PF(&A::f1a), PMF2PF(&A::f1b) }, - { PMF2PF(&A::f2a), PMF2PF(&A::f1b) }, - }; - -void -dispatch (A *obj, int i, int j) -{ - (*(void (*)(A *))A::table[i][j])(obj); -} - -void A::main() { - dispatch (&a, 0, 0); - void (A::*mPtr)() = &A::f1a; - - (*(void (*)(A*))PMF2PF(mPtr))(&a); - (*(void (*)(A*))PMF2PF(f2a))(&a); // gets bogus error XFAIL *-*-* -} - -int main() { - a.A::main(); - dispatch (&a, 0, 1); - void (A::*mPtr)() = &A::f1b; - - (*(void (*)(A*))PMF2PF(a.*mPtr))(&a); - (*(void (*)(A*))PMF2PF(a.f2a))(&a); // gets bogus error XFAIL *-*-* - return ok != 3+3+5+5+7+7; -} diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p10769b.C b/gcc/testsuite/g++.old-deja/g++.mike/p10769b.C deleted file mode 100644 index c9f859d9319..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/p10769b.C +++ /dev/null @@ -1,25 +0,0 @@ -// Special g++ Options: -// prms-id: 10769 - -#define PMF2PF(PMF) ((void (*)())(PMF)) - -class A { -public: - void f1a() { } - void main(); -} a; - -class B { -public: - void bf1() { } -} b; - -void A::main() { - void (B::*mPtrB)(B*); - (*(void (*)(A*))PMF2PF(mPtrB))(&b); // ERROR - -} - -int main() { - void (A::*mPtr)() = &A::f1a; - (*(void (*)(A*))PMF2PF(mPtr))(&a); // ERROR - -} diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p10849a.C b/gcc/testsuite/g++.old-deja/g++.mike/p10849a.C deleted file mode 100644 index d6d46569b87..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/p10849a.C +++ /dev/null @@ -1,33 +0,0 @@ -// prms-id: 10849 - -struct A -{ - int comm; - A(int i) : comm(i) { } -}; - -struct S1 { char c1; }; - -struct B : public S1, public A -{ - B(int i) : A(i) { } -}; - -struct C : public A -{ - C(int i) : A(i) { } -}; - -struct D : public B, public C -{ - virtual int g() { - int D::*pmd = (int C::*)&C::comm; - return (this->*pmd) == 42; - } - D() : B(41), C(42) { } -} d; - -int main() { - if (! d.g()) - return 1; -} diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p10951.C b/gcc/testsuite/g++.old-deja/g++.mike/p10951.C deleted file mode 100644 index d53775fecc4..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/p10951.C +++ /dev/null @@ -1,21 +0,0 @@ -// Build don't link: -// prms-id: 10951 - -inline int m1(const int& a) { - return 1; -} - -template <class T> -class A { -public: - typedef int st; - - static int m2t() { - return m1(1); - } -}; - -A<int>::st i; -int m3() { - return A<int>::m2t(); -} diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p11012.C b/gcc/testsuite/g++.old-deja/g++.mike/p11012.C deleted file mode 100644 index aca77d42607..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/p11012.C +++ /dev/null @@ -1,14 +0,0 @@ -// Build don't link: -// Special g++ Options: -Wno-pmf-conversions -// prms-id: 11012 - -class Foo { -public: - int f(){} -}; - -void foo() { - void *p1 = &Foo::f; - const void *p2 = &Foo::f; - int (*p3)() = &Foo::f; -} diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p11110.C b/gcc/testsuite/g++.old-deja/g++.mike/p11110.C deleted file mode 100644 index 428486a5042..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/p11110.C +++ /dev/null @@ -1,20 +0,0 @@ -// prms-id: 11110 - -class data; - -class conatiner { -public: - virtual void* first (); - virtual data* contents (void* i); // ERROR - candidates -}; - -class user { -public: - data* data1 () const; -private: - conatiner& _c; -}; - -data* user::data1() const { - return (_c.contents (_c.first)); // ERROR - -} // ERROR - control reaches end diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p11116.C b/gcc/testsuite/g++.old-deja/g++.mike/p11116.C deleted file mode 100644 index 9beff46e827..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/p11116.C +++ /dev/null @@ -1,22 +0,0 @@ -// Build don't link: -// Special g++ Options: -Wno-pmf-conversions -// prms-id: 11116 - -class Bar { -public: - int f(int a) { val = a; return val; } -private: - int val; -}; - -typedef int (Bar::*BarPtr)(int); - -void foo() { - int a; - int (Bar::*bp)(int) = &Bar::f; - Bar bar; - int (*p)(void *, int); - - p = (int (*)(void*,int))((void (*)())((bp).__pfn_or_delta2.__pfn)); - a = (*p)(&bar, 4); -} diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p11142.C b/gcc/testsuite/g++.old-deja/g++.mike/p11142.C deleted file mode 100644 index a22ca45bbd7..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/p11142.C +++ /dev/null @@ -1,18 +0,0 @@ -// Build don't link: -// Special g++ Options: -fexceptions -O -g -// prms-id: 11142 - -class RWxmsg { -public: - RWxmsg(); - virtual ~RWxmsg(); -}; - -class RWTHRInternalError : public RWxmsg { -public: - virtual ~RWTHRInternalError() { } -}; - -void setCount(int count) { - throw RWTHRInternalError(); -} diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p11144.C b/gcc/testsuite/g++.old-deja/g++.mike/p11144.C deleted file mode 100644 index 98b9fb04ef9..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/p11144.C +++ /dev/null @@ -1,17 +0,0 @@ -// Special g++ Options: -O -// prms-id: 11144 - -class Id { -public: - int d_i; - Id(int i) : d_i(i) {} - int value() {return d_i;} -} id(1); - -Id foo() { return id; } - -int main() { - const Id &id1 = foo(); - const Id &id2 = foo(); - return &id1 == &id2; -} diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p11482.C b/gcc/testsuite/g++.old-deja/g++.mike/p11482.C deleted file mode 100644 index f03a4229eca..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/p11482.C +++ /dev/null @@ -1,10 +0,0 @@ -// Build don't link: -// prms-id: 11482 - -void *vp; - -enum E { bad, ok } e; - -void foo() { - e = (E)vp; // ERROR - -} diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p11667.C b/gcc/testsuite/g++.old-deja/g++.mike/p11667.C deleted file mode 100644 index 89ab3132f47..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/p11667.C +++ /dev/null @@ -1,62 +0,0 @@ -// Special g++ Options: -fexceptions -// excess errors test - XFAIL a29k-*-* sparc64-*-elf sh-*-* arm-*-pe**-* -// prms-id: 11667 - -extern "C" int printf(const char *,...); - -template < class T > -class LIST { -public: - - LIST() { nitems = 16; items = new T[nitems]; }; - - LIST(int u) { nitems = u; items = new T[nitems]; }; - - T& operator[](int i) const { - return items[i]; - } - - void grow(int n) { - T* newlist = new T[n]; - T* src = items; - T* dst = newlist; - int i = nitems; - - try { - while (i--) *dst++ = *src++; - } catch (...) { - delete[] newlist; - throw; - } - - if (items) delete[] items; - nitems = n; - items = newlist; - } - -private: - int nitems; - T *items; -}; - -int main(int argc, char **argv) { - int i; - LIST<int> mylist(10); - - printf("Start dumping initial 10 item list\n"); - for (i = 0; i < 10 ; i++) { - mylist[i] = i; - printf("%d\n", mylist[i]); - } - - printf("Growing list to 20\n"); - mylist.grow(20); - - printf("Start dumping grown 20 item list\n"); - for (i = 0; i < 20; i++) { - mylist[i] = i; - printf("%d\n", mylist[i]); - } - - return 0; -} diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p12306.C b/gcc/testsuite/g++.old-deja/g++.mike/p12306.C deleted file mode 100644 index 12b4a453b9a..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/p12306.C +++ /dev/null @@ -1,75 +0,0 @@ -// prms-id: 12306 - -void *ptr1, *ptr2; -int fail = 0; - -extern "C" int printf(const char *...); - -class RWSlist { }; - -class RWSlistIterator { -public: - RWSlist *slist; - RWSlistIterator(RWSlist& s) { } - void toLast() { - if (ptr1 != (RWSlistIterator*)this) - fail = 5; - if (ptr2 != &(*this).slist) - fail = 6; - - if (0) printf("at %x %x\n", (RWSlistIterator*)this, &(*this).slist); - } -}; - -class RWCollectable { -}; - -class RWSlistCollectables : public RWSlist { -public: - RWSlistCollectables() { } - RWSlistCollectables(RWCollectable* a) { } -}; - -class RWIterator { }; - -class RWSlistCollectablesIterator : public RWIterator, public RWSlistIterator { -public: - RWSlistCollectablesIterator(RWSlistCollectables& s) : RWSlistIterator(s) { } -}; - -class Sim_Event_Manager { -public: - RWSlistCollectables scheduled_events_; - RWSlistCollectablesIterator last_posted_event_position_; - Sim_Event_Manager(); - void post_event(); -}; - -Sim_Event_Manager::Sim_Event_Manager () - :last_posted_event_position_(scheduled_events_) -{ -} - -void Sim_Event_Manager::post_event () { - ptr1 = (RWSlistIterator*)&last_posted_event_position_; - ptr2 = &((RWSlistIterator*)&last_posted_event_position_)->slist; - if (0) printf("at %x %x\n", (RWSlistIterator*)&last_posted_event_position_, - &((RWSlistIterator*)&last_posted_event_position_)->slist); - if (ptr1 != (RWSlistIterator*)&last_posted_event_position_) - fail = 1; - if (ptr2 != &((RWSlistIterator&)last_posted_event_position_).slist) - fail = 2; - if (0) printf("at %x ?%x\n", (RWSlistIterator*)&last_posted_event_position_, - &((RWSlistIterator&)last_posted_event_position_).slist); - if (ptr1 != (RWSlistIterator*)&last_posted_event_position_) - fail = 3; - if (ptr2 != &((RWSlistIterator&)last_posted_event_position_).slist) - fail = 4; - last_posted_event_position_.toLast(); -} - -int main(int argc, char **argv) { - Sim_Event_Manager foo; - foo.post_event(); - return fail; -}; diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p12306a.C b/gcc/testsuite/g++.old-deja/g++.mike/p12306a.C deleted file mode 100644 index bbcade4f9be..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/p12306a.C +++ /dev/null @@ -1,35 +0,0 @@ -// prms-id: 12306 -// a net report of the same problem as 12306 - -class a { -public: - int i; -}; - -class g : virtual public a { -}; - -class b : virtual public a { - int j; -}; - -class c : public g, public b { -}; - -class d { -public: - virtual class b* get() {return 0;} -}; - -class f : public d { -public: - virtual class b* get() {return &_c;} - c _c; -}; - -int main(void) { - f D; - b* bp=D.get(); - D._c.i = 42; - return &D._c.i != &bp->i; -} diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p1248.C b/gcc/testsuite/g++.old-deja/g++.mike/p1248.C deleted file mode 100644 index 035e8e1828f..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/p1248.C +++ /dev/null @@ -1,28 +0,0 @@ -// GROUPS passed pure-virt -extern "C" { void printf(const char *, ...); } -class Base { -public: - virtual ~Base() =0; -}; - -class Deranged : public Base { -public: - int value; - virtual ~Deranged(); -}; - - -Deranged::~Deranged(){} - -void foo() { - Deranged d; -} - -int main() -{ - foo(); - printf("PASS\n"); - return 0; -} - -Base::~Base () { } diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p1567.C b/gcc/testsuite/g++.old-deja/g++.mike/p1567.C deleted file mode 100644 index 0b35bd972e0..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/p1567.C +++ /dev/null @@ -1,41 +0,0 @@ -// GROUPS passed vtable -extern "C" int printf (const char *, ...); -extern "C" void exit(int); - -class A { -public: - virtual const char* f1() { return "A::f1"; } - virtual const char* f2() { return "A::f2"; } - virtual const char* f3() { printf("FAIL\n"); exit(1); return "A::f3"; } -}; - -class B { -public: - virtual const char* f2() { return "B::f2"; } - virtual const char* f3() { return "B::f3"; } -}; - -class C: public A, public B { -public: - const char* f2() { return B::f2(); } - const char* f1() { return f2(); } - const char* f3() { return A::f3(); } -}; - -class D: public A, public B { -public: - const char* f2() { return B::f2(); } - const char* f1() { return D :: f2(); } - const char* f3() { return A::f3(); } -}; - -int main() { - C* tempC = new C; - D* tempD = new D; - A* a = tempC; - printf("calling f1 on a C gives %s\n", a->f1()); - a = tempD; - printf("calling f1 on a D gives %s\n", a->f1()); - printf("PASS\n"); - return 0; -} diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p16146.C b/gcc/testsuite/g++.old-deja/g++.mike/p16146.C deleted file mode 100644 index 070dc2ea4b8..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/p16146.C +++ /dev/null @@ -1,89 +0,0 @@ -// prms-id: 16146 - -extern "C" int printf (const char *, ...); - -class myFoundation { -protected: - myFoundation () { count = 0; }; - virtual ~myFoundation () {}; - -public: - void addRef () { ++count; } - void removeRef () { if (count > 0) --count; } - -private: - long count; -}; - - -class firstIntermediate :virtual public myFoundation { -public: - firstIntermediate () {}; - ~firstIntermediate () {}; - - void bar () { printf ("Bar\n"); } -}; - - -class firstBase : public firstIntermediate { -public: - firstBase () {}; - ~firstBase () {}; - - virtual void g () {}; -}; - - -class secondIntermediate : virtual public myFoundation { -public: - secondIntermediate () {}; - ~secondIntermediate () {}; - - virtual void h () {}; -}; - - -class secondBase : public secondIntermediate { -public: - secondBase () {}; - ~secondBase () {}; - - virtual void h () {}; -}; - - -class typeInterface : virtual public firstBase { -public: - typeInterface () {}; - ~typeInterface () {}; - - virtual void i () {}; -}; - -class classServices : virtual public firstBase, - public secondBase { -public: - classServices () {}; - ~classServices () {}; - - virtual void j () {}; -}; - -class classImplementation : public typeInterface, - public classServices { -public: - classImplementation () {}; - ~classImplementation () {}; - - void g () {}; - void h () {}; - void i () {}; - void j () {}; -}; - -int main () { - firstBase* fbp = new classImplementation; - classImplementation* cip = dynamic_cast <classImplementation*> (fbp); - cip->addRef(); - myFoundation* mfp = cip; -} diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p1862.C b/gcc/testsuite/g++.old-deja/g++.mike/p1862.C deleted file mode 100644 index 401b3700777..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/p1862.C +++ /dev/null @@ -1,62 +0,0 @@ -// GROUPS vtable -extern "C" int printf (const char *, ...); - -class A -{ -public: - virtual ~A(){}; - virtual int type(void) - { - return -1; - } -}; - -class B -{ -public: - virtual ~B(){}; -}; - - -class C0 : public B, public A -{ -public: - virtual int type(void) - { - return 0; - } -}; - -class C1 : public C0 -{ -public: - virtual int type(void) - { - return 1; - } -}; - -class C2 : public C0 -{ -public: - virtual int type(void) - { - return 2; - } -}; - -int main() -{ - C1 *one = new C1; - - if (one->type() == 1) - { - printf ("PASS\n"); - return 0; - } - else - { - printf ("FAIL\n"); - return 1; - } -} diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p1989.C b/gcc/testsuite/g++.old-deja/g++.mike/p1989.C deleted file mode 100644 index 7e1886922eb..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/p1989.C +++ /dev/null @@ -1,494 +0,0 @@ -// Build don't link: -// prms-id: 1989 - -#define TRUE true -#define FALSE false -typedef void *Pix; - -template<class T> -struct link { - T item; - link *next; - link *prev; - - link(const T& t): item(t), prev(0), next(0) - { }; - link(const T& t, link<T> *p, link<T> *n): item(t), prev(p), next(n) - { }; -}; - -template<class T> -class List_DL { -public: - List_DL(); - List_DL(const List_DL&); - ~List_DL(); - - void append(const T& item); - void prepend(const T& item); - void insert(const T& item, Pix x, bool before); - - void remove(Pix& x) - { T tmp; remove(x, tmp); } - void remove(Pix& x, T& item); - - void clear(); - - unsigned length() const - { return count; } - -private: - - unsigned count; - link<T> *head; - link<T> *tail; - -public: - Pix first() const - { return Pix(head); } - Pix last() const - { return Pix(tail); } - void next(Pix& x) const - { if (0 != x) x = ((link<T> *) x)->next; } - void prev(Pix& x) const - { if (0 != x) x = ((link<T> *) x)->prev; } - T& operator()(Pix x) const - { return ((link<T> *) x)->item; } -}; - -template<class T> -List_DL<T>::List_DL(): -count(0), -head(0) -{ } - -template<class T> -List_DL<T>::List_DL(const List_DL& other): -count(0), -head(0) -{ - for (Pix x=other.first(); 0 != x; other.next(x)) - append(other(x)); -} - -template<class T> -List_DL<T>::~List_DL() -{ - clear(); -} - -template<class T> -void -List_DL<T>::append(const T& item) -{ - count++; - if (0 == head) { - head = new link<T>(item); - tail = head; - } else { - tail->next = new link<T>(item, tail, 0); - tail = tail->next; - } -} - -template<class T> -void -List_DL<T>::prepend(const T& item) -{ - count++; - if (0 == head) { - head = new link<T>(item); - tail = head; - } else { - head = new link<T>(item, 0, head); - if (tail == head) - tail = tail->next; - } -} - -template<class T> -void -List_DL<T>::insert(const T& item, Pix x, bool before = TRUE) -{ - link<T> *l = (link<T> *) x; - - if (before) { - if (0 == l || l == head) { - prepend(item); - } else { - link<T> *n = new link<T>(item, l->prev, l); - l->prev->next = n; - l->prev = n; - } - } else { - if (0 == l || l == tail) { - append(item); - } else { - link<T> *n = new link<T>(item, l, l->next); - l->next->prev = n; - l->prev = n; - } - } -} - -template<class T> -void -List_DL<T>::remove(Pix& x, T& item) -{ - link<T> *l = (link<T> *) x; - - if (0 == l) - return; - - item = l->item; - if (1 == count) { - delete head; - head = 0; - tail = 0; - } else { - // more than one item in the list - if (l == head) { - link<T> *old = head; - head = head->next; - head->prev = 0; - delete old; - } else if (l == tail) { - link<T> *old = tail; - tail = tail->prev; - tail->next = 0; - delete old; - } else { - l->next->prev = l->prev; - l->prev->next = l->next; - delete l; - } - } -} - -template<class T> -void -List_DL<T>::clear() -{ - link<T> *l, *succ; - for (l=head; 0 != l; l=succ) { - succ = l->next; - delete l; - } - head = 0; - tail = 0; -} - -template<class T> -class List_DLS: public List_DL<T> { -public: - List_DLS(): List_DL<T>() - { }; - List_DLS(const List_DLS& other): List_DL<T>(other) - { }; - - bool contains(const T& item) const - { return search(item) != 0 ? TRUE: FALSE; } - Pix search(const T&) const; -}; - -template<class T> -Pix -List_DLS<T>::search(const T& item) const -{ - for (Pix x=first(); 0 != x; next(x)) { - if (item == operator()(x)) // ERROR - const subversion - return x; - } - return 0; -} - -template<class T> -class List_DLSp: public List_DL<T> { -public: - List_DLSp(): List_DL<T>() - { }; - List_DLSp(const List_DLSp& other): List_DL<T>(other) - { }; - - bool contains(const T& item) const -#ifndef INTERNAL_ERROR - ; -#else - { return search(item) != 0 ? TRUE: FALSE; } -#endif - Pix search(const T&) const; -}; - -template<class T> -bool -List_DLSp<T>::contains(const T& item) const -{ - for (Pix x=first(); 0 != x; next(x)) { - if (*item == *operator()(x)) - return TRUE; - } - return FALSE; -} - -template<class T> -class Set { -public: - Set(); - Set(const Set& other); - - virtual void add(const T& item); - - void remove(const T& item) - { Pix x = search(item); remove(x); } - void remove(Pix& x) - { T tmp; remove(x, tmp); } - virtual void remove(Pix& x, T& item); - - virtual void clear(); - - virtual bool contains(const T&) const; - virtual Pix search(const T&) const; - - virtual unsigned length() const; - - virtual Pix first() const; - virtual void next(Pix& x) const; - virtual T& operator()(Pix x) const; -}; - -template<class T> -Set<T>::Set() -{ } - -template<class T> -Set<T>::Set(const Set& other) -{ } - - -template<class T> -class Set_DL: public List_DLS<T> { -public: - Set_DL(); - Set_DL(const Set_DL& other); - - void add(const T& item) - { list.append(item); } - void remove(Pix& x, T& item) - { list.remove(x, item); } - - void clear() - { list.clear(); } - - bool contains(const T& item) const - { return list.contains(item); } - Pix search(const T& item) const - { return list.search(item); } - - unsigned length() const - { return list.length(); } - - Pix first() const - { return list.first(); } - void next(Pix& x) const - { list.next(x); } - T& operator()(Pix x) const - { return list(x); } -private: - List_DLS<T> list; -}; - -template<class T> -class Set_DLp: public List_DLSp<T> { -public: - Set_DLp(); - Set_DLp(const Set_DLp& other); - - void add(const T& item) - { list.append(item); } - void remove(Pix& x, T& item) - { list.remove(x, item); } - - void clear() - { list.clear(); } - - bool contains(const T& item) const - { return list.contains(item); } - Pix search(const T& item) const - { return list.search(item); } - - unsigned length() const - { return list.length(); } - - Pix first() const - { return list.first(); } - void next(Pix& x) const - { list.next(x); } - T& operator()(Pix x) const - { return list(x); } -private: - List_DLSp<T> list; -}; - -template<class T> -struct vertex { - T item; - List_DL<vertex<T> *> fanout; - - vertex(): item(), fanout() // gets bogus error - { }; - vertex(const T& i): item(), fanout() // gets bogus error - { }; -}; - -template<class T> -class Graph { -public: - Graph(); - Graph(const Graph&); - ~Graph(); - - void add(const T& from, const T& to); - bool contains(const T& from, const T& to) const; - - void clear() - { vertices.clear(); } - - unsigned lengthV() const - { return vertices.length(); } - - Pix firstV() const - { return vertices.first(); } - void nextV(Pix& x) const - { vertices.next(x); } - T& V(Pix x) const - { return vertices(x).item; } - - Pix firstV1(Pix vx) const; - void nextV1(Pix vx, Pix& x) const; - T& V1(Pix vx, Pix x) const; -private: - vertex<T> *lookup(const T& from) const; - vertex<T> *lookup_new(const T& from); - - List_DLS<vertex<T> > vertices; -}; - -template<class T> -Graph<T>::Graph(): -vertices() -{ } - -template<class T> -Graph<T>::Graph(const Graph& other): -vertices() -{ - for (Pix vx=firstV(); 0 != vx; nextV(vx)) { - for (Pix vx1=firstV1(vx); 0 != vx1; nextV1(vx, vx1)) { - add(V(vx), V1(vx, vx1)); - } - } -} - -template<class T> -Graph<T>::~Graph() -{ - clear(); -} - -template<class T> -void -Graph<T>::add(const T& from, const T& to) -{ - vertex<T> *fromv = lookup_new(from); - if (from == to) - return; - vertex<T> *tov = lookup_new(to); - fromv->fanout.append(tov); -} - -template<class T> -bool -Graph<T>::contains(const T& from, const T& to) const -{ - vertex<T> *fromv = lookup(from); - if (0 == fromv) - return FALSE; - - for (Pix x=fromv->fanout.first(); 0 != x; fromv->fanout.next(x)) { - if (fromv->fanout(x)->item == to) - return TRUE; - } - - return FALSE; -} - -template<class T> -vertex<T> * -Graph<T>::lookup(const T& from) const -{ - for (Pix x=vertices.first(); 0 != x; vertices.next(x)) { - if (vertices(x).item == from) - return &vertices(x); - } - return 0; -} - -template<class T> -vertex<T> * -Graph<T>::lookup_new(const T& from) -{ - vertex<T> *v = lookup(from); - if (0 == v) { - vertices.append(from); - return &vertices(vertices.last()); - } - return v; -} - -template<class T> -Pix -Graph<T>::firstV1(Pix vx) const -{ - vertex<T> *v = (vertex<T> *) vx; - return v->fanout.first(); -} - -template<class T> -void -Graph<T>::nextV1(Pix vx, Pix& x) const -{ - vertex<T> *v = (vertex<T> *) vx; - return v->fanout.next(x); -} - -template<class T> -T& -Graph<T>::V1(Pix vx, Pix x) const -{ - vertex<T> *v = (vertex<T> *) vx; - static T x1; - return x1; -} - -class STRLIdentifier; - -extern int x(List_DL<STRLIdentifier *>); -extern int x(List_DLS<STRLIdentifier *>); - -extern int x(Set<STRLIdentifier *>); -extern int x(Set_DL<STRLIdentifier *>); -extern int x(Set_DLp<STRLIdentifier *>); - -extern int x(Graph<STRLIdentifier *>); - -class STRLIdentifier { - char buf[10]; -}; - -extern int operator==(vertex<STRLIdentifier*>&, vertex<STRLIdentifier*>&); // ERROR - const subversion -extern int operator==(STRLIdentifier&, STRLIdentifier&); // ERROR - fn ref in err msg - -extern int x(List_DLSp<STRLIdentifier *>); - -template class Graph<STRLIdentifier *>; -template class List_DLS<vertex<STRLIdentifier *> >; diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p2394.C b/gcc/testsuite/g++.old-deja/g++.mike/p2394.C deleted file mode 100644 index ce335c40183..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/p2394.C +++ /dev/null @@ -1,36 +0,0 @@ -// prms-id: 2394 - -class Foo { - public: - int x; - int y; - Foo(int i, int j) { x = i; y = j; } -} foo(10, 11); - -class Wasted { int unsed; }; - -class Bar : Wasted, public Foo { -public: - Bar() : Foo(12, 13) { } -} bar; - -int -test0() { - int Foo::* pmi = &Foo::y; - return (int)(foo.*pmi); -} - -int -test1() { - int Foo::* pmi = &Foo::y; - return (int)(bar.*pmi); -} - -int -main() { - if (test0() != 11) - return 1; - if (test1() != 13) - return 2; - return 0; -} diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p2431.C b/gcc/testsuite/g++.old-deja/g++.mike/p2431.C deleted file mode 100644 index 17a76fa7c18..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/p2431.C +++ /dev/null @@ -1,23 +0,0 @@ -// Build don't link: -// GROUPS passed infinite_loop -class A -{ - public: - A(A &); // ERROR - candidates are -}; - -class B -{ - public: - operator A (); -}; - -class C -{ - public : - C() - { - B b; - A a = b;// ERROR - - } -}; diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p2573.C b/gcc/testsuite/g++.old-deja/g++.mike/p2573.C deleted file mode 100644 index 9e3ddeed9de..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/p2573.C +++ /dev/null @@ -1,14 +0,0 @@ -// prms-id: 2573 - -class X { -public: - int key(); - virtual int vkey(); - char *add(); -}; - -char *X::add() { - char *f1 = (char *) &key; // ERROR - - char *f2 = (char *) &vkey; // ERROR - - return f1; -} diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p2736.C b/gcc/testsuite/g++.old-deja/g++.mike/p2736.C deleted file mode 100644 index 7a0405196ec..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/p2736.C +++ /dev/null @@ -1,28 +0,0 @@ -// This is a poor test case, it is meant to ensure that function local -// statics are destroyed at the right time. See PR 2736 for details. -// prms-id: 2736 - -int count; - -struct A { - int which; - A(int i) :which(i) { - // printf("ctor %x\n", this); - } - ~A() { - // printf("dtor %x\n", this); - if (++count != which) - abort (); - } -}; - -void -foo() { - static A a(1); -} - -A a(2); - -int main() { - foo(); -} diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p2746.C b/gcc/testsuite/g++.old-deja/g++.mike/p2746.C deleted file mode 100644 index fdc37d137f7..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/p2746.C +++ /dev/null @@ -1,156 +0,0 @@ -// Build don't link: -// GROUPS passed scope pt -class Link { -public: - Link(); - Link(Link *); -private: - Link *next_; - -friend class IListBase; -friend class IListIterBase; -}; - -inline -Link::Link() : next_(0) -{ -} - -inline -Link::Link(Link *next) : next_(next) -{ -} - -class IListBase { -public: - IListBase(); - IListBase(Link *); - void append(Link *); - void insert(Link *); - Link *head(); - int empty(); - Link *get(); - void remove(Link *); -private: - Link *head_; -friend class IListIterBase; -}; - -inline -IListBase::IListBase() : head_(0) -{ -} - -inline -IListBase::IListBase(Link *head) : head_(head) -{ -} - -inline -void IListBase::insert(Link *p) -{ - p->next_ = head_; - head_ = p; -} - -inline -Link *IListBase::head() -{ - return head_; -} - -inline -int IListBase::empty() -{ - return head_ == 0; -} - -inline -Link *IListBase::get() -{ - Link *tem = head_; - head_ = head_->next_; - return tem; -} - -template<class T> class IListIter; - -template<class T> -class IList : private IListBase { -public: - IList() { } - IList(T *p) : IListBase(p) { } - ~IList(); - void append(T *p) { IListBase::append(p); } - void insert(T *p) { IListBase::insert(p); } - void remove(T *p) { IListBase::remove(p); } - T *head() { return (T *)IListBase::head(); } - T *get() { return (T *)IListBase::get(); } - IListBase::empty; -friend class IListIter<T>; -}; - -template<class T> -IList<T>::~IList() -{ - while (!empty()) - delete get(); -} - -class IListIterBase { -public: - IListIterBase(const IListBase &); - int done(); - Link *cur(); - void next(); -private: - Link *p_; -}; - -inline -IListIterBase::IListIterBase(const IListBase &list) : p_(list.head_) -{ -} - -inline -int IListIterBase::done() -{ - return p_ == 0; -} - -inline -Link *IListIterBase::cur() -{ - return p_; -} - -inline -void IListIterBase::next() -{ - p_ = p_->next_; -} - - -template<class T> -class IListIter : private IListIterBase { -public: - IListIter(const IList<T> &list) : IListIterBase(list) { } - T *cur() { return (T *)IListIterBase::cur(); } - IListIterBase::next; - IListIterBase::done; -}; - - -struct A { - IList<Link> list; - int x; - void foo(); -}; - - -void A::foo() -{ - for (IListIter<Link> iter(list); !iter.done(); iter.next()) - ; - x = 0; -} diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p2793.C b/gcc/testsuite/g++.old-deja/g++.mike/p2793.C deleted file mode 100644 index 73bf23f7349..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/p2793.C +++ /dev/null @@ -1,6 +0,0 @@ -// Build don't link: -// prms-id: 2793 - -void f(char&) { // ERROR - referenced by error below - f('c'); // ERROR - -} diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p2806.C b/gcc/testsuite/g++.old-deja/g++.mike/p2806.C deleted file mode 100644 index 401b5ecd488..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/p2806.C +++ /dev/null @@ -1,20 +0,0 @@ -// Build don't link: -// GROUPS passed -template<class T> -class List -{ - public: - List(); - void f() const; -}; - -template<class T> -void List<T>::f() const -{ -} - -void func() -{ - List<int> list; - list.f(); -} diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p2846.C b/gcc/testsuite/g++.old-deja/g++.mike/p2846.C deleted file mode 100644 index b9a44c43c1e..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/p2846.C +++ /dev/null @@ -1,55 +0,0 @@ -// prms-id: 2846 - -extern "C" int printf(const char *, ...); -extern "C" void exit(int); - -class A; -class B; - -class A { -public: - - A(void){} - A(const A&){} - A(const B&); - - virtual ~A(void){} - - virtual void print(void) const { - printf("A::print\n"); - printf("FAIL\n"); - exit(1); - } - B compute(void) const; -}; - -class B : private A { -friend class A; -public: - - virtual ~B(void){} - - void print(void) const { - printf("B::print\n"); - } - -private: - B(const A& x, int){} -}; - -A::A(const B& s) { - s.print(); -} - -B A::compute(void) const { - B sub(*this, 1); - return sub; -} - -int main () -{ - A titi; - A toto = titi.compute(); - printf("PASS\n"); - return 0; -} diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p2846a.C b/gcc/testsuite/g++.old-deja/g++.mike/p2846a.C deleted file mode 100644 index 8606e4233e8..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/p2846a.C +++ /dev/null @@ -1,34 +0,0 @@ -// Shows that problem of initializing one object's vtable pointer from -// another object's vtable pointer when doing a default copy of it -// and the vtable pointer involved is the main one. - -// Correct answer is B::print. -// g++ prints D::print, which is wrong. Cfront gets is right. - -// prms-id: 2846 - -extern "C" int printf(const char *, ...); -extern "C" void exit(int); - -class B { -public: - virtual void print(void) const { printf("B::print\n"); } -}; - -class D : public B { -public: - void print(void) const { printf("D::print\n"); exit(1); } - B compute(void) const; -}; - -B D::compute(void) const -{ - B sub(*(B*)this); - return sub; -} - -int main () { - D titi; - titi.compute().print(); - return 0; -} diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p2846b.C b/gcc/testsuite/g++.old-deja/g++.mike/p2846b.C deleted file mode 100644 index acba70d6e2a..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/p2846b.C +++ /dev/null @@ -1,52 +0,0 @@ -// Shows that problem of initializing one object's secondary base from -// another object via a user defined copy constructor for that base, -// the pointer for the secondary vtable is not set after implicit -// copying of the outer class, but rather has the pointer to the main -// vtable for the secondary base left over from the user defined copy -// constructor for that base. - -// Correct answer is B::beefy. -// g++ prints A::beefy, which is wrong. Cfront gets it right. - -// prms-id: 2846 - -extern "C" int printf(const char *, ...); -extern "C" void exit(int); - -class B; - -class A { - public: - - A(void){} - A(const A&){} - - virtual void print(void) const { } - B compute(void) const; -}; - -class C { -public: - C() { } - C(C& o) { } // with it, things are wrong, without it, they're ok - virtual void beefy(void) const { printf("A::beefy\n"); exit(1); } -}; - -class B : private A, public C { -public: - B(const A& x, int){} - void beefy(void) const { printf("B::beefy\n"); } -}; - -B A::compute(void) const -{ - B sub(*this, 1); - return sub; -} - -int main () -{ - A titi; - titi.compute().beefy(); - return 0; -} diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p2855.C b/gcc/testsuite/g++.old-deja/g++.mike/p2855.C deleted file mode 100644 index 9c99bd72835..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/p2855.C +++ /dev/null @@ -1,21 +0,0 @@ -// Build don't link: -// Special g++ Options: -Wcast-qual -// prms-id: 2855 - -class Ctest { -private: - char* data; -public: - operator const char *() const; -}; - -Ctest::operator const char *() const -{ - return data; -} -int main() -{ - Ctest obj; - char* temp = (char *)obj; // WARNING - - temp[0] = '\0'; -} diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p2960.C b/gcc/testsuite/g++.old-deja/g++.mike/p2960.C deleted file mode 100644 index 4206e75b3ee..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/p2960.C +++ /dev/null @@ -1,30 +0,0 @@ -// prms-id: 2960 - -extern "C" int printf(const char *, ...); - -class Test0 { -public: - virtual void f0() { } // works fine if this virtual removed -}; - -class Test1 : public Test0 { -public: - void f1() { f2(); } // generates bus error here - virtual void f2() { printf("Test1::f2\n"); } -}; - -class Test2 { -public: - virtual void f3() { } -}; - -class Test3 : public Test2, public Test1 { // works fine if Test1 first -public: - virtual ~Test3() { f1(); } // calling f2 directly works - virtual void f2() { printf("Test3::f2\n"); } -}; - -int main() { - Test3 t3; - return 0; -} diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p3041.C b/gcc/testsuite/g++.old-deja/g++.mike/p3041.C deleted file mode 100644 index fd83eaf7f2f..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/p3041.C +++ /dev/null @@ -1,33 +0,0 @@ -// prms-id: 3041 - -class A { -public: - A() { } - virtual void a() = 0; - static int b(A * p) { - p->a(); - return 1; - } -}; - -class B : virtual public A { -public: - B() { - static int installed = b(this); - } - void a() { } -}; - -class C : virtual public B { -public: - C() { - static int installed = b(this); - } - void a() { } -}; - -int main() -{ - C c; - return 0; -} diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p3060c.C b/gcc/testsuite/g++.old-deja/g++.mike/p3060c.C deleted file mode 100644 index e26b8024db6..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/p3060c.C +++ /dev/null @@ -1,23 +0,0 @@ -// A new problem with my pointer to member function work. -// Build don't link: -// prms-id: 3060 - -class Foo -{ - public: - int x; - int y; - Foo (int i, int j) { x = i; y = j; } - operator int (); -}; - -int Foo::operator int() { return x; } // WARNING - can't specify return type - -Foo foo(10, 11); - -int -main() -{ - int Foo::* pmi = &Foo::y; - return foo.*pmi; -} diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p3060d.C b/gcc/testsuite/g++.old-deja/g++.mike/p3060d.C deleted file mode 100644 index 5cf4fdd10d1..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/p3060d.C +++ /dev/null @@ -1,34 +0,0 @@ -// This is a test case to make sure the explicit cast on a pointer to -// a member function works ok. -// prms-id: 3060 - -extern "C" int printf(const char *, ...); - -class Object; - -typedef void (Object::*VoidObjMemberFunc)(Object *, ...); - -class Object { -public: - int foo; -}; - -class Clipper: public Object { -public: - int bar; - void Feedback(Object*, void*); -}; -void Clipper::Feedback(Object *tracker, void *ap) { - printf("Doing feedback\n"); -} - -void vfunc(VoidObjMemberFunc of, Object *op, void *v1) { - (op->*of)(op, v1); -} - -int main() { - Object o; - - vfunc((VoidObjMemberFunc)&Clipper::Feedback, &o, 0); - return 0; -} diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p3068.C b/gcc/testsuite/g++.old-deja/g++.mike/p3068.C deleted file mode 100644 index 2436c8b7fa2..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/p3068.C +++ /dev/null @@ -1,60 +0,0 @@ -// prms-id: 3068 - -extern "C" int printf(const char *, ...); -extern "C" void exit(int); - -class LB { -public: - virtual int test() { return 0; } - virtual ~LB() { } -protected: - LB() { } -}; - -class RRB { -public: - virtual ~RRB() { } - virtual void test2(int a) { } -}; - -class RR : public RRB { -public: - virtual ~RR() { } -}; - -class RL { -public: - virtual void real(int a) { - printf("RL::real\n"); - } -}; - - -class R : public RL, public RR { -public: - virtual void test3(int a) { } - virtual void test2(int a) { } -}; - -class L : public LB { -}; - -class C : public L, public R { -public: - C() { } - virtual ~C() { - printf("C::~C\n"); - exit(1); - } - virtual void real(int a) { - printf("RL::real\n"); - } -}; - -int main() { - C& bb = *new C; - R& mv = bb; - bb.real(0); - mv.real(0); - return 0; -} diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p3070.C b/gcc/testsuite/g++.old-deja/g++.mike/p3070.C deleted file mode 100644 index c9278736d2c..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/p3070.C +++ /dev/null @@ -1,32 +0,0 @@ -// Build don't link: -// Caused an Internal Compiler Error. Works now. -// prms-id: 3070 - -class Object { -public: - virtual ~Object() {} -}; - -class BaseView { -protected: - virtual void _forwardReceiveUpdate() = 0; -}; - - -class View : public BaseView { -public: - virtual ~View(); -}; - -class TestViewBaseUpdate { -protected: - virtual void _receiveUpdate(); -}; - -class TestViewBase : public TestViewBaseUpdate, private View { -}; - -class TestView : public Object, public TestViewBase { -protected: - virtual void _receiveUpdate(); -}; diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p3139.C b/gcc/testsuite/g++.old-deja/g++.mike/p3139.C deleted file mode 100644 index 192fa7251b5..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/p3139.C +++ /dev/null @@ -1,25 +0,0 @@ -// prms-id: 3139 - -extern "C" int printf(const char *, ...); - -class A { - public: - A() { } - virtual int a() = 0; -}; - -class B : virtual public A { - public: - virtual int a() = 0; -}; - -class C : public B { - public: - int a() { return 42; } -}; - -int main() { - B * b = new C; - printf("%d.\n", b->a()); - return 0; -} diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p3524a.C b/gcc/testsuite/g++.old-deja/g++.mike/p3524a.C deleted file mode 100644 index 0995f3530a8..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/p3524a.C +++ /dev/null @@ -1,25 +0,0 @@ -// Make sure we can initialize a reference to a templated type, that -// requires a conversion from a derived type to a base type. - -// Build don't link: -// prms-id: 3524 - -struct cc2Vector -{}; - -template <class T> -struct ccPair -{ - ccPair (const cc2Vector&); -}; - -struct ccLine : cc2Vector -{ - double distToPoint (const ccPair <float> &); -}; - -void foo () -{ - ccLine l2; - l2.distToPoint (l2); -} diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p3524b.C b/gcc/testsuite/g++.old-deja/g++.mike/p3524b.C deleted file mode 100644 index c645d4cdea4..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/p3524b.C +++ /dev/null @@ -1,21 +0,0 @@ -// Make sure we can cast to a templated type, that requires a conversion by -// constructor, from a derived type to a base type. - -// Build don't link: -// prms-id: 3524 - -template <class T> -struct ccPair { - ccPair () { } -}; - -template <class T> -struct ccO : ccPair<T> { - ccO () { } -}; - -void foo () -{ - ccO<float> r; - (ccPair<float>)r; -} diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p3524c.C b/gcc/testsuite/g++.old-deja/g++.mike/p3524c.C deleted file mode 100644 index d901e19a265..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/p3524c.C +++ /dev/null @@ -1,15 +0,0 @@ -// Make sure we can cast to a templated type, that requires a conversion by -// constructor, from a non-aggregate type. - -// Build don't link: -// prms-id: 3524 - -template <class T> -struct ccPair { - ccPair (int i) { } -}; - -void foo () -{ - (ccPair<float>)1; -} diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p3538a.C b/gcc/testsuite/g++.old-deja/g++.mike/p3538a.C deleted file mode 100644 index ea1a6cc53a7..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/p3538a.C +++ /dev/null @@ -1,33 +0,0 @@ -// Build don't link: -// This tests for the compiler_error in binfo_value. -// prms-id: 3538 - -class ccObjectInfo -{ -public: - virtual const ccObjectInfo& repInvariant (int); -}; - -template<class T> -class ccHandle : public ccObjectInfo -{ -protected: - T* p; -public: - virtual const ccObjectInfo& repInvariant (int); -}; - -template <class T> -const ccObjectInfo& ccHandle<T>::repInvariant (int) -{ return p->ri(1); } - -class ccHandleBase : public ccObjectInfo -{}; - -class cc_CircleHdl : public virtual ccHandleBase, public ccObjectInfo -{ -public: - virtual const ccObjectInfo& ri (int); -}; // WARNING - - -class ccCircleHdl : public ccHandle <cc_CircleHdl> {}; diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p3538b.C b/gcc/testsuite/g++.old-deja/g++.mike/p3538b.C deleted file mode 100644 index 4dcd60b3d10..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/p3538b.C +++ /dev/null @@ -1,35 +0,0 @@ -// Build don't link: -// prms-id: 3538 - -// This tests for an ambiguous conversion of the this pointer (going -// down to DECL_CONTEXT of a FUNCTION_DECL. - -class ccObjectInfo -{ -public: - virtual const ccObjectInfo& repInvariant (int); -}; - -template<class T> -class ccHandle : public ccObjectInfo -{ -protected: - T* p; -public: - virtual const ccObjectInfo& repInvariant (int); -}; - -template <class T> -const ccObjectInfo& ccHandle<T>::repInvariant (int) -{ return p->repInvariant(1); } - -class ccHandleBase : public ccObjectInfo -{}; - -class cc_CircleHdl : public virtual ccHandleBase, public ccObjectInfo -{ -public: - virtual const ccObjectInfo& repInvariant (int); -}; // WARNING - - -class ccCircleHdl : public ccHandle <cc_CircleHdl> {}; diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p3570.C b/gcc/testsuite/g++.old-deja/g++.mike/p3570.C deleted file mode 100644 index 1213a960b6e..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/p3570.C +++ /dev/null @@ -1,29 +0,0 @@ -// prms-id: 3570 - -extern "C" int printf(const char *, ...); - -struct A { - void print() {printf("A");}; -}; - -struct B : A { - typedef A superB; - void print() {superB::print(); printf("B");}; -}; - -struct C : B { - typedef B superC; - void print() {superC::print(); printf("C");}; -}; - -int main () -{ - A a; - B b; - C c; - - a.print(); printf("\n"); - b.print(); printf("\n"); - c.print(); printf("\n"); - return 0; -} diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p3579.C b/gcc/testsuite/g++.old-deja/g++.mike/p3579.C deleted file mode 100644 index d960599450f..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/p3579.C +++ /dev/null @@ -1,39 +0,0 @@ -// prms-id: 3579 - -extern "C" int printf(const char *, ...); - -int num_x; - -class Y { -public: - Y () { printf("Y() this: %x\n", this); } - ~Y () { printf("~Y() this: %x\n", this); } -}; - -class X { -public: - X () { - ++num_x; - printf("X() this: %x\n", this); - Y y; - *this = (X) y; - } - - X (const Y & yy) { printf("X(const Y&) this: %x\n", this); ++num_x; } - X & operator = (const X & xx) { - printf("X.op=(X&) this: %x\n", this); - return *this; - } - - ~X () { printf("~X() this: %x\n", this); --num_x; } -}; - -int main (int, char **) { - { X anX; } - if (num_x) { - printf("FAIL\n"); - return 1; - } - printf("PASS\n"); - return 0; -}; diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p3708.C b/gcc/testsuite/g++.old-deja/g++.mike/p3708.C deleted file mode 100644 index cda1108d629..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/p3708.C +++ /dev/null @@ -1,86 +0,0 @@ -// prms-id: 3708 - -extern "C" void printf (char *, ...); -extern "C" int atoi (char *); - -void *ptr; - -class A { -public: - A() { printf ("A is constructed.\n"); } - virtual void xx(int doit) { printf ("A is destructed.\n"); } -}; - -class A1 { -public: - A1() { printf ("A1 is constructed.\n"); } - virtual void xx(int doit) { printf ("A1 is destructed.\n"); } -}; - -class B : public virtual A, public A1 { -public: - B() { printf ("B is constructed.\n"); } - virtual void xx(int doit) { - printf ("B is destructed.\n"); - A1::xx (1); - if (doit) A::xx (1); - } -}; - -int num; - -class C : public virtual A, public B { -public: - C() { ++num; printf ("C is constructed.\n"); - ptr = this; - } - virtual void xx(int doit) { - --num; - if (ptr != this) - printf("FAIL\n%x != %x\n", ptr, this); - printf ("C is destructed.\n"); - B::xx (0); - if (doit) A::xx (1); - } -}; - -void fooA(A *a) { - printf ("Casting to A!\n"); - a->xx (1); -} -void fooA1(A1 *a) { - printf ("Casting to A1!\n"); - a->xx (1); -} - -void fooB(B *b) { - printf ("Casting to B!\n"); - b->xx (1); -} - -void fooC(C *c) { - printf ("Casting to C!\n"); - c->xx (1); -} - -int main(int argc, char *argv[]) { - printf ("*** Construct C object!\n"); - C *c = new C(); - - int i = 0; - - printf ("*** Try to delete the casting pointer!\n"); - switch (i) - { - case 0: fooA1(c); - break; - case 1: fooA(c); - break; - case 2: fooB(c); - break; - case 3: fooC(c); - break; - } - - return num!=0; -} diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p3708a.C b/gcc/testsuite/g++.old-deja/g++.mike/p3708a.C deleted file mode 100644 index 03fd1a18c74..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/p3708a.C +++ /dev/null @@ -1,86 +0,0 @@ -// prms-id: 3708 - -extern "C" void printf (char *, ...); -extern "C" int atoi (char *); - -void *ptr; - -class A { -public: - A() { printf ("A is constructed.\n"); } - virtual void xx(int doit) { printf ("A is destructed.\n"); } -}; - -class A1 { -public: - A1() { printf ("A1 is constructed.\n"); } - virtual void xx(int doit) { printf ("A1 is destructed.\n"); } -}; - -class B : public A1, public virtual A { -public: - B() { printf ("B is constructed.\n"); } - virtual void xx(int doit) { - printf ("B is destructed.\n"); - A1::xx (1); - if (doit) A::xx (1); - } -}; - -int num; - -class C : public virtual A, public B { -public: - C() { ++num; printf ("C is constructed.\n"); - ptr = this; - } - virtual void xx(int doit) { - --num; - if (ptr != this) - printf("FAIL\n%x != %x\n", ptr, this); - printf ("C is destructed.\n"); - B::xx (0); - if (doit) A::xx (1); - } -}; - -void fooA(A *a) { - printf ("Casting to A!\n"); - a->xx (1); -} -void fooA1(A1 *a) { - printf ("Casting to A1!\n"); - a->xx (1); -} - -void fooB(B *b) { - printf ("Casting to B!\n"); - b->xx (1); -} - -void fooC(C *c) { - printf ("Casting to C!\n"); - c->xx (1); -} - -int main(int argc, char *argv[]) { - printf ("*** Construct C object!\n"); - C *c = new C(); - - int i = 0; - - printf ("*** Try to delete the casting pointer!\n"); - switch (i) - { - case 0: fooA1(c); - break; - case 1: fooA(c); - break; - case 2: fooB(c); - break; - case 3: fooC(c); - break; - } - - return num!=0; -} diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p3708b.C b/gcc/testsuite/g++.old-deja/g++.mike/p3708b.C deleted file mode 100644 index 42510074be3..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/p3708b.C +++ /dev/null @@ -1,85 +0,0 @@ -// prms-id: 3708 - -extern "C" void printf (char *, ...); -extern "C" void exit(int); - -void *ptr; - -class A { -public: - A() { printf ("A is constructed.\n"); } - virtual void xx(int doit) { printf ("A is destructed.\n"); } -}; - -class A1 { -public: - A1() { printf ("A1 is constructed.\n"); } - virtual void xx(int doit) { printf ("A1 is destructed.\n"); } -}; - -class B : public virtual A, public A1 { -public: - B() { printf ("B is constructed.\n"); } - virtual void xx(int doit) { - printf ("B is destructed.\n"); - A1::xx (1); - if (doit) A::xx (1); - } -}; - -int num; - -class C : public virtual A { -public: - C() { printf ("C is constructed.\n"); - } - virtual void xx(int doit) { - printf ("C is destructed.\n"); - if (doit) A::xx (1); - } -}; - -class D : public C, public B { -public: - D() { ++num; printf ("D is constructed.\n"); - ptr = this; - } - virtual void xx(int doit) { - --num; - if (ptr != this) { - printf("FAIL\n%x != %x\n", ptr, this); - exit(1); - } - printf ("D is destructed.\n"); - C::xx (0); - B::xx (0); - } -}; - -void fooA(A *a) { - printf ("Casting to A!\n"); - a->xx (1); -} -void fooA1(A1 *a) { - printf ("Casting to A1!\n"); - a->xx (1); -} - -void fooB(B *b) { - printf ("Casting to B!\n"); - b->xx (1); -} - -void fooC(C *c) { - printf ("Casting to C!\n"); - c->xx (1); -} - -int main(int argc, char *argv[]) { - printf ("*** Construct D object!\n"); - D *d = new D(); - - printf ("*** Try to delete the casting pointer!\n"); - fooA1(d); - return num!=0; -} diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p3764.C b/gcc/testsuite/g++.old-deja/g++.mike/p3764.C deleted file mode 100644 index d0527555563..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/p3764.C +++ /dev/null @@ -1,25 +0,0 @@ -// Build don't link: -// prms-id: 3764 - -class Menu; -class MenuItem; - -class MenuAction { -public: - virtual void execute (Menu& menu, MenuItem& menuItem) = 0; -protected: - MenuAction () {} -}; - -class Test { - class MenuCBA : public MenuAction { - public: - typedef void (Test::* MenuCBA_Member) (Menu& menu, MenuItem& menuItem) ; - MenuCBA(Test& instance, MenuCBA_Member member) - : _instance(&instance), _member(member) { } - void execute(Menu& menu, MenuItem& menuItem); - private: - MenuCBA_Member _member; - Test *_instance; - }; -}; diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p3836.C b/gcc/testsuite/g++.old-deja/g++.mike/p3836.C deleted file mode 100644 index c62530f6906..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/p3836.C +++ /dev/null @@ -1,14 +0,0 @@ -// prms-id: 3836 - -void f(int &i) { // ERROR - ref line - i = 10; -} - -int main() -{ - int i=1, j=2; - f(i); - f((int)j); // ERROR - passing in to non-const - if (j != 2) - return 1; -} diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p4068.C b/gcc/testsuite/g++.old-deja/g++.mike/p4068.C deleted file mode 100644 index fbdf02e2a9e..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/p4068.C +++ /dev/null @@ -1,22 +0,0 @@ -// prms-id: 4068 - -struct A { - A(); - typedef void (A::*F)(); - void d(); - void foo() { } - F& f() { return f_; } - F f_; -}; - -A::A() : f_(&A::foo) { -} - -void A::d() { - (this->*(f()))(); -} - -int main() { - A a; - a.d(); -} diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p4104.C b/gcc/testsuite/g++.old-deja/g++.mike/p4104.C deleted file mode 100644 index 7559034779a..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/p4104.C +++ /dev/null @@ -1,15 +0,0 @@ -// prms-id: 4104 - -template <class T> -void F(T &a, void (*P)(T &temp)) { - (*P)(a); -} - -template <class T> -void G(T &a) { -} - -int main() { - int a; - F(a, G); -} diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p4173.C b/gcc/testsuite/g++.old-deja/g++.mike/p4173.C deleted file mode 100644 index 7d07ffd26b5..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/p4173.C +++ /dev/null @@ -1,26 +0,0 @@ -// This error happens because lvalue is not done well in the C++ front-end. -// NOPs should be lvalues if their arguments are. -// NON_LVALUE_EXPRs shouldn't be. - -// Special g++ Options: -Wall -ansi -pedantic-errors -// Build don't link: -// prms-id: 4173 - -enum TypeKind { - RecordTypeKind -}; -struct Type -{ - enum TypeKind kind : 8; - unsigned char prefixLen; -}; - -Type a; -Type b; -TypeKind c; - -int -main() { - a.kind = b.kind = c; - (a.kind = c) = b.kind; // gets bogus error -} diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p418.C b/gcc/testsuite/g++.old-deja/g++.mike/p418.C deleted file mode 100644 index 6e868c7ec0d..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/p418.C +++ /dev/null @@ -1,18 +0,0 @@ -// Build don't link: -// prms-id: 418 - -class Base { -public: - int foo; -}; - -class Derived : public Base { -public: - int bar; -}; - -void func(Base&); // ERROR - referenced by error below - -void func2(const Derived& d) { - func(d); // ERROR - should be error because of const -} diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p4238.C b/gcc/testsuite/g++.old-deja/g++.mike/p4238.C deleted file mode 100644 index 2499a6d4015..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/p4238.C +++ /dev/null @@ -1,7 +0,0 @@ -// This showed a problem with default op= -// Build don't link: -// prms-id: 4238 - -struct sigcontext { - int sc_wbuf[31][25]; -}; // gets bogus error - default op= seems broken diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p4246.C b/gcc/testsuite/g++.old-deja/g++.mike/p4246.C deleted file mode 100644 index a610f70717b..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/p4246.C +++ /dev/null @@ -1,48 +0,0 @@ -// prms-id: 4246 - -extern "C" void abort (); -int num_d; - -class A -{ - public: - A() { } - virtual ~A() { } - virtual void id() { } -}; - -class B -{ - public: - B() { } - virtual ~B() { } - virtual void id() { } -}; - -class C : public A, public B -{ - public: - C() { } - virtual ~C() { } - void id() { abort(); } -}; - -class D : public C -{ - public: - D() { ++num_d; } - virtual ~D() { -- num_d; } - void id() { } -}; - -int main() -{ - D* dp2 = new D; - ((B*)dp2)->id(); - delete (B*) dp2; - - B* bp1 = new D; - bp1->id(); - delete bp1; - return num_d != 0; -} diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p4263.C b/gcc/testsuite/g++.old-deja/g++.mike/p4263.C deleted file mode 100644 index 65d5150c751..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/p4263.C +++ /dev/null @@ -1,14 +0,0 @@ -// prms-id: 4263 - -enum OT {A_type, B_Type}; -enum AT {A, B}; - -/* These are not ok. */ -OT t = A; // ERROR - -OT e2 = 1; // ERROR - -OT e3 = 1.1; // ERROR - - -/* These are ok. */ -int i = A; -double d = A; -OT e4 = A_type; diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p438.C b/gcc/testsuite/g++.old-deja/g++.mike/p438.C deleted file mode 100644 index 9afab638abc..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/p438.C +++ /dev/null @@ -1,23 +0,0 @@ -// Build don't link: -// prms-id: 438 - -class D; - -class C -{ - public: - void test() const; -}; - -class D -{ - public: - void a(C& b); // ERROR - referenced below -}; - -void C::test() const -{ - D d; - - d.a(*this); // ERROR - *this is const, so should get error -} diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p4484.C b/gcc/testsuite/g++.old-deja/g++.mike/p4484.C deleted file mode 100644 index 64aab160965..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/p4484.C +++ /dev/null @@ -1,26 +0,0 @@ -// Build don't link: -// prms-id: 4484 - -class A { - char buf[64]; -}; - -typedef void (A::*pmf)(); -typedef void (A::*pmfc)() const; - -pmfc p = (pmfc)(pmf)0; - -class B { -}; - -class D : public A, public B { -}; - -typedef int (B::*bmfp)(); -typedef int (D::*dmfp)(); - -bmfp foo; - -void bar(dmfp a) { - bar(foo); -} diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p4511.C b/gcc/testsuite/g++.old-deja/g++.mike/p4511.C deleted file mode 100644 index e8555da88d7..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/p4511.C +++ /dev/null @@ -1,33 +0,0 @@ -// prms-id: 4511 - -int bad; - -class A { -public: - virtual void dummy (){}; -}; - -class B { -public: - virtual void f(void) = 0; -}; - -class C : public A, public B { -public: - void f(void) { bad=1; }; -}; - -class D : public C { -public: - void f(void) { }; -}; - -class E : public D { }; - -int main() { - E e; - e.f(); - E * ep = &e; - ep->f(); - return bad; -} diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p4619.C b/gcc/testsuite/g++.old-deja/g++.mike/p4619.C deleted file mode 100644 index 8b772581c66..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/p4619.C +++ /dev/null @@ -1,10 +0,0 @@ -// Build don't link: -// prms-id: 4619 - -int main() { - int i = 3; - int (*p)[10] = new int [20][10]; - int (*p1)[5][7][13][10] = new int [i][5][7][13][10]; - delete [] p1; - delete [] p; -} diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p4623.C b/gcc/testsuite/g++.old-deja/g++.mike/p4623.C deleted file mode 100644 index 00ab5761116..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/p4623.C +++ /dev/null @@ -1,35 +0,0 @@ -// prms-id: 4623 - -class base { -public: - int b_data; - base( int i=0 ) { b_data = i; } - void b_print() { } -}; - -class base1: virtual public base { -public: - int b1_data; - base1( int i = 0 ) { b1_data = i; b_data++; } - void b1_print() { } -}; - -class base2: virtual public base { -public: - int b2_data; - base2( int i = 0 ) { b2_data = i; b_data++; } - void b2_print() { } -}; - -class base3: public base {}; - -class derived: public base3, public base1, public base2 { -public: - int d_data; - derived( int i ) { d_data = i; base3::b_data++; } - void d_print() { } -}; - -int main() { - derived d(1); d.d_print(); return 0; -} diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p4667.C b/gcc/testsuite/g++.old-deja/g++.mike/p4667.C deleted file mode 100644 index 751a5666103..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/p4667.C +++ /dev/null @@ -1,31 +0,0 @@ -// prms-id: 4667 - -int counter = 0; -int a = 0; -int b = 0; -int c = 0; - -struct A { - A() { a = counter++; } -}; - -struct B { - B() { b = counter++; } -}; - -struct C : public virtual B { - C() { c = counter++; } -}; - -struct D : public virtual A, public virtual C { }; - -extern "C" int printf(const char*,...); -int main(void) { - D d; - - if (!(a == 0 && b == 1 && c == 2)) { - return 1; - } - - return 0; -} diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p4671.C b/gcc/testsuite/g++.old-deja/g++.mike/p4671.C deleted file mode 100644 index 68f3ee16c0c..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/p4671.C +++ /dev/null @@ -1,16 +0,0 @@ -// Build don't link: -// prms-id: 4671 - -class ccUnwind { -public: - virtual void _c_getInfo() const; - virtual ~ccUnwind (); -}; -class ccTransmittable { -public: - virtual ~ccTransmittable(); -}; -class ccCommand : public ccUnwind, public ccTransmittable { -}; -class foo : public ccCommand { -}; diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p4677.C b/gcc/testsuite/g++.old-deja/g++.mike/p4677.C deleted file mode 100644 index 463033caec3..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/p4677.C +++ /dev/null @@ -1,9 +0,0 @@ -// Build don't link: -// prms-id: 4677 - -struct A { - A(double d) { } -}; - -struct B { B(A) { } } bad = 1; // ERROR - -B good (1); diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p4693.C b/gcc/testsuite/g++.old-deja/g++.mike/p4693.C deleted file mode 100644 index b0d0d88fad3..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/p4693.C +++ /dev/null @@ -1,24 +0,0 @@ -// Build don't link: -// prms-id: 4693 - -class a { -public: - virtual ~a(); -}; - -class b { -public: - virtual void set_var() = 0; -}; - -class c : public b, public a { }; - -class d : public c { -public: - void set_var() { } -}; - -int main() { - d * test; - test = new d; -} diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p4736a.C b/gcc/testsuite/g++.old-deja/g++.mike/p4736a.C deleted file mode 100644 index a6e3aef88e7..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/p4736a.C +++ /dev/null @@ -1,39 +0,0 @@ -// prms-id: 4736 - -int did_fail = 1; - -class O { -public: - virtual void of() { } -}; - -class A : public O { -public: - virtual void vf() { } -}; - -class W { -public: - virtual void vf() { } -}; - -class X : public W, public A { -public: - virtual void vf() { } -}; - -class Z : public X { -public: - virtual void vf() { did_fail = 0; } -}; - -Z sz; - -void fail1(W* w) { - w->vf(); -} - -int main() { - fail1 (&sz); - return did_fail; -} diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p4736b.C b/gcc/testsuite/g++.old-deja/g++.mike/p4736b.C deleted file mode 100644 index 0978f0bb63b..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/p4736b.C +++ /dev/null @@ -1,48 +0,0 @@ -// prms-id: 4736 - -class Rep { -public: - virtual int foo() { return 1; } -}; - -class Rep_1 : public Rep { -}; - -class VBaseMain { -public: - virtual int foo() { return 2; } -}; - -class OtherVBase { -public: - virtual int foo() { return 3; } -}; - -class Rep_2 : public Rep { -}; - -class DVBase : public VBaseMain, public Rep_2, public OtherVBase { -public: - virtual int foo() { return 4; } -}; - -class Main : public Rep_1, virtual public DVBase { -public: - virtual int foo() { return 5; } -}; - -int main() { - Main m; - if (m.foo() != 5) - return 1; - if (((Rep*)(Rep_1*)&m)->foo() != 5) - return 2; - if (((DVBase*)&m)->foo() != 5) - return 3; - if (((VBaseMain*)(DVBase*)&m)->foo() != 5) - return 4; - if (((Rep*)(Rep_2*)(DVBase*)&m)->foo() != 5) - return 5; - if (((OtherVBase*)(DVBase*)&m)->foo() != 5) - return 6; -} diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p4736c.C b/gcc/testsuite/g++.old-deja/g++.mike/p4736c.C deleted file mode 100644 index f76b06af1cd..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/p4736c.C +++ /dev/null @@ -1,62 +0,0 @@ -// prms-id: 4736 - -int did_fail; - -class Rep { -public: - virtual ~Rep() { } -}; - -class Rep_1 : public Rep { -}; - -class VBaseMain { -public: - virtual ~VBaseMain() { } -}; - -class OtherVBase { -public: - virtual ~OtherVBase() { } -}; - -class Rep_2 : public Rep { -}; - -class DVBase : public VBaseMain, public Rep_2, public OtherVBase { -public: - virtual ~DVBase() { } -}; - -class Main : public Rep_1, virtual public DVBase { -public: - virtual ~Main() { did_fail = 0; } -}; - -int main() { - Main* m; - did_fail = 1; - delete new Main; - if (did_fail) - return 1; - did_fail = 1; - delete (Rep*)(Rep_1*)new Main; - if (did_fail) - return 2; - did_fail = 1; - delete (DVBase*)new Main; - if (did_fail) - return 3; - did_fail = 1; - delete (VBaseMain*)(DVBase*)new Main; - if (did_fail) - return 4; - did_fail = 1; - delete (Rep*)(Rep_2*)(DVBase*)new Main; - if (did_fail) - return 5; - did_fail = 1; - delete (OtherVBase*)(DVBase*)new Main; - if (did_fail) - return 6; -} diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p4750.C b/gcc/testsuite/g++.old-deja/g++.mike/p4750.C deleted file mode 100644 index b404cc05ff4..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/p4750.C +++ /dev/null @@ -1,11 +0,0 @@ -// Build don't link: -// Skip if not native -// Special g++ Options: -fpic -pedantic-errors -S -// prms-id: 4750 - -extern const int FRAME_VEC_MAX; - -const int FRAME_VEC_MAX = 12; -int frame_vec_sizes[FRAME_VEC_MAX+1] = { - 0, 1, 3, 3, 6, 6, 6, 9, 9, 9, 12, 12, 12 -}; diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p5469.C b/gcc/testsuite/g++.old-deja/g++.mike/p5469.C deleted file mode 100644 index 9af20101171..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/p5469.C +++ /dev/null @@ -1,21 +0,0 @@ -// prms-id: 5469 - -int count; - -class A { - A(); - A(const A&); -public: - A(int) { ++count; } - ~A() { --count; } - int operator== (const A& r) { return 0; } -}; - -int main() { - { - A a (1); - if (a == 2 && a == 1) - ; - } - return count; -} diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p5469a.C b/gcc/testsuite/g++.old-deja/g++.mike/p5469a.C deleted file mode 100644 index 0783f77dffe..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/p5469a.C +++ /dev/null @@ -1,21 +0,0 @@ -// prms-id: 5469 - -int count; - -class A { - A(); - A(const A&); -public: - A(int) { ++count; } - ~A() { --count; } - int operator== (const A& r) { return 1; } -}; - -int main() { - { - A a (1); - if (a == 2 || a == 1) - ; - } - return count; -} diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p5571.C b/gcc/testsuite/g++.old-deja/g++.mike/p5571.C deleted file mode 100644 index ec350eacb3a..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/p5571.C +++ /dev/null @@ -1,70 +0,0 @@ -// prms-id: 5571 - -int err = 0; -void *vp = 0; - -class ParentOne { -public: - ParentOne() {}; -#ifdef MAKE_WORK - virtual ~ParentOne() {}; -#endif -private: - char SomeData[101]; -}; - -class ParentTwo { -public: - ParentTwo() {}; - virtual ~ParentTwo() {}; -private: - int MoreData[12]; - virtual int foo() { return 0; } -}; - -struct Child : public ParentOne, public ParentTwo { - int ChildsToy; - virtual void PrintThis() = 0; -}; - -struct Student : public Child { - int StudentsBook; - void PrintThis() { - if (vp == 0) - vp = (void *)this; - else - { - if (vp != (void *)this) - ++err; - } - } - void LocalPrintThis() { - if (vp == 0) - vp = (void *)this; - else - { - if (vp != (void *)this) - ++err; - } - PrintThis(); - } - void ForcedPrintThis() { - if (vp == 0) - vp = (void *)this; - else - { - if (vp != (void *)this) - ++err; - } - Student::PrintThis(); - } -}; - -int main() { - Student o; - o.LocalPrintThis(); - o.ForcedPrintThis(); - Child* pX = &o; - pX->PrintThis(); - return err; -} diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p5611.C b/gcc/testsuite/g++.old-deja/g++.mike/p5611.C deleted file mode 100644 index 557d2cc2baf..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/p5611.C +++ /dev/null @@ -1,11 +0,0 @@ -// prms-id: 5611 - -int main(void) -{ - struct B - { - virtual void b1() { }; - }; - - return 0; -} diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p5673.C b/gcc/testsuite/g++.old-deja/g++.mike/p5673.C deleted file mode 100644 index d972ab0ceeb..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/p5673.C +++ /dev/null @@ -1,20 +0,0 @@ -// prms-id: 5673 - -class A { -public: - operator int () { - return 7; - } - ~A(); -}; - -int foo() { - return A(); -} - -int main() { - return foo() != 7; -} - -A::~A() { -} diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p5718.C b/gcc/testsuite/g++.old-deja/g++.mike/p5718.C deleted file mode 100644 index 8858d389ef7..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/p5718.C +++ /dev/null @@ -1,37 +0,0 @@ -// prms-id: 5718 - -class Base { - int i; -public: - Base() { i = 42; }; -}; - - -class Mixin { - int j; -public: - Mixin() { j = 42; } -}; - - -class Derived : public Base, public Mixin { -public: - Derived() { }; - Derived & operator=(Mixin & m) { return *this; }; -}; - - -void -testFunct(Derived * arg) { - Mixin temp; - - (Mixin &)(*arg) = temp; // gets bogus error -} - - -int -main(int argc, char *argv[]) { - Derived temp; - - testFunct(&temp); -} diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p5793.C b/gcc/testsuite/g++.old-deja/g++.mike/p5793.C deleted file mode 100644 index 53469cdf07a..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/p5793.C +++ /dev/null @@ -1,21 +0,0 @@ -// Build don't link: -// prms-id: 5793 - -class temp_string { - public: - temp_string (const int); - temp_string (const char * const); -}; - -class Range { - public: - Range ( const int); - operator int () const ; -}; - -int operator == (const int, temp_string ); - -void CheckArrayConstraints(void) { - if (Range(0L) == 0L) - ; -} diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p5840.C b/gcc/testsuite/g++.old-deja/g++.mike/p5840.C deleted file mode 100644 index 34dd37df6c3..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/p5840.C +++ /dev/null @@ -1,35 +0,0 @@ -// prms-id: 5840 - -class Signal { -public: - int Name(void) { return 1; } -}; - -class Derived : public Signal { -public: - int Name(void) { return 2; } -}; - -template <class Foo , int (Foo::*Id)(void)> -class Bar -{ -public: - int value (Foo* a) { return (a->*Id)(); } -}; - -/* The following line is illegal under the new rules for non-type - template arguments in the standard, so it is commented out. */ -/* template class Bar <Derived, &Signal::Name>; */ -template class Bar <Signal, &Signal::Name>; -template class Bar <Derived, &Derived::Name>; - -Derived a; - -/* Bar<Derived, &Signal::Name> dispatcher1; */ -Bar<Derived, &Derived::Name> dispatcher2; - -int main() { - /* int i1 = dispatcher1.value(&a); */ - int i2 = dispatcher2.value(&a); - return /* i1 != 1 || */ i2 != 2; -} diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p5958.C b/gcc/testsuite/g++.old-deja/g++.mike/p5958.C deleted file mode 100644 index 20d45f264d0..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/p5958.C +++ /dev/null @@ -1,27 +0,0 @@ -// Special g++ Options: -ansi -// prms-id: 5958 - -class A { }; - -main() { - int i = 1; - if (1 not_eq 1) - return 1; - if (not (1 and 1)) - return 1; - if (not (1 or 1)) - return 1; - if (compl ~0) - return 1; - if (1 bitand 2) - return 1; - if (not (1 bitor 2)) - return 1; - if (1 xor 1) - return 1; - i and_eq 1; - i or_eq 2; - i xor_eq 4; - if (i not_eq 7) - return 1; -} diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p6004.C b/gcc/testsuite/g++.old-deja/g++.mike/p6004.C deleted file mode 100644 index b692365b12e..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/p6004.C +++ /dev/null @@ -1,20 +0,0 @@ -// Special g++ Options: -// prms-id: 6004 - -class A { -public: - static int foo() asm("_my_routine"); -}; - -int bar1() asm("foo__1A"); -int bar2() asm("_foo__1A"); -int bar3() asm("__foo__1A"); -int bar1() { return 45; } -int bar2() { return 44; } -int bar3() { return 43; } - -int A::foo() { return 42; } - -main() { - return A::foo() - 42; -} diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p6058.C b/gcc/testsuite/g++.old-deja/g++.mike/p6058.C deleted file mode 100644 index 1c0c6224ebc..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/p6058.C +++ /dev/null @@ -1,18 +0,0 @@ -// Build don't link: -// Special g++ Options: -fexceptions -pedantic-errors -// prms-id: 6058 - -void bar(struct s1 { } a) { (void)a; } // ERROR - - -struct s2*fooey() -{ - try { - static_cast<struct s3 { } *>(0); // ERROR - - const_cast<struct s4 { } *>((s4*)0); // ERROR - - reinterpret_cast<struct s5 { } *>((s3*)0); // ERROR - - dynamic_cast<struct s6 { } *>((s6*)0); // ERROR - - (struct s7 { } *)(int*)0xffedec; // ERROR - - } catch (struct s8 { } s) { // ERROR - - } - return 0; -} diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p6149.C b/gcc/testsuite/g++.old-deja/g++.mike/p6149.C deleted file mode 100644 index 578ee8b643c..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/p6149.C +++ /dev/null @@ -1,4 +0,0 @@ -// Build don't link: -// prms-id: 6149 - -int a[3 - sizeof(double)]; // ERROR - diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p6311.C b/gcc/testsuite/g++.old-deja/g++.mike/p6311.C deleted file mode 100644 index a0ef8c8c1fd..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/p6311.C +++ /dev/null @@ -1,16 +0,0 @@ -// prms-id: 6311 - -struct Foo { - int member; -} a = { 42 }, *ptra = &a; - -int Foo::*pmd = &Foo::member; - -int main() { - if (pmd == 0) - return 1; - if (a.*pmd != 42) - return 2; - if (ptra->*pmd != 42) - return 3; -} diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p646.C b/gcc/testsuite/g++.old-deja/g++.mike/p646.C deleted file mode 100644 index 2644c1b43df..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/p646.C +++ /dev/null @@ -1,175 +0,0 @@ -// GROUPS passed i960 -/* - Bug Id: bnr - PMRS Id: p0000646 - Bug is: Urgent Code Generation Problem in gcc-i960 V 1.95 -*/ - - -// Special g++ Options: - -extern "C" -{ - void printf (char *, ...); - void abort (); -} - -struct foo -{ - static int si; - int i; - foo (); - foo (const foo&); - ~foo (); -}; - -int -foo_parm_returns_i (foo foo_arg) -{ - return foo_arg.i; -} - -int foo::si = 0; - -foo::foo () -{ - si++; - printf ("new foo @ 0x%x; now %d foos\n", this, si); -} - -foo::foo (const foo &other) -{ - si++; - printf ("another foo @ 0x%x; now %d foos\n", this, si); - *this = other; -} - -foo::~foo () -{ - si--; - printf ("deleted foo @ 0x%x; now %d foos\n", this, si); -} - -int -return_1 () -{ - foo f; - printf ("returning 1\n"); - return 1; -} - -int -return_arg (int arg) -{ - foo f; - printf ("returning %d\n", arg); - return arg; -} - -int -return_sum (int x, int y) -{ - foo f; - printf ("returning %d+%d\n", x, y); - return x + y; -} - -foo -return_foo () -{ - foo f; - printf ("returning foo\n"); - return f; -} - -foo -return_named_foo () return f -{ - printf ("returning named foo\n"); - return f; -} - -foo -foo_parm_returns_foo (foo f) -{ - return f; -} - -void -abort_because (char *str) -{ - printf ("aborting because %s\n", str); - abort (); -} - -int -warn_return_1 () -{ - foo f; - printf ("returning 1\n"); -} - -int -warn_return_arg (int arg) -{ - foo f; - printf ("returning %d\n", arg); - arg; -} - -int -warn_return_sum (int x, int y) -{ - foo f; - printf ("returning %d+%d\n", x, y); - x + y; -} - -foo -warn_return_foo () -{ - foo f; - printf ("returning foo\n"); -} - -foo -nowarn_return_named_foo () return f -{ - printf ("returning named foo\n"); -} - -foo -warn_foo_parm_returns_foo (foo f) -{ - f; -} - -main () -{ - int ii = return_1 (); - if (ii != 1) - abort_because ("wrong value returned"); - int j = return_arg (42); - if (j != 42) - abort_because ("wrong value returned"); - int k = return_sum (-69, 69); - if (k != 0) - abort_because ("wrong value returned"); - foo f1 = return_named_foo (); - if (foo::si != 1) - abort_because ("wrong number of foos"); - f1.i = 5; - int l = foo_parm_returns_i (f1); - if (l != 5) - abort_because ("l != 5"); - foo f2 = foo_parm_returns_foo (f1); - if (foo::si != 2) - abort_because ("wrong number of foos"); - if (f2.i != 5) - abort_because ("f2.i != 5"); - foo f3 = return_foo (); - if (foo::si != 3) - abort_because ("wrong number of foos"); - printf("PASS\n"); - return 0; -} diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p6578.C b/gcc/testsuite/g++.old-deja/g++.mike/p6578.C deleted file mode 100644 index 2b19e86ddfb..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/p6578.C +++ /dev/null @@ -1,8 +0,0 @@ -// Build don't link: -// prms-id: 6578 - -struct A { - operator int (); -}; - -int i = A(); diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p658.C b/gcc/testsuite/g++.old-deja/g++.mike/p658.C deleted file mode 100644 index 14658f04956..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/p658.C +++ /dev/null @@ -1,101 +0,0 @@ -// prms-id: 658 - -#include <ostream.h> - -extern "C" void abort(); - -/* We may not find the libg++ <bool.h>. */ -#ifndef FALSE -#define FALSE false -#endif -#ifndef TRUE -#define TRUE true -#endif - -class Object { -public: - Object(); - Object(const Object&); - ~Object(); - - void OK() const; -private: - bool _destructed; -}; - -class Char: public Object { -public: - Char(); - Char(char); - Char(const Char&); - ~Char(); - - operator char () const; -private: - char _c; -}; - -int main() -{ - Char r, s; - - r = Char('r'); - s = Char('s'); -} - -// -// Object stuff -// -Object::Object(): -_destructed(FALSE) -{} - -Object::Object(const Object& other): -_destructed(FALSE) -{ - other.OK(); -} - -Object::~Object() -{ - OK(); - _destructed = TRUE; -} - -void -Object::OK() const -{ - if (_destructed) { - cerr << "FAILURE - reference was made to a destructed object\n"; - abort(); - } -} - -// -// Char stuff -// - -Char::Char(): -Object(), -_c('a') -{ } - -Char::Char(char c): -Object(), -_c(c) -{ } - -Char::Char(const Char& other): -Object(other), -_c(other._c) -{ } - -Char::~Char() -{ - OK(); -} - -Char::operator char () const -{ - return _c; -} diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p6610a.C b/gcc/testsuite/g++.old-deja/g++.mike/p6610a.C deleted file mode 100644 index b9ea4b769bb..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/p6610a.C +++ /dev/null @@ -1,14 +0,0 @@ -// prms-id: 6610 -// There is a bug in vtable thunks with multiple/virtual inheritance. -// execution test - XFAIL *-*-linux-gnu *-*-linux -int fail = 1; -struct B; -struct A { virtual int f(const B*) = 0; int g(const B*); }; -int A::g(const B* t) { return f(t); } -struct B : virtual A { B(); int f(const B*); B* B_this; }; -B::B() { if (g(this)) fail = 0; } -int B::f(const B* t) { return t == this; } -struct C : B { int f(const B*); int x; }; -int C::f(const B*) { return 0; } - -int main() { C c; return fail; } diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p6610b.C b/gcc/testsuite/g++.old-deja/g++.mike/p6610b.C deleted file mode 100644 index 8ec637eef02..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/p6610b.C +++ /dev/null @@ -1,14 +0,0 @@ -// prms-id: 6610 - -int fail = 1; -struct B; -struct A { virtual int f(const B*) = 0; int g(const B*); }; -int A::g(const B* t) { return f(t); } -struct B : virtual A { int f(const B*); B* B_this; }; -int B::f(const B* t) { return t == this; } -struct S1 { }; -struct C : virtual S1, virtual B, virtual A { C(); }; -C::C() { if (g(this)) fail = 0; } -struct D : virtual B, virtual A, C { }; - -int main() { D d; return fail; } diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p6611.C b/gcc/testsuite/g++.old-deja/g++.mike/p6611.C deleted file mode 100644 index 3d972cb8643..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/p6611.C +++ /dev/null @@ -1,26 +0,0 @@ -// prms-id: 6611 - -class COMPLEX { -public: - COMPLEX(double a, double b=0) { re = a; im = b; } - void print() const { } -private: - double re; - double im; -}; - -int main(void) -{ - COMPLEX a[3][3] = { - { 1, COMPLEX(2,3), COMPLEX(3,4), }, - { 1, COMPLEX(2,3), COMPLEX(3,4), }, - { 1, COMPLEX(2,3), COMPLEX(3,4), }, - }; - int i,j; - - for (i = 0; i < 3; i++) { - for (j = 0; j < 3; j++) { - a[i][j].print(); - } - } -} diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p6746.C b/gcc/testsuite/g++.old-deja/g++.mike/p6746.C deleted file mode 100644 index 764310fc05b..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/p6746.C +++ /dev/null @@ -1,18 +0,0 @@ -// Build don't link: -// prms-id: 6746 - -class call_trace { -public: - call_trace(char* fcn_name); - ~call_trace(); -}; - -static char * last_tree; -extern "C" void prt(); - -char * smt_mark_stree() { - char* _my_name = "smt_mark_stree" ; - call_trace _t(_my_name); - - return last_tree = 0 ? (char*)0 : (prt(), (char*)0); -} diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p6901.C b/gcc/testsuite/g++.old-deja/g++.mike/p6901.C deleted file mode 100644 index 83292949ca8..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/p6901.C +++ /dev/null @@ -1,7 +0,0 @@ -// Build don't link: -// prms-id: 6901 - -void green() { - for (int i = 0; i < 10; i++) {} - for (int i = 0; i < 10; i++) {} -} diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p6927.C b/gcc/testsuite/g++.old-deja/g++.mike/p6927.C deleted file mode 100644 index 7a0ec4229c7..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/p6927.C +++ /dev/null @@ -1,16 +0,0 @@ -// prms-id: 6927 - -class Object { -public: - Object(); - int Value; -}; - -Object::Object() : Value(-1) { } - -Object *pArr = new Object[2]; - -int main() { - if (pArr[0].Value != -1 || pArr[1].Value != -1) - return 1; -} diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p700.C b/gcc/testsuite/g++.old-deja/g++.mike/p700.C deleted file mode 100644 index 580895e557b..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/p700.C +++ /dev/null @@ -1,2387 +0,0 @@ -// Special g++ Options: -// prms-id: 700 - -//# 1 "../../../../libg++/etc/benchmarks/dhrystone.cc" - - - - - - - - - - - - - - - - - - - - - - - - - -//# 1 "../../../../libg++/etc/benchmarks/Int.h" 1 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -class Int -{ -protected: - int rep; - - - -public: - Int (); - Int (const int b); - Int (const Int& b); - ~Int(); - - operator int() const; - - inline virtual int val() const; - - inline virtual void operator = (const int); - inline virtual void operator = (const Int&); - - inline virtual void negate(); - inline virtual void complement(); - inline virtual void operator ++ (); - inline virtual void operator -- (); - - inline virtual void operator += (const Int & ); - inline virtual void operator -= (const Int & ); - inline virtual void operator *= (const Int & ); - inline virtual void operator /= (const Int & ); - inline virtual void operator %= (const Int & ); - inline virtual void operator |= (const Int & ); - inline virtual void operator &= (const Int & ); - inline virtual void operator ^= (const Int & ); - inline virtual void operator <<=(const Int & ); - inline virtual void operator >>=(const Int & ); - - - inline virtual void operator += (const int); - inline virtual void operator -= (const int); - inline virtual void operator *= (const int); - inline virtual void operator /= (const int); - inline virtual void operator %= (const int); - inline virtual void operator |= (const int); - inline virtual void operator &= (const int); - inline virtual void operator ^= (const int); - inline virtual void operator <<=(const int); - inline virtual void operator >>=(const int); - - -}; - -inline int Int::val() const { return rep; } -inline Int::operator int() const { return val(); } - -inline Int::Int () :rep(0) {} -inline Int::Int (const int b) :rep(b) {} -inline Int::Int (const Int& b) :rep(b.Int::val()) {} -inline Int::~Int() {} - -inline void Int::operator = (const int b) -{ rep = b; ; } -inline void Int::operator = (const Int& b) -{ rep = b.Int::val(); ; } - -inline void Int::complement() -{ rep = ~rep; ; } -inline void Int::negate() -{ rep = -rep; ; } -inline void Int::operator ++ () -{ ++rep; ; } -inline void Int::operator -- () -{ --rep; ; } - -inline void Int::operator += (const Int & b) -{ rep += b.Int::val(); ; } -inline void Int::operator -= (const Int & b) -{ rep -= b.Int::val(); ; } -inline void Int::operator *= (const Int & b) -{ rep *= b.Int::val(); ; } -inline void Int::operator /= (const Int & b) -{ rep /= b.Int::val(); ; } -inline void Int::operator %= (const Int & b) -{ rep %= b.Int::val(); ; } -inline void Int::operator |= (const Int & b) -{ rep |= b.Int::val(); ; } -inline void Int::operator &= (const Int & b) -{ rep &= b.Int::val(); ; } -inline void Int::operator ^= (const Int & b) -{ rep ^= b.Int::val(); ; } -inline void Int::operator <<=(const Int & b) -{ rep <<= b.Int::val(); ; } -inline void Int::operator >>=(const Int & b) -{ rep >>= b.Int::val(); ; } - - - -inline void Int::operator += (const int b) -{ rep += b; ; } -inline void Int::operator -= (const int b) -{ rep -= b; ; } -inline void Int::operator *= (const int b) -{ rep *= b; ; } -inline void Int::operator /= (const int b) -{ rep /= b; ; } -inline void Int::operator %= (const int b) -{ rep %= b; ; } -inline void Int::operator |= (const int b) -{ rep |= b; ; } -inline void Int::operator &= (const int b) -{ rep &= b; ; } -inline void Int::operator ^= (const int b) -{ rep ^= b; ; } -inline void Int::operator <<=(const int b) -{ rep <<= b; ; } -inline void Int::operator >>=(const int b) -{ rep >>= b; ; } - - -inline int& operator = (int& a, const Int & b) -{ a = b.Int::val(); return a;} // WARNING - -inline int& operator += (int& a, const Int & b) -{ a += b.Int::val(); return a; } -inline int& operator -= (int& a, const Int & b) -{ a -= b.Int::val(); return a;} -inline int& operator *= (int& a, const Int & b) -{ a *= b.Int::val(); return a;} -inline int& operator /= (int& a, const Int & b) -{ a /= b.Int::val(); return a;} -inline int& operator %= (int& a, const Int & b) -{ a %= b.Int::val(); return a;} -inline int& operator |= (int& a, const Int & b) -{ a |= b.Int::val(); return a;} -inline int& operator &= (int& a, const Int & b) -{ a &= b.Int::val(); return a;} -inline int& operator ^= (int& a, const Int & b) -{ a ^= b.Int::val(); return a;} -inline int& operator <<=(int& a, const Int & b) -{ a <<= b.Int::val(); return a;} -inline int& operator >>=(int& a, const Int & b) -{ a >>= b.Int::val(); return a;} - - - -//# 289 "../../../../libg++/etc/benchmarks/Int.h" - - -inline Int operator - (const Int & a) return r(a) -{ r.negate(); } -inline Int operator ~ (const Int & a) return r(a) -{ r.complement(); } - -inline Int operator + (const Int & a, const Int & b) return r(a) -{ r += b.Int::val(); } -inline Int operator - (const Int & a, const Int & b) return r(a) -{ r -= b.Int::val(); } -inline Int operator * (const Int & a, const Int & b) return r(a) -{ r *= b.Int::val(); } -inline Int operator / (const Int & a, const Int & b) return r(a) -{ r /= b.Int::val(); } -inline Int operator % (const Int & a, const Int & b) return r(a) -{ r %= b.Int::val(); } -inline Int operator << (const Int & a, const Int & b) return r(a) -{ r <<= b.Int::val(); } -inline Int operator >> (const Int & a, const Int & b) return r(a) -{ r >>= b.Int::val(); } -inline Int operator & (const Int & a, const Int & b) return r(a) -{ r &= b.Int::val(); } -inline Int operator | (const Int & a, const Int & b) return r(a) -{ r |= b.Int::val(); } -inline Int operator ^ (const Int & a, const Int & b) return r(a) -{ r ^= b.Int::val(); } - -inline Int operator + (const Int & a, const int b) return r(a) -{ r += b; } -inline Int operator - (const Int & a, const int b) return r(a) -{ r -= b; } -inline Int operator * (const Int & a, const int b) return r(a) -{ r *= b; } -inline Int operator / (const Int & a, const int b) return r(a) -{ r /= b; } -inline Int operator % (const Int & a, const int b) return r(a) -{ r %= b; } -inline Int operator << (const Int & a, const int b) return r(a) -{ r <<= b; } -inline Int operator >> (const Int & a, const int b) return r(a) -{ r >>= b; } -inline Int operator & (const Int & a, const int b) return r(a) -{ r &= b; } -inline Int operator | (const Int & a, const int b) return r(a) -{ r |= b; } -inline Int operator ^ (const Int & a, const int b) return r(a) -{ r ^= b; } - -inline Int operator + (const int a, const Int & b) return r(a) -{ r += b.Int::val(); } -inline Int operator - (const int a, const Int & b) return r(a) -{ r -= b.Int::val(); } -inline Int operator * (const int a, const Int & b) return r(a) -{ r *= b.Int::val(); } -inline Int operator / (const int a, const Int & b) return r(a) -{ r /= b.Int::val(); } -inline Int operator % (const int a, const Int & b) return r(a) -{ r %= b.Int::val(); } -inline Int operator << (const int a, const Int & b) return r(a) -{ r <<= b.Int::val(); } -inline Int operator >> (const int a, const Int & b) return r(a) -{ r >>= b.Int::val(); } -inline Int operator & (const int a, const Int & b) return r(a) -{ r &= b.Int::val(); } -inline Int operator | (const int a, const Int & b) return r(a) -{ r |= b.Int::val(); } -inline Int operator ^ (const int a, const Int & b) return r(a) -{ r ^= b.Int::val(); } - - - -inline int operator ! (const Int & a) { return !a.Int::val(); } - -inline int operator == (const Int & a, const Int & b) -{ return a.Int::val() == b.Int::val(); } -inline int operator != (const Int & a, const Int & b) -{ return a.Int::val() != b.Int::val(); } -inline int operator < (const Int & a, const Int & b) -{ return a.Int::val() < b.Int::val(); } -inline int operator <= (const Int & a, const Int & b) -{ return a.Int::val() <= b.Int::val(); } -inline int operator > (const Int & a, const Int & b) -{ return a.Int::val() > b.Int::val(); } -inline int operator >= (const Int & a, const Int & b) -{ return a.Int::val() >= b.Int::val(); } - -inline int operator == (const Int & a, const int b) -{ return a.Int::val() == b; } -inline int operator != (const Int & a, const int b) -{ return a.Int::val() != b; } -inline int operator < (const Int & a, const int b) -{ return a.Int::val() < b; } -inline int operator <= (const Int & a, const int b) -{ return a.Int::val() <= b; } -inline int operator > (const Int & a, const int b) -{ return a.Int::val() > b; } -inline int operator >= (const Int & a, const int b) -{ return a.Int::val() >= b; } - -inline int operator == (const int a, const Int & b) -{ return a == b.Int::val(); } -inline int operator != (const int a, const Int & b) -{ return a != b.Int::val(); } -inline int operator < (const int a, const Int & b) -{ return a < b.Int::val(); } -inline int operator <= (const int a, const Int & b) -{ return a <= b.Int::val(); } -inline int operator > (const int a, const Int & b) -{ return a > b.Int::val(); } -inline int operator >= (const int a, const Int & b) -{ return a >= b.Int::val(); } - - - -//# 26 "../../../../libg++/etc/benchmarks/dhrystone.cc" 2 - -//# 1 "../../../../libg++/etc/benchmarks/Char.h" 1 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -class Char -{ -protected: - char rep; - - - -public: - Char (); - Char (const char b); - Char (const Char& b); - ~Char(); - - operator char() const; - - inline virtual char val() const; - - inline virtual void operator = (const char); - inline virtual void operator = (const Char&); - - inline virtual void negate(); - inline virtual void complement(); - inline virtual void operator ++ (); - inline virtual void operator -- (); - - inline virtual void operator += (const Char & ); - inline virtual void operator -= (const Char & ); - inline virtual void operator *= (const Char & ); - inline virtual void operator /= (const Char & ); - inline virtual void operator %= (const Char & ); - inline virtual void operator |= (const Char & ); - inline virtual void operator &= (const Char & ); - inline virtual void operator ^= (const Char & ); - inline virtual void operator <<=(const Char & ); - inline virtual void operator >>=(const Char & ); - - - inline virtual void operator += (const char); - inline virtual void operator -= (const char); - inline virtual void operator *= (const char); - inline virtual void operator /= (const char); - inline virtual void operator %= (const char); - inline virtual void operator |= (const char); - inline virtual void operator &= (const char); - inline virtual void operator ^= (const char); - inline virtual void operator <<=(const char); - inline virtual void operator >>=(const char); - - -}; - -inline char Char::val() const { return rep; } -inline Char::operator char() const { return val(); } - -inline Char::Char () :rep(0) {} -inline Char::Char (const char b) :rep(b) {} -inline Char::Char (const Char& b) :rep(b.Char::val()) {} -inline Char::~Char() {} - -inline void Char::operator = (const char b) -{ rep = b; ; } -inline void Char::operator = (const Char& b) -{ rep = b.Char::val(); ; } - -inline void Char::complement() -{ rep = ~rep; ; } -inline void Char::negate() -{ rep = -rep; ; } -inline void Char::operator ++ () -{ ++rep; ; } -inline void Char::operator -- () -{ --rep; ; } - -inline void Char::operator += (const Char & b) -{ rep += b.Char::val(); ; } -inline void Char::operator -= (const Char & b) -{ rep -= b.Char::val(); ; } -inline void Char::operator *= (const Char & b) -{ rep *= b.Char::val(); ; } -inline void Char::operator /= (const Char & b) -{ rep /= b.Char::val(); ; } -inline void Char::operator %= (const Char & b) -{ rep %= b.Char::val(); ; } -inline void Char::operator |= (const Char & b) -{ rep |= b.Char::val(); ; } -inline void Char::operator &= (const Char & b) -{ rep &= b.Char::val(); ; } -inline void Char::operator ^= (const Char & b) -{ rep ^= b.Char::val(); ; } -inline void Char::operator <<=(const Char & b) -{ rep <<= b.Char::val(); ; } -inline void Char::operator >>=(const Char & b) -{ rep >>= b.Char::val(); ; } - - - -inline void Char::operator += (const char b) -{ rep += b; ; } -inline void Char::operator -= (const char b) -{ rep -= b; ; } -inline void Char::operator *= (const char b) -{ rep *= b; ; } -inline void Char::operator /= (const char b) -{ rep /= b; ; } -inline void Char::operator %= (const char b) -{ rep %= b; ; } -inline void Char::operator |= (const char b) -{ rep |= b; ; } -inline void Char::operator &= (const char b) -{ rep &= b; ; } -inline void Char::operator ^= (const char b) -{ rep ^= b; ; } -inline void Char::operator <<=(const char b) -{ rep <<= b; ; } -inline void Char::operator >>=(const char b) -{ rep >>= b; ; } - - -inline char& operator = (char& a, const Char & b) -{ a = b.Char::val(); return a;} // WARNING - -inline char& operator += (char& a, const Char & b) -{ a += b.Char::val(); return a; } -inline char& operator -= (char& a, const Char & b) -{ a -= b.Char::val(); return a;} -inline char& operator *= (char& a, const Char & b) -{ a *= b.Char::val(); return a;} -inline char& operator /= (char& a, const Char & b) -{ a /= b.Char::val(); return a;} -inline char& operator %= (char& a, const Char & b) -{ a %= b.Char::val(); return a;} -inline char& operator |= (char& a, const Char & b) -{ a |= b.Char::val(); return a;} -inline char& operator &= (char& a, const Char & b) -{ a &= b.Char::val(); return a;} -inline char& operator ^= (char& a, const Char & b) -{ a ^= b.Char::val(); return a;} -inline char& operator <<=(char& a, const Char & b) -{ a <<= b.Char::val(); return a;} -inline char& operator >>=(char& a, const Char & b) -{ a >>= b.Char::val(); return a;} - - - -//# 291 "../../../../libg++/etc/benchmarks/Char.h" - - -inline Char operator - (const Char & a) return r(a) -{ r.negate(); } -inline Char operator ~ (const Char & a) return r(a) -{ r.complement(); } - -inline Char operator + (const Char & a, const Char & b) return r(a) -{ r += b.Char::val(); } -inline Char operator - (const Char & a, const Char & b) return r(a) -{ r -= b.Char::val(); } -inline Char operator * (const Char & a, const Char & b) return r(a) -{ r *= b.Char::val(); } -inline Char operator / (const Char & a, const Char & b) return r(a) -{ r /= b.Char::val(); } -inline Char operator % (const Char & a, const Char & b) return r(a) -{ r %= b.Char::val(); } -inline Char operator << (const Char & a, const Char & b) return r(a) -{ r <<= b.Char::val(); } -inline Char operator >> (const Char & a, const Char & b) return r(a) -{ r >>= b.Char::val(); } -inline Char operator & (const Char & a, const Char & b) return r(a) -{ r &= b.Char::val(); } -inline Char operator | (const Char & a, const Char & b) return r(a) -{ r |= b.Char::val(); } -inline Char operator ^ (const Char & a, const Char & b) return r(a) -{ r ^= b.Char::val(); } - -inline Char operator + (const Char & a, const char b) return r(a) -{ r += b; } -inline Char operator - (const Char & a, const char b) return r(a) -{ r -= b; } -inline Char operator * (const Char & a, const char b) return r(a) -{ r *= b; } -inline Char operator / (const Char & a, const char b) return r(a) -{ r /= b; } -inline Char operator % (const Char & a, const char b) return r(a) -{ r %= b; } -inline Char operator << (const Char & a, const char b) return r(a) -{ r <<= b; } -inline Char operator >> (const Char & a, const char b) return r(a) -{ r >>= b; } -inline Char operator & (const Char & a, const char b) return r(a) -{ r &= b; } -inline Char operator | (const Char & a, const char b) return r(a) -{ r |= b; } -inline Char operator ^ (const Char & a, const char b) return r(a) -{ r ^= b; } - -inline Char operator + (const char a, const Char & b) return r(a) -{ r += b.Char::val(); } -inline Char operator - (const char a, const Char & b) return r(a) -{ r -= b.Char::val(); } -inline Char operator * (const char a, const Char & b) return r(a) -{ r *= b.Char::val(); } -inline Char operator / (const char a, const Char & b) return r(a) -{ r /= b.Char::val(); } -inline Char operator % (const char a, const Char & b) return r(a) -{ r %= b.Char::val(); } -inline Char operator << (const char a, const Char & b) return r(a) -{ r <<= b.Char::val(); } -inline Char operator >> (const char a, const Char & b) return r(a) -{ r >>= b.Char::val(); } -inline Char operator & (const char a, const Char & b) return r(a) -{ r &= b.Char::val(); } -inline Char operator | (const char a, const Char & b) return r(a) -{ r |= b.Char::val(); } -inline Char operator ^ (const char a, const Char & b) return r(a) -{ r ^= b.Char::val(); } - - - -inline char operator ! (const Char & a) { return !a.Char::val(); } - -inline char operator == (const Char & a, const Char & b) -{ return a.Char::val() == b.Char::val(); } -inline char operator != (const Char & a, const Char & b) -{ return a.Char::val() != b.Char::val(); } -inline char operator < (const Char & a, const Char & b) -{ return a.Char::val() < b.Char::val(); } -inline char operator <= (const Char & a, const Char & b) -{ return a.Char::val() <= b.Char::val(); } -inline char operator > (const Char & a, const Char & b) -{ return a.Char::val() > b.Char::val(); } -inline char operator >= (const Char & a, const Char & b) -{ return a.Char::val() >= b.Char::val(); } - -inline char operator == (const Char & a, const char b) -{ return a.Char::val() == b; } -inline char operator != (const Char & a, const char b) -{ return a.Char::val() != b; } -inline char operator < (const Char & a, const char b) -{ return a.Char::val() < b; } -inline char operator <= (const Char & a, const char b) -{ return a.Char::val() <= b; } -inline char operator > (const Char & a, const char b) -{ return a.Char::val() > b; } -inline char operator >= (const Char & a, const char b) -{ return a.Char::val() >= b; } - -inline char operator == (const char a, const Char & b) -{ return a == b.Char::val(); } -inline char operator != (const char a, const Char & b) -{ return a != b.Char::val(); } -inline char operator < (const char a, const Char & b) -{ return a < b.Char::val(); } -inline char operator <= (const char a, const Char & b) -{ return a <= b.Char::val(); } -inline char operator > (const char a, const Char & b) -{ return a > b.Char::val(); } -inline char operator >= (const char a, const Char & b) -{ return a >= b.Char::val(); } - - - -//# 27 "../../../../libg++/etc/benchmarks/dhrystone.cc" 2 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -//# 1 "/giga/hgs/lib/g++-include/sys/types.h" 1 - - -//# 1 "/giga/hgs/lib/g++-include/stddef.h" 1 - -extern "C" { -//# 1 "/giga/hgs/lib/gcc/sun4/cygnus-1.96/include/stddef.h" 1 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -typedef int ptrdiff_t; - - - - - - - - - - - - - - - - - - - - - -typedef int size_t; - - - - - - - - - - - - - - - - - - - - - -typedef short unsigned int wchar_t; - - - - - - - - - - - - - - - - - - - -//# 3 "/giga/hgs/lib/g++-include/stddef.h" 2 - -} -//# 73 "/giga/hgs/lib/g++-include/stddef.h" - -//# 3 "/giga/hgs/lib/g++-include/sys/types.h" 2 - - - - -extern "C" -{ - - - - - - - - - - - - - - - - - - - - - - - - - - -//# 1 "/usr/include/sys/types.h" 1 - - - - - - - - - - - - - - - -//# 1 "/usr/include/sys/stdtypes.h" 1 - - - - - - - - - - - - - -typedef int sigset_t; - -typedef unsigned int speed_t; -typedef unsigned long tcflag_t; -typedef unsigned char cc_t; -typedef int pid_t; - -typedef unsigned short mode_t; -typedef short nlink_t; - -typedef long clock_t; -typedef long time_t; - -typedef int size_t; -typedef int ptrdiff_t; - -typedef unsigned short wchar_t; - - -//# 16 "/usr/include/sys/types.h" 2 - - - -//# 1 "/usr/include/sys/sysmacros.h" 1 - - - - - - - - - - - - - - - - - - - -//# 19 "/usr/include/sys/types.h" 2 - - - - - -typedef unsigned char u_char; -typedef unsigned short u_short; -typedef unsigned int u_int; -typedef unsigned long u_long; -typedef unsigned short ushort; -typedef unsigned int uint; - - - - - - - - - - - - - - - -typedef struct _physadr_t { int r[1]; } *physadr_t; -typedef struct label_t { - int val[2]; -} label_t; - - - - - - - -typedef struct _quad_t { long val[2]; } quad_t; -typedef long daddr_t; -typedef char * caddr_t; -typedef unsigned long ino_t; -typedef short dev_t; -typedef long off_t; -typedef unsigned short uid_t; -typedef unsigned short gid_t; -typedef long key_t; -typedef char * addr_t; - - - - - - - - - - - - - - -typedef long fd_mask; - - - - - - - - - -typedef struct fd_set { - fd_mask fds_bits[(((256 )+(( (sizeof (fd_mask) * 8 ) )-1))/( (sizeof (fd_mask) * 8 ) )) ]; -} fd_set; - - - - - - - -//# 113 "/usr/include/sys/types.h" - - - -//# 35 "/giga/hgs/lib/g++-include/sys/types.h" 2 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -} - - - - -//# 310 "../../../../libg++/etc/benchmarks/dhrystone.cc" 2 - -//# 1 "/giga/hgs/lib/g++-include/sys/times.h" 1 -//# 1 "/giga/hgs/lib/g++-include/time.h" 1 - - - - - -//# 1 "/giga/hgs/lib/g++-include/stddef.h" 1 - -extern "C" { -//# 1 "/giga/hgs/lib/gcc/sun4/cygnus-1.96/include/stddef.h" 1 -//# 94 "/giga/hgs/lib/gcc/sun4/cygnus-1.96/include/stddef.h" - -//# 3 "/giga/hgs/lib/g++-include/stddef.h" 2 - -} -//# 73 "/giga/hgs/lib/g++-include/stddef.h" - -//# 6 "/giga/hgs/lib/g++-include/time.h" 2 - -//# 1 "/giga/hgs/lib/g++-include/stdio.h" 1 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -//#pragma interface - - - - - - - - - - - - - - - - - - - -//# 80 "/giga/hgs/lib/g++-include/stdio.h" - - - -//# 117 "/giga/hgs/lib/g++-include/stdio.h" - - - - - -//# 153 "/giga/hgs/lib/g++-include/stdio.h" - - - -extern "C" { - - - - - - - - - - - - - - - - - - - - - - - - - - - - -//# 1 "/usr/include/stdio.h" 1 - - - - - -extern struct _iobuf { - int _cnt; - unsigned char *_ptr; - unsigned char *_base; - int _bufsiz; - short _flag; - char _file; -} _iob[]; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -extern struct _iobuf *c_proto_fopen (); -extern struct _iobuf *c_proto_fdopen (); -extern struct _iobuf *c_proto_freopen (); -extern struct _iobuf *c_proto_popen (); -extern struct _iobuf *tmpfile(); -extern long ftell(); -extern char *fgets(); -extern char *gets(); -extern char *c_proto_sprintf (); -extern char *ctermid(); -extern char *cuserid(); -extern char *c_proto_tempnam (); -extern char *tmpnam(); - - - - - - -//# 185 "/giga/hgs/lib/g++-include/stdio.h" 2 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -} -//# 417 "/giga/hgs/lib/g++-include/stdio.h" - - - - - - -extern "C" { - - - - - - - -int _doprnt(const char*, void*, struct _iobuf *); -int _doscan(struct _iobuf *, const char*, ...); -int _filbuf(struct _iobuf *); -int _flsbuf(unsigned, struct _iobuf *); - -int fclose(struct _iobuf *); -struct _iobuf * fdopen(int, const char*); -int fflush(struct _iobuf *); -int fgetc(struct _iobuf *); -char* fgets(char*, int, struct _iobuf *); -struct _iobuf * fopen(const char*, const char*); -int fprintf(struct _iobuf *, const char* ...); -int fputc(int, struct _iobuf *); -int fputs(const char*, struct _iobuf *); -int fread(void*, int, int, struct _iobuf *); - - - -struct _iobuf * freopen(const char*, const char*, struct _iobuf *); - -int fscanf(struct _iobuf *, const char* ...); -int fseek(struct _iobuf *, long, int); -long ftell(struct _iobuf *); -int fwrite(const void*, int, int, struct _iobuf *); -char* gets(char*); -int getw(struct _iobuf *); -int pclose(struct _iobuf *); -void perror(const char*); -struct _iobuf * popen(const char*, const char*); -int printf(const char* ...); -int puts(const char*); -int putw(int, struct _iobuf *); -int rewind(struct _iobuf *); -int scanf(const char* ...); -int setbuf(struct _iobuf *, char*); -int setbuffer(struct _iobuf *, char*, int); -int setlinebuf(struct _iobuf *); -int setvbuf(struct _iobuf *, char*, int, int); -int sscanf(char*, const char* ...); -struct _iobuf * tmpfile(); -int ungetc(int, struct _iobuf *); -int vfprintf(struct _iobuf *, const char*, ...); - - - - -int vprintf(const char*, ... ); - - - - - -char* sprintf(char*, const char*, ...); -char* vsprintf(char*, const char*, ...); - - -} - - - - - - - - - - - - - - - - - -//# 7 "/giga/hgs/lib/g++-include/time.h" 2 - - -//# 1 "/giga/hgs/lib/g++-include/sys/types.h" 1 - - -//# 1 "/giga/hgs/lib/g++-include/stddef.h" 1 - -extern "C" { -//# 1 "/giga/hgs/lib/gcc/sun4/cygnus-1.96/include/stddef.h" 1 -//# 94 "/giga/hgs/lib/gcc/sun4/cygnus-1.96/include/stddef.h" - -//# 3 "/giga/hgs/lib/g++-include/stddef.h" 2 - -} -//# 73 "/giga/hgs/lib/g++-include/stddef.h" - -//# 3 "/giga/hgs/lib/g++-include/sys/types.h" 2 - - - - -extern "C" -{ - - - - - - - - - - - - - - - - - - - - - - - - - - -//# 1 "/usr/include/sys/types.h" 1 - - - - - - - - -//# 115 "/usr/include/sys/types.h" - -//# 35 "/giga/hgs/lib/g++-include/sys/types.h" 2 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -} - - - - -//# 9 "/giga/hgs/lib/g++-include/time.h" 2 - - -extern "C" { - - - - - - - - - - - - - - - - - -//# 42 "/giga/hgs/lib/g++-include/time.h" - - - - - - - -//# 1 "/usr/include/time.h" 1 - - - - - -//# 1 "/usr/include/sys/stdtypes.h" 1 - - - - - - - - - - -//# 32 "/usr/include/sys/stdtypes.h" - -//# 6 "/usr/include/time.h" 2 - - - - -struct tm { - int tm_sec; - int tm_min; - int tm_hour; - int tm_mday; - int tm_mon; - int tm_year; - int tm_wday; - int tm_yday; - int tm_isdst; - char *tm_zone; - long tm_gmtoff; -}; - -extern struct tm *c_proto_gmtime (), *c_proto_localtime (); -extern char *c_proto_asctime (), *c_proto_ctime (); -extern void c_proto_tzset (), c_proto_tzsetwall (); -extern int dysize(); -extern time_t timelocal(), timegm(); - - -//# 49 "/giga/hgs/lib/g++-include/time.h" 2 - - -//# 1 "/usr/include/sys/times.h" 1 - - - - - - - - - -//# 1 "/giga/hgs/lib/g++-include/sys/types.h" 1 - - -//# 1 "/giga/hgs/lib/g++-include/stddef.h" 1 - -extern "C" { -//# 1 "/giga/hgs/lib/gcc/sun4/cygnus-1.96/include/stddef.h" 1 -//# 94 "/giga/hgs/lib/gcc/sun4/cygnus-1.96/include/stddef.h" - -//# 3 "/giga/hgs/lib/g++-include/stddef.h" 2 - -} -//# 73 "/giga/hgs/lib/g++-include/stddef.h" - -//# 3 "/giga/hgs/lib/g++-include/sys/types.h" 2 - - - - -extern "C" -{ - - - - - - - - - - - - - - - - - - - - - - - - - - -//# 1 "/usr/include/sys/types.h" 1 - - - - - - - - -//# 115 "/usr/include/sys/types.h" - -//# 35 "/giga/hgs/lib/g++-include/sys/types.h" 2 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -} - - - - -//# 10 "/usr/include/sys/times.h" 2 - - -struct tms { - clock_t tms_utime; - clock_t tms_stime; - clock_t tms_cutime; - clock_t tms_cstime; -}; - - -clock_t times( ); - - - -//# 51 "/giga/hgs/lib/g++-include/time.h" 2 - - - - - - - - - - - - - - - - - - - - - -extern struct tm* localtime(long*); -extern struct tm* gmtime(long*); -extern char* ctime(long*); -extern char* asctime(struct tm*); -extern void tzset(); -extern void tzsetwall(); - - - - - - -extern long times(struct tms*); - - -//# 97 "/giga/hgs/lib/g++-include/time.h" - -extern char* timezone(int, int); -extern int getitimer(int, struct itimerval*); -extern int setitimer(int, struct itimerval*, struct itimerval*); -extern int gettimeofday(struct timeval*, struct timezone*); -extern int settimeofday(struct timeval*, struct timezone*); -extern int stime(long*); -int dysize(int); - - - - - - - - -long clock(void); - -long time(long*); -unsigned ualarm(unsigned, unsigned); -unsigned usleep(unsigned); -int profil(char*, int, int, int); - -} - - - -//# 1 "/giga/hgs/lib/g++-include/sys/times.h" 2 - -//# 311 "../../../../libg++/etc/benchmarks/dhrystone.cc" 2 - - - - - - - - - - - - - - - - - - - - - - - - -typedef enum {Ident1, Ident2, Ident3, Ident4, Ident5} Enumeration; - - - - -typedef Int OneToThirty; -typedef Int OneToFifty; -typedef Char CapitalLetter; -typedef Char String30[31]; -typedef Int Array1Dim[51]; -typedef Int Array2Dim[51][51]; - -struct Record -{ - struct Record *PtrComp; - Enumeration Discr; - Enumeration EnumComp; - OneToFifty IntComp; - String30 StringComp; -}; - -typedef struct Record RecordType; -typedef RecordType * RecordPtr; -typedef int boolean; - - - - - - - - - - - -extern "C" { -extern int printf(const char* ...); -extern void exit(int); -} - -void Proc0(); -void Proc1(RecordPtr PtrParIn); -void Proc2(OneToFifty *IntParIO); -void Proc3(RecordPtr *PtrParOut); -void Proc4(); -void Proc5(); -boolean Func3(Enumeration EnumParIn); -void Proc6( Enumeration EnumParIn, Enumeration *EnumParOut); -void Proc7(OneToFifty IntParI1, OneToFifty IntParI2, OneToFifty *IntParOut); -void Proc8(Array1Dim Array1Par, - Array2Dim Array2Par, - OneToFifty IntParI1, - OneToFifty IntParI2); -Enumeration Func1(CapitalLetter CharPar1, CapitalLetter CharPar2); -boolean Func2(String30 StrParI1, String30 StrParI2); -boolean Func3(Enumeration EnumParIn); - -void mystrcpy(String30 s, char* t) -{ - for (; *t != '\0'; ++s, ++t) *s = *t; - *s = '\0'; -} - -char mystrcmp(String30 s, String30 t) -{ - for (; *s == *t; ++s, ++t) if (*s == '\0') return 0; - return char(*s - *t); -} - - - -main() -{ - Proc0(); - exit(0); -} - - - - -Int IntGlob; -boolean BoolGlob; -char Char1Glob; -char Char2Glob; -Array1Dim Array1Glob; -Array2Dim Array2Glob; -RecordPtr PtrGlb; -RecordPtr PtrGlbNext; - -void Proc0() -{ - OneToFifty IntLoc1; - OneToFifty IntLoc2; - OneToFifty IntLoc3; - char CharLoc; - char CharIndex; - Enumeration EnumLoc; - String30 String1Loc; - String30 String2Loc; - -//# 445 "../../../../libg++/etc/benchmarks/dhrystone.cc" - - - time_t starttime; - time_t benchtime; - time_t nulltime; - struct tms Tms; - register unsigned int i; - - times(&Tms); starttime = Tms.tms_utime; - for (i = 0; i < 500000 ; ++i); - times(&Tms); - nulltime = Tms.tms_utime - starttime; - - - PtrGlbNext = new Record; - PtrGlb = new Record; - PtrGlb->PtrComp = PtrGlbNext; - PtrGlb->Discr = Ident1; - PtrGlb->EnumComp = Ident3; - PtrGlb->IntComp = 40; - mystrcpy(PtrGlb->StringComp, "DHRYSTONE PROGRAM, SOME STRING"); - mystrcpy(String1Loc, "JUST INITIALIZED TO SOME JUNK."); - - - - - - - - - times(&Tms); starttime = Tms.tms_utime; - - for (i = 0; i < 500000 ; ++i) - { - - Proc5(); - Proc4(); - IntLoc1 = 2; - IntLoc2 = 3; - mystrcpy(String2Loc, "DHRYSTONE PROGRAM, 2'ND STRING"); - EnumLoc = Ident2; - BoolGlob = ! Func2(String1Loc, String2Loc); - while (IntLoc1 < IntLoc2) - { - IntLoc3 = 5 * IntLoc1 - IntLoc2; - Proc7(IntLoc1, IntLoc2, &IntLoc3); - ++IntLoc1; - } - Proc8(Array1Glob, Array2Glob, IntLoc1, IntLoc3); - Proc1(PtrGlb); - for (CharIndex = 'A'; CharIndex <= Char2Glob; ++CharIndex) - if (EnumLoc == Func1(CharIndex, 'C')) - Proc6(Ident1, &EnumLoc); - IntLoc3 = IntLoc2 * IntLoc1; - IntLoc2 = IntLoc3 / IntLoc1; - IntLoc2 = 7 * (IntLoc3 - IntLoc2) - IntLoc1; - Proc2(&IntLoc1); - } - - - - - - - - - - - - - - times(&Tms); - benchtime = Tms.tms_utime - starttime - nulltime; - printf("Dhrystone time for %ld passes = %ld\n", - (long) 500000 , benchtime/60 ); - printf("This machine benchmarks at %ld dhrystones/second\n", - ((long) 500000 ) * 60 / benchtime); - - -} - -void Proc1(RecordPtr PtrParIn) -{ - - - (*(PtrParIn->PtrComp)) = *PtrGlb ; - PtrParIn->IntComp = 5; - (*(PtrParIn->PtrComp)) .IntComp = PtrParIn->IntComp; - (*(PtrParIn->PtrComp)) .PtrComp = PtrParIn->PtrComp; - - Proc3(&((*(PtrParIn->PtrComp)) .PtrComp)); - if ((*(PtrParIn->PtrComp)) .Discr == Ident1) - { - (*(PtrParIn->PtrComp)) .IntComp = 6; - Proc6(PtrParIn->EnumComp, &(*(PtrParIn->PtrComp)) .EnumComp); - (*(PtrParIn->PtrComp)) .PtrComp = PtrGlb->PtrComp; - Proc7((*(PtrParIn->PtrComp)) .IntComp, 10, &(*(PtrParIn->PtrComp)) .IntComp); - } - else - *PtrParIn = (*(PtrParIn->PtrComp)) ; - - -} - -void Proc2(OneToFifty *IntParIO) -{ - OneToFifty IntLoc; - Enumeration EnumLoc; - - IntLoc = *IntParIO + 10; - for(;;) - { - if (Char1Glob == 'A') - { - --IntLoc; - *IntParIO = IntLoc - IntGlob; - EnumLoc = Ident1; - } - if (EnumLoc == Ident1) - break; - } -} - -void Proc3(RecordPtr *PtrParOut) -{ - if (PtrGlb != 0 ) - *PtrParOut = PtrGlb->PtrComp; - else - IntGlob = 100; - Proc7(10, IntGlob, &PtrGlb->IntComp); -} - -void Proc4() -{ - boolean BoolLoc; - - BoolLoc = Char1Glob == 'A'; - BoolLoc |= BoolGlob; - Char2Glob = 'B'; -} - -void Proc5() -{ - Char1Glob = 'A'; - BoolGlob = 0 ; -} - - - - -void Proc6( Enumeration EnumParIn, Enumeration *EnumParOut) -{ - *EnumParOut = EnumParIn; - if (! Func3(EnumParIn) ) - *EnumParOut = Ident4; - switch (EnumParIn) - { - case Ident1: *EnumParOut = Ident1; break; - case Ident2: if (IntGlob > 100) *EnumParOut = Ident1; - else *EnumParOut = Ident4; - break; - case Ident3: *EnumParOut = Ident2; break; - case Ident4: break; - case Ident5: *EnumParOut = Ident3; - } -} - -void Proc7(OneToFifty IntParI1, OneToFifty IntParI2, OneToFifty *IntParOut) -{ - OneToFifty IntLoc; - - IntLoc = IntParI1 + 2; - *IntParOut = IntParI2 + IntLoc; -} - -void Proc8(Array1Dim Array1Par, - Array2Dim Array2Par, - OneToFifty IntParI1, - OneToFifty IntParI2) -{ - OneToFifty IntLoc; - OneToFifty IntIndex; - - IntLoc = IntParI1 + 5; - Array1Par[IntLoc] = IntParI2; - Array1Par[IntLoc+1] = Array1Par[IntLoc]; - Array1Par[IntLoc+30] = IntLoc; - for (IntIndex = IntLoc; IntIndex <= (IntLoc+1); ++IntIndex) - Array2Par[IntLoc][IntIndex] = IntLoc; - ++Array2Par[IntLoc][IntLoc-1]; - Array2Par[IntLoc+20][IntLoc] = Array1Par[IntLoc]; - IntGlob = 5; -} - -Enumeration Func1(CapitalLetter CharPar1, CapitalLetter CharPar2) -{ - CapitalLetter CharLoc1; - CapitalLetter CharLoc2; - - CharLoc1 = CharPar1; - CharLoc2 = CharLoc1; - if (CharLoc2 != CharPar2) - return (Ident1); - else - return (Ident2); -} - -boolean Func2(String30 StrParI1, String30 StrParI2) -{ - OneToThirty IntLoc; - CapitalLetter CharLoc; - - IntLoc = 1; - while (IntLoc <= 1) - if (Func1(StrParI1[IntLoc], StrParI2[IntLoc+1]) == Ident1) - { - CharLoc = 'A'; - ++IntLoc; - } - if (CharLoc >= 'W' && CharLoc <= 'Z') - IntLoc = 7; - if (CharLoc == 'X') - return( 1 ); - else - { - if (mystrcmp(StrParI1, StrParI2) > 0) - { - IntLoc += 7; - return ( 1 ); - } - else - return ( 0 ); - } -} - -boolean Func3(Enumeration EnumParIn) -{ - Enumeration EnumLoc; - - EnumLoc = EnumParIn; - if (EnumLoc == Ident3) return ( 1 ); - return ( 0 ); -} diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p701.C b/gcc/testsuite/g++.old-deja/g++.mike/p701.C deleted file mode 100644 index c222ea1e888..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/p701.C +++ /dev/null @@ -1,34 +0,0 @@ -// Build don't link: -// prms-id: 701 - -extern "C" -{ - int printf(const char *, ...); -}; - - -void Munge(int& x) -{ // ERROR - referenced below - x = 2; -} - - -class A -{ - public: - int i; - A(int x) : i(x) {} - void Safe() const; -}; - -void -A::Safe() const -{ - Munge(i); // ERROR - should not be able to modify a const object -} - -int main() -{ - const A a(1); - a.Safe(); -} diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p710.C b/gcc/testsuite/g++.old-deja/g++.mike/p710.C deleted file mode 100644 index 62dffe9ff8e..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/p710.C +++ /dev/null @@ -1,43 +0,0 @@ -// Build don't link: -// GROUPS passed delete -/* - Bug Id: - PRMS Id: p0000710 - Bug is : overloading operator delete in class def not allowed -*/ - -/* - In addition to this bug, the compiler permits overloading operator - delete in the class definition. This is verboten, and should be - caught by a regression suite. In other words, the following is also a - bug that's not caught: -*/ - - -#include <stdlib.h> - -extern "C" -{ - int printf(const char*, ...); -}; - - - -class B -{ - public: - int x; - virtual ~B() {} - void operator delete(void*,size_t s) - { - printf("B::delete() %d\n",s); - } - void operator delete(void*){} -}; - -int main() -{ - B* p = new B; - delete p; - return 0; -} diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p7180.C b/gcc/testsuite/g++.old-deja/g++.mike/p7180.C deleted file mode 100644 index da75bd6d4ed..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/p7180.C +++ /dev/null @@ -1,17 +0,0 @@ -// prms-id: 7180 - -class String { -public: - String(const char*); - ~String(); -}; - -String::String(const char* str = "") { -} - -String::~String(void) { -} - -int main() { - const String array[] = {"3"}; -} diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p7325.C b/gcc/testsuite/g++.old-deja/g++.mike/p7325.C deleted file mode 100644 index e6d76f5321e..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/p7325.C +++ /dev/null @@ -1,55 +0,0 @@ -// I hate this type of test case. I'm not sure how to code it better. -// See the PR for what this tests. -// prms-id: 7325 -// execution test - XFAIL *-*-* - -int fail = 0; - -struct A { - int i; - static const A* match_this; - static const A* match_arg; - A(): i(7) { - if (match_this) - if (match_this != this) - fail = 1; - } - A* get_this() { return this; } - A& operator = (const A& o) { - if (match_this) - if (match_this != this) - fail = 1; - if (match_arg) - if (match_arg != &o) - fail = 1; - match_arg = &o; - } -}; - -const A* A::match_this; -const A* A::match_arg; -A a; - -A foo() { return a; } -void f () -{ - A a; - A::match_this = &a; - a = foo (); - a = foo (); - A::match_this = 0; -} - -void g () -{ - A::match_this = A().get_this(); - A(); - A(); - A::match_this = 0; -} - -int main() { - f(); - g(); - return fail; -} diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p7476.C b/gcc/testsuite/g++.old-deja/g++.mike/p7476.C deleted file mode 100644 index acddf05ee13..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/p7476.C +++ /dev/null @@ -1,20 +0,0 @@ -// Build don't link: -// prms-id: 7476 - -class HeapTracked { -public: - virtual ~HeapTracked() { } - static void isObjectAllocation(const HeapTracked *ptr); - static void isObjectAllocation(HeapTracked *ptr); -}; - -void HeapTracked::isObjectAllocation(HeapTracked *ptr) -{ - dynamic_cast<const void*>(ptr); - dynamic_cast<void*>(ptr); -} -void HeapTracked::isObjectAllocation(const HeapTracked *ptr) -{ - const_cast<void*>(dynamic_cast<const void*>(ptr)); - dynamic_cast<void*>(ptr); // ERROR - -} diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p755.C b/gcc/testsuite/g++.old-deja/g++.mike/p755.C deleted file mode 100644 index 256c985e271..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/p755.C +++ /dev/null @@ -1,17 +0,0 @@ -// It checks to see if you can define your own global new operator. -// prms-id: 755 - -#include <new> -extern "C" void exit(int); - -void* operator new(size_t sz) throw (std::bad_alloc) { - void* p = 0; - exit(0); - return p; -} - -int main () { - int* i = new int; - delete i; - return 1; -} diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p755a.C b/gcc/testsuite/g++.old-deja/g++.mike/p755a.C deleted file mode 100644 index 73172c159ce..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/p755a.C +++ /dev/null @@ -1,14 +0,0 @@ -// It checks to see if you can define your own global delete operator. -// prms-id: 755 - -extern "C" void exit(int); - -void operator delete(void *p) throw() { - exit(0); -} - -int main () { - int* i = new int; - delete i; - return 1; -} diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p7626.C b/gcc/testsuite/g++.old-deja/g++.mike/p7626.C deleted file mode 100644 index 8e38667ca67..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/p7626.C +++ /dev/null @@ -1,43 +0,0 @@ -// Build don't link: -// prms-id: 7626 - -int fail; - -typedef unsigned int UINT; - -class CObject{}; - -class CCmdTarget : public CObject { -}; - -typedef void (CCmdTarget::*AFX_PMSG)(void); - -struct AFX_MSGMAP_ENTRY { - AFX_PMSG pfn; -}; - -class CWnd : public CCmdTarget { -public: - void OnMyMsg() { fail = 1; } // If this one is called, something is wrong. - static AFX_MSGMAP_ENTRY _messageEntries[]; -}; - -typedef void (CWnd::*AFX_PMSGW)(void); - -class CDialog : public CWnd -{ -public: - void OnMyMsg() { } - static AFX_MSGMAP_ENTRY _messageEntries[]; -}; - -AFX_MSGMAP_ENTRY CDialog ::_messageEntries[] = { - { (AFX_PMSG)(AFX_PMSGW)(void (CWnd::*)())&CDialog::OnMyMsg }, - { (AFX_PMSG)0 } -}; - -int main() { - CDialog d; - (d.*((CDialog::_messageEntries)[0]).pfn)(); // This should call CDialog::OnMyMsg - return fail; -} diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p7635.C b/gcc/testsuite/g++.old-deja/g++.mike/p7635.C deleted file mode 100644 index 4cafa0e46fa..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/p7635.C +++ /dev/null @@ -1,6 +0,0 @@ -// prms-id: 7635 - -class DaycountBasis { - mutable const int * p; - mutable int * const q; // ERROR - -}; diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p7651.C b/gcc/testsuite/g++.old-deja/g++.mike/p7651.C deleted file mode 100644 index 487b0d57664..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/p7651.C +++ /dev/null @@ -1,25 +0,0 @@ -// prms-id: 7651 - -int fail = 0; - -class Foo { -public: - Foo(double i) : data(i) { if (data != 1.0) fail = 1; } - ~Foo() { if (data != 1.0) fail = 1; } -private: - volatile double data; -}; - -int DingDong(double A) { - volatile Foo a(A); - - if ( A != 0.0 ) { - return 1; - } - return 0; -} - - -int main() { - DingDong(1.0); -} diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p783.C b/gcc/testsuite/g++.old-deja/g++.mike/p783.C deleted file mode 100644 index 4194fa8b2ba..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/p783.C +++ /dev/null @@ -1,15 +0,0 @@ -// prms-id: 783 - -extern "C" void printf (char *, ...); - -class C { -public: - C() { } - ~C() { } -}; - -int main(int argc, char**argv) { - C c,d; - c = (argc&1) ? C() : d; - return 0; -} diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p783a.C b/gcc/testsuite/g++.old-deja/g++.mike/p783a.C deleted file mode 100644 index 6321a7b3eb5..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/p783a.C +++ /dev/null @@ -1,26 +0,0 @@ -// Copying into an object directly is a lose according to tiemann. -// Deleting an object many times is a lose. -// prms-id: 783 - -extern "C" void printf (char *, ...); -extern "C" void exit (int); - -class C { - int i; -public: - C() { - i = 1; - } - ~C() { - if (i != 1) { - exit(1); - } - i = 0; - } -}; - -int main(int argc, char**argv) { - C c; - c = C(); - return 0; -} diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p783b.C b/gcc/testsuite/g++.old-deja/g++.mike/p783b.C deleted file mode 100644 index 35a18f3f99b..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/p783b.C +++ /dev/null @@ -1,37 +0,0 @@ -// This one check for objects being destroyed twice. The bug it is -// looking for is the extra dtor call on C() even though it is never -// built. -// prms-id: 783 - -extern "C" void printf (char *, ...); -extern "C" void exit (int); - -class C { - int i; -public: -// C() {printf ("C ctor at %x\n", this);} -// ~C() {printf ("C dtor at %x\n", this);} - C() { - i = 1; - } - ~C() { - if (i != 1) { - exit(1); - } - i = 0; - } -}; - -C g; - -C func() { - return g; -} - -int main(int argc, char**argv) { - C c,d; -// printf ("\n"); - c = (argc != 1) ? C() : d; -// printf ("\n"); - return 0; -} diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p784.C b/gcc/testsuite/g++.old-deja/g++.mike/p784.C deleted file mode 100644 index ce6104977f1..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/p784.C +++ /dev/null @@ -1,3658 +0,0 @@ -// Build don't link: -// Special g++ Options: -w -// prms-id: 784 - -//# 1 "GctSymbol.GctSymbol.CHMap.cc" -// This may look like C code, but it is really -*- C++ -*- -/* -Copyright (C) 1988 Free Software Foundation - written by Doug Lea (dl@rocky.oswego.edu) - -This file is part of the GNU C++ Library. This library is free -software; you can redistribute it and/or modify it under the terms of -the GNU Library General Public License as published by the Free -Software Foundation; either version 2 of the License, or (at your -option) any later version. This library is distributed in the hope -that it will be useful, but WITHOUT ANY WARRANTY; without even the -implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR -PURPOSE. See the GNU Library General Public License for more details. -You should have received a copy of the GNU Library General Public -License along with this library; if not, write to the Free Software -Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. -*/ - - -//#pragma implementation - -//# 1 "GctSymbol.GctSymbol.CHMap.h" 1 -// This may look like C code, but it is really -*- C++ -*- -/* -Copyright (C) 1988 Free Software Foundation - written by Doug Lea (dl@rocky.oswego.edu) - -This file is part of the GNU C++ Library. This library is free -software; you can redistribute it and/or modify it under the terms of -the GNU Library General Public License as published by the Free -Software Foundation; either version 2 of the License, or (at your -option) any later version. This library is distributed in the hope -that it will be useful, but WITHOUT ANY WARRANTY; without even the -implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR -PURPOSE. See the GNU Library General Public License for more details. -You should have received a copy of the GNU Library General Public -License along with this library; if not, write to the Free Software -Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. -*/ - - - - -//#pragma interface - - - -//# 1 "GctSymbol.GctSymbol.Map.h" 1 -// This may look like C code, but it is really -*- C++ -*- -/* -Copyright (C) 1988 Free Software Foundation - written by Doug Lea (dl@rocky.oswego.edu) - -This file is part of the GNU C++ Library. This library is free -software; you can redistribute it and/or modify it under the terms of -the GNU Library General Public License as published by the Free -Software Foundation; either version 2 of the License, or (at your -option) any later version. This library is distributed in the hope -that it will be useful, but WITHOUT ANY WARRANTY; without even the -implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR -PURPOSE. See the GNU Library General Public License for more details. -You should have received a copy of the GNU Library General Public -License along with this library; if not, write to the Free Software -Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. -*/ - - - - -//#pragma interface - - - -//# 1 "/projects/gnu-cygnus/gnu-cygnus-8/common/g++-include/Pix.h" 1 - - - -typedef void* Pix; - -//# 26 "GctSymbol.GctSymbol.Map.h" 2 - -//# 1 "GctSymbol.defs.h" 1 -// This may look like C code, but it is really -*- C++ -*- -/* -Copyright (C) 1988 Free Software Foundation - written by Doug Lea (dl@rocky.oswego.edu) - -This file is part of the GNU C++ Library. This library is free -software; you can redistribute it and/or modify it under the terms of -the GNU Library General Public License as published by the Free -Software Foundation; either version 2 of the License, or (at your -option) any later version. This library is distributed in the hope -that it will be useful, but WITHOUT ANY WARRANTY; without even the -implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR -PURPOSE. See the GNU Library General Public License for more details. -You should have received a copy of the GNU Library General Public -License along with this library; if not, write to the Free Software -Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. -*/ - - - - - - - -//# 1 "../../GctSymbol.h" 1 -// -*- C++ -*- - - - -// -// GctSymbol class -// -// Expects to be included by Gct.h -// -// Wendell Baker, Berkeley CAD Group, 1992 (wbaker@ic.Berkeley.EDU) -// - - - - - -//#pragma interface - - - - - -//# 25 "../../GctSymbol.h" 2 - -//# 1 "/projects/gnu-cygnus/gnu-cygnus-8/common/g++-include/String.h" 1 -// This may look like C code, but it is really -*- C++ -*- -/* -Copyright (C) 1988 Free Software Foundation - written by Doug Lea (dl@rocky.oswego.edu) - -This file is part of the GNU C++ Library. This library is free -software; you can redistribute it and/or modify it under the terms of -the GNU Library General Public License as published by the Free -Software Foundation; either version 2 of the License, or (at your -option) any later version. This library is distributed in the hope -that it will be useful, but WITHOUT ANY WARRANTY; without even the -implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR -PURPOSE. See the GNU Library General Public License for more details. -You should have received a copy of the GNU Library General Public -License along with this library; if not, write to the Free Software -Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. -*/ - - - - -//#pragma interface - - - -//# 1 "/projects/gnu-cygnus/gnu-cygnus-8/common/g++-include/stream.h" 1 - - - -// Compatibility with old library. - - -//# 1 "/projects/gnu-cygnus/gnu-cygnus-8/common/g++-include/iostream.h" 1 -// This is part of the iostream library, providing -*- C++ -*- input/output. -// Copyright (C) 1991 Per Bothner. -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Library General Public -// License as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Library General Public License for more details. -// -// You should have received a copy of the GNU Library General Public -// License along with this library; if not, write to the Free -// Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - - - -//#pragma interface - - - - -//# 1 "/projects/gnu-cygnus/gnu-cygnus-8/common/g++-include/streambuf.h" 1 -// This is part of the iostream library, providing -*- C++ -*- input/output. -// Copyright (C) 1991 Per Bothner. -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Library General Public -// License as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Library General Public License for more details. -// -// You should have received a copy of the GNU Library General Public -// License along with this library; if not, write to the Free -// Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - - - - -//#pragma interface - - -/* KLUDGES!! */ -//# 1 "/projects/gnu-cygnus/gnu-cygnus-8/common/g++-include/stddef.h" 1 - - -extern "C" { - - - -//# 1 "/projects/gnu-cygnus/gnu-cygnus-8/mips/lib/gcc/decstatn/cygnus-1.96/include/stddef.h" 1 - - - - - - -/* This avoids lossage on Sunos but only if stdtypes.h comes first. - There's no way to win with the other order! Sun lossage. */ - -/* In case nobody has defined these types, but we aren't running under - GCC 2.00, make sure that __PTRDIFF_TYPE__, __SIZE__TYPE__, and - __WCHAR_TYPE__ have reasonable values. This can happen if the - parts of GCC is compiled by an older compiler, that actually - include gstddef.h, such as collect2. */ - -/* Signed type of difference of two pointers. */ - - - - - - - - - - - - - - -typedef long int ptrdiff_t; - - - - - - -/* Unsigned type of `sizeof' something. */ - - - - - - - - - - - - - - -typedef unsigned int size_t; - - - - - - -/* Data type for wide chars. */ - - - - - - - - - - - - - - -typedef int wchar_t; - - - - - - - - -/* A null pointer constant. */ - - - - -/* Offset of member MEMBER in a struct of type TYPE. */ - - - - - -//# 7 "/projects/gnu-cygnus/gnu-cygnus-8/common/g++-include/stddef.h" 2 - - - - -} - -//# 25 "/projects/gnu-cygnus/gnu-cygnus-8/common/g++-include/streambuf.h" 2 - - - - - - - - - - - - - - - - -class ostream; class streambuf; - -typedef long streamoff, streampos; - -struct _ios_fields { // The data members of an ios. - streambuf *_strbuf; - ostream* _tie; - long _width; - unsigned long _flags; - char _fill; - unsigned char _state; - unsigned short _precision; -}; - - -enum state_value { _good = 0, _eof = 1, _fail = 2, _bad = 4 }; - - -class ios : public _ios_fields { - public: - enum io_state { goodbit=0, eofbit=1, failbit=2, badbit=4 }; - enum open_mode { - in=1, - out=2, - ate=4, - app=8, - trunc=16, - nocreate=32, - noreplace=64 }; - enum seek_dir { beg, cur, end}; - enum { skipws=01, left=02, right=04, internal=010, - dec=020, oct=040, hex=0100, - showbase=0200, showpoint=0400, uppercase=01000, showpos=02000, - scientific=04000, fixed=0100000, unitbuf=020000, stdio=040000, - dont_close=0x80000000 //Don't close streambuf when destroying stream - }; - - ostream* tie() { return _tie; } - ostream* tie(ostream* val) { ostream* save=_tie; _tie=val; return save; } - - // Methods to change the format state. - char fill() { return _fill; } - char fill(char newf) { char oldf = _fill; _fill = newf; return oldf; } - unsigned long flags() { return _flags; } - unsigned long flags(unsigned long new_val) { - unsigned long old_val = _flags; _flags = new_val; return old_val; } - unsigned short precision() { return _precision; } - unsigned short precision(int newp) { - unsigned short oldp = _precision; _precision = (unsigned short)newp; - return oldp; } - unsigned long setf(unsigned long val) { - unsigned long oldbits = _flags; - _flags |= val; return oldbits; } - unsigned long setf(unsigned long val, unsigned long mask) { - unsigned long oldbits = _flags; - _flags = (_flags & ~mask) | (val & mask); return oldbits; } - unsigned long unsetf(unsigned long mask) { - unsigned long oldbits = _flags & mask; - _flags &= ~mask; return oldbits; } - long width() { return _width; } - long width(long val) { long save = _width; _width = val; return save; } - - static const unsigned long basefield; - static const unsigned long adjustfield; - static const unsigned long floatfield; - - streambuf* rdbuf() { return _strbuf; } - void clear(int state = 0) { _state = state; } - int good() { return _state == 0; } - int eof() { return _state & ios::eofbit; } - int fail() { return _state & (ios::badbit|ios::failbit); } - int bad() { return _state & ios::badbit; } - int rdstate() { return _state; } - void set(int flag) { _state |= flag; } - operator void*() { return fail() ? (void*)0 : (void*)this; } - int operator!() { return fail(); } - - - void unset(state_value flag) { _state &= ~flag; } - void close(); - int is_open(); - int readable(); - int writable(); - - - protected: - ios(streambuf*sb) { _strbuf=sb; _state=0; _width=0; _fill=' '; - _flags=ios::skipws; _precision=6; } -}; - - - - -typedef ios::seek_dir _seek_dir; - - -// Magic numbers and bits for the _flags field. -// The magic numbers use the high-order bits of _flags; -// the remaining bits are abailable for variable flags. -// Note: The magic numbers must all be negative if stdio -// emulation is desired. - - - - - - - - - - - - - - - -struct __streambuf { - // NOTE: If this is changed, also change __FILE in stdio/stdio.h! - int _flags; /* High-order word is _IO_MAGIC; rest is flags. */ - char* _gptr; /* Current get pointer */ - char* _egptr; /* End of get area. */ - char* _eback; /* Start of putback+get area. */ - char* _pbase; /* Start of put area. */ - char* _pptr; /* Current put pointer. */ - char* _epptr; /* End of put area. */ - char* _base; /* Start of reserve area. */ - char* _ebuf; /* End of reserve area. */ - struct streambuf *_chain; -}; - -struct streambuf : private __streambuf { - friend class ios; - friend class istream; - friend class ostream; - protected: - static streambuf* _list_all; /* List of open streambufs. */ - streambuf*& xchain() { return _chain; } - void _un_link(); - void _link_in(); - char* gptr() const { return _gptr; } - char* pptr() const { return _pptr; } - char* egptr() const { return _egptr; } - char* epptr() const { return _epptr; } - char* pbase() const { return _pbase; } - char* eback() const { return _eback; } - char* ebuf() const { return _ebuf; } - char* base() const { return _base; } - void xput_char(char c) { *_pptr++ = c; } - int xflags() { return _flags; } - int xflags(int f) { int fl = _flags; _flags = f; return fl; } - void xsetflags(int f) { _flags |= f; } - void gbump(int n) { _gptr += n; } - void pbump(int n) { _pptr += n; } - void setb(char* b, char* eb, int a=0); - void setp(char* p, char* ep) { _pbase=_pptr=p; _epptr=ep; } - void setg(char* eb, char* g, char *eg) { _eback=eb; _gptr=g; _egptr=eg; } - public: - static int flush_all(); - static void flush_all_linebuffered(); // Flush all line buffered files. - virtual int underflow(); // Leave public for now - virtual int overflow(int c = (-1) ); // Leave public for now - virtual int doallocate(); - virtual streampos seekoff(streamoff, _seek_dir, int mode=ios::in|ios::out); - virtual streampos seekpos(streampos pos, int mode = ios::in|ios::out); - int sputbackc(char c); - int sungetc(); - streambuf(); - virtual ~streambuf(); - int unbuffered() { return _flags & 2 ? 1 : 0; } - int linebuffered() { return _flags & 0x4000 ? 1 : 0; } - void unbuffered(int i) - { if (i) _flags |= 2 ; else _flags &= ~2 ; } - void linebuffered(int i) - { if (i) _flags |= 0x4000 ; else _flags &= ~0x4000 ; } - int allocate() { - if (base() || unbuffered()) return 0; - else return doallocate(); } - virtual int sync(); - virtual int pbackfail(int c); - virtual int ungetfail(); - virtual streambuf* setbuf(char* p, int len); - int in_avail() { return _egptr - _gptr; } - int out_waiting() { return _pptr - _pbase; } - virtual int sputn(const char* s, int n); - virtual int sgetn(char* s, int n); - long sgetline(char* buf, size_t n, char delim, int putback_delim); - int sbumpc() { - if (_gptr >= _egptr && underflow() == (-1) ) return (-1) ; - else return *(unsigned char*)_gptr++; } - int sgetc() { - if (_gptr >= _egptr && underflow() == (-1) ) return (-1) ; - else return *(unsigned char*)_gptr; } - int snextc() { - if (++_gptr >= _egptr && underflow() == (-1) ) return (-1) ; - else return *(unsigned char*)_gptr; } - int sputc(int c) { - if (_pptr >= _epptr) return overflow(c); - return *_pptr++ = c, (unsigned char)c; } - int vscan(char const *fmt0, char* ap); - int vform(char const *fmt0, char* ap); -}; - -struct __file_fields { - char _fake; - char _shortbuf[1]; - short _fileno; - int _blksize; - char* _save_gptr; - char* _save_egptr; - long _offset; -}; - -class filebuf : public streambuf { - struct __file_fields _fb; - void init(); - public: - filebuf(); - filebuf(int fd); - filebuf(int fd, char* p, int len); - ~filebuf(); - filebuf* attach(int fd); - filebuf* open(const char *filename, const char *mode); - filebuf* open(const char *filename, int mode, int prot = 0664); - virtual int underflow(); - virtual int overflow(int c = (-1) ); - int is_open() { return _fb._fileno >= 0; } - int fd() { return is_open() ? _fb._fileno : (-1) ; } - filebuf* close(); - virtual int doallocate(); - virtual streampos seekoff(streamoff, _seek_dir, int mode=ios::in|ios::out); - int sputn(const char* s, int n); - int sgetn(char* s, int n); - protected: // See documentation in filebuf.C. - virtual int pbackfail(int c); - virtual int sync(); - int is_reading() { return eback() != egptr(); } - char* cur_ptr() { return is_reading() ? gptr() : pptr(); } - /* System's idea of pointer */ - char* file_ptr() { return _fb._save_gptr ? _fb._save_egptr : egptr(); } - int do_flush(); - // Low-level operations (Usually invoke system calls.) - virtual int sys_read(char* buf, size_t size); - virtual long sys_seek(long , _seek_dir); - virtual long sys_write(const void*, long); - virtual int sys_stat(void*); // Actually, a (struct stat*) - virtual int sys_close(); -}; - - -inline int ios::readable() { return rdbuf()->_flags & 4 ; } -inline int ios::writable() { return rdbuf()->_flags & 8 ; } -inline int ios::is_open() {return rdbuf()->_flags & 4 +8 ;} - - - - -//# 25 "/projects/gnu-cygnus/gnu-cygnus-8/common/g++-include/iostream.h" 2 - - -class istream; class ostream; -typedef istream& (*__imanip)(istream&); -typedef ostream& (*__omanip)(ostream&); - -extern istream& ws(istream& ins); -extern ostream& flush(ostream& outs); -extern ostream& endl(ostream& outs); -extern ostream& ends(ostream& outs); - -class ostream : public ios -{ - void do_osfx(); - public: - ostream(); - ostream(streambuf* sb, ostream* tied=(__null) ); - ~ostream(); - - int opfx() { if (!good()) return 0; if (_tie) _tie->flush(); return 1; } - void osfx() { if (flags() & (ios::unitbuf|ios::stdio)) - do_osfx(); } - streambuf* ostreambuf() const { return _strbuf; } - ostream& flush(); - ostream& put(char c); - ostream& write(const char *s, int n); - ostream& write(const unsigned char *s, int n) { return write((char*)s, n);} - ostream& write(const void *s, int n) { return write((char*)s, n);} - ostream& seekp(streampos); - ostream& seekp(streamoff, _seek_dir); - streampos tellp(); - ostream& form(const char *format ...); - ostream& vform(const char *format, char* args); -}; - -ostream& operator<<(ostream&, char c); -ostream& operator<<(ostream& os, unsigned char c) { return os << (char)c; } -//ostream& operator<<(ostream &os, signed char c) { return os << (char)c; } -extern ostream& operator<<(ostream&, const char *s); -inline ostream& operator<<(ostream& os, const unsigned char *s) -{ return os << (const char*)s; } -//inline ostream& operator<<(ostream& os, const signed char *s) -//{ return os << (const char*)s; } -ostream& operator<<(ostream&, void *p); -ostream& operator<<(ostream&, int n); -ostream& operator<<(ostream&, long n); -ostream& operator<<(ostream&, unsigned int n); -ostream& operator<<(ostream&, unsigned long n); -ostream& operator<<(ostream& os, short n) {return os << (int)n;} -ostream& operator<<(ostream& os, unsigned short n) -{return os << (unsigned int)n;} -ostream& operator<<(ostream&, float n); -ostream& operator<<(ostream&, double n); -ostream& operator<<(ostream& os, __omanip func) { return (*func)(os); } -ostream& operator<<(ostream&, streambuf*); - -class istream : public ios -{ - size_t _gcount; - public: - istream(); - istream(streambuf* sb, ostream*tied=(__null) ); - ~istream(); - streambuf* istreambuf() const { return _strbuf; } - istream& get(char& c); - istream& get(unsigned char& c); - istream& read(char *ptr, int n); - istream& read(unsigned char *ptr, int n) { return read((char*)ptr, n); } - istream& read(void *ptr, int n) { return read((char*)ptr, n); } - int get() { return _strbuf->sbumpc(); } - istream& getline(char* ptr, int len, char delim = '\n'); - istream& get(char* ptr, int len, char delim = '\n'); - istream& gets(char **s, char delim = '\n'); - int ipfx(int need) { - if (!good()) { set(ios::failbit); return 0; } - if (_tie && (need == 0 || rdbuf()->in_avail())) ; //??? THIS LINE IS QUESTIONABLE */ - if (!need && (flags() & ios::skipws) && !ws(*this)) return 0; - return 1; - } - int ipfx0() { // Optimized version of ipfx(0). - if (!good()) { set(ios::failbit); return 0; } - if (_tie) _tie->flush(); - if ((flags() & ios::skipws) && !ws(*this)) return 0; - return 1; - } - int ipfx1() { // Optimized version of ipfx(1). - if (!good()) { set(ios::failbit); return 0; } - if (_tie && rdbuf()->in_avail() == 0) _tie->flush(); - return 1; - } - size_t gcount() { return _gcount; } - istream& seekg(streampos); - istream& seekg(streamoff, _seek_dir); - streampos tellg(); - istream& putback(char ch) { - if (good() && _strbuf->sputbackc(ch) == (-1) ) clear(ios::badbit); - return *this;} - istream& unget() { - if (good() && _strbuf->sungetc() == (-1) ) clear(ios::badbit); - return *this;} - - istream& unget(char ch) { return putback(ch); } - int skip(int i); - -}; - -istream& operator>>(istream&, char*); -istream& operator>>(istream& is, unsigned char* p) { return is >> (char*)p; } -//istream& operator>>(istream& is, signed char* p) { return is >> (char*)p; } -istream& operator>>(istream&, char& c); -istream& operator>>(istream&, unsigned char& c); -//istream& operator>>(istream&, signed char& c); -istream& operator>>(istream&, int&); -istream& operator>>(istream&, long&); -istream& operator>>(istream&, short&); -istream& operator>>(istream&, unsigned int&); -istream& operator>>(istream&, unsigned long&); -istream& operator>>(istream&, unsigned short&); -istream& operator>>(istream&, float&); -istream& operator>>(istream&, double&); -istream& operator>>(istream& is, __imanip func) { return (*func)(is); } - -class iostream : public ios { - size_t _gcount; - public: - iostream(); - operator istream&() { return *(istream*)this; } - operator ostream&() { return *(ostream*)this; } - ~iostream(); - // NOTE: These duplicate istream methods. - istream& get(char& c) { return ((istream*)this)->get(c); } - istream& get(unsigned char& c) { return ((istream*)this)->get(c); } - istream& read(char *ptr, int n) { return ((istream*)this)->read(ptr, n); } - istream& read(unsigned char *ptr, int n) - { return ((istream*)this)->read((char*)ptr, n); } - istream& read(void *ptr, int n) - { return ((istream*)this)->read((char*)ptr, n); } - int get() { return _strbuf->sbumpc(); } - istream& getline(char* ptr, int len, char delim = '\n') - { return ((istream*)this)->getline(ptr, len, delim); } - istream& get(char* ptr, int len, char delim = '\n') - { return ((istream*)this)->get(ptr, len, delim); } - istream& gets(char **s, char delim = '\n') - { return ((istream*)this)->gets(s, delim); } - int ipfx(int need) { return ((istream*)this)->ipfx(need); } - int ipfx0() { return ((istream*)this)->ipfx0(); } - int ipfx1() { return ((istream*)this)->ipfx1(); } - size_t gcount() { return _gcount; } - istream& putback(char ch) { return ((istream*)this)->putback(ch); } - istream& unget() { return ((istream*)this)->unget(); } - istream& seekg(streampos pos) { return ((istream*)this)->seekg(pos); } - istream& seekg(streamoff off, _seek_dir dir) - { return ((istream*)this)->seekg(off, dir); } - streampos tellg() { return ((istream*)this)->tellg(); } - - istream& unget(char ch) { return putback(ch); } - - - // NOTE: These duplicate ostream methods. - int opfx() { return ((ostream*)this)->opfx(); } - void osfx() { ((ostream*)this)->osfx(); } - ostream& flush() { return ((ostream*)this)->flush(); } - ostream& put(char c) { return ((ostream*)this)->put(c); } - ostream& write(const char *s, int n) - { return ((ostream*)this)->write(s, n); } - ostream& write(const unsigned char *s, int n) - { return ((ostream*)this)->write((char*)s, n); } - ostream& write(const void *s, int n) - { return ((ostream*)this)->write((char*)s, n); } - ostream& form(const char *format ...); - ostream& vform(const char *format, char* args) - { return ((ostream*)this)->vform(format, args); } - ostream& seekp(streampos pos) { return ((ostream*)this)->seekp(pos); } - ostream& seekp(streamoff off, _seek_dir dir) - { return ((ostream*)this)->seekp(off, dir); } - streampos tellp() { return ((ostream*)this)->tellp(); } -}; - -extern istream cin; -extern ostream cout, cerr, clog; // clog->rdbuf() == cerr->rdbuf() - -inline ostream& ostream::put(char c) { _strbuf->sputc(c); return *this; } - -struct Iostream_init { } ; // Compatibility hack for AT&T libraray. - - -//# 7 "/projects/gnu-cygnus/gnu-cygnus-8/common/g++-include/stream.h" 2 - - -extern char* form(char*, ...); - -extern char* dec(long, int=0); -extern char* dec(int, int=0); -extern char* dec(unsigned long, int=0); -extern char* dec(unsigned int, int=0); - -extern char* hex(long, int=0); -extern char* hex(int, int=0); -extern char* hex(unsigned long, int=0); -extern char* hex(unsigned int, int=0); - -extern char* oct(long, int=0); -extern char* oct(int, int=0); -extern char* oct(unsigned long, int=0); -extern char* oct(unsigned int, int=0); - -inline istream& WS(istream& str) { return ws(str); } - - -//# 26 "/projects/gnu-cygnus/gnu-cygnus-8/common/g++-include/String.h" 2 - -//# 1 "/projects/gnu-cygnus/gnu-cygnus-8/common/g++-include/Regex.h" 1 -// This may look like C code, but it is really -*- C++ -*- -/* -Copyright (C) 1988 Free Software Foundation - written by Doug Lea (dl@rocky.oswego.edu) - -This file is part of the GNU C++ Library. This library is free -software; you can redistribute it and/or modify it under the terms of -the GNU Library General Public License as published by the Free -Software Foundation; either version 2 of the License, or (at your -option) any later version. This library is distributed in the hope -that it will be useful, but WITHOUT ANY WARRANTY; without even the -implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR -PURPOSE. See the GNU Library General Public License for more details. -You should have received a copy of the GNU Library General Public -License along with this library; if not, write to the Free Software -Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. -*/ - - - - -//#pragma interface - - - - - - - - - -struct re_pattern_buffer; // defined elsewhere -struct re_registers; - -class Regex -{ -private: - - Regex(const Regex&) {} // no X(X&) - void operator = (const Regex&) {} // no assignment - -protected: - re_pattern_buffer* buf; - re_registers* reg; - -public: - Regex(const char* t, - int fast = 0, - int bufsize = 40, - const char* transtable = 0); - - ~Regex(); - - int match(const char* s, int len, int pos = 0) const; - int search(const char* s, int len, - int& matchlen, int startpos = 0) const; - int match_info(int& start, int& length, int nth = 0) const; - - int OK() const; // representation invariant -}; - -// some built in regular expressions - -extern const Regex RXwhite; // = "[ \n\t\r\v\f]+" -extern const Regex RXint; // = "-?[0-9]+" -extern const Regex RXdouble; // = "-?\\(\\([0-9]+\\.[0-9]*\\)\\| - // \\([0-9]+\\)\\|\\(\\.[0-9]+\\)\\) - // \\([eE][---+]?[0-9]+\\)?" -extern const Regex RXalpha; // = "[A-Za-z]+" -extern const Regex RXlowercase; // = "[a-z]+" -extern const Regex RXuppercase; // = "[A-Z]+" -extern const Regex RXalphanum; // = "[0-9A-Za-z]+" -extern const Regex RXidentifier; // = "[A-Za-z_][A-Za-z0-9_]*" - - - -//# 27 "/projects/gnu-cygnus/gnu-cygnus-8/common/g++-include/String.h" 2 - - -struct StrRep // internal String representations -{ - unsigned short len; // string length - unsigned short sz; // allocated space - char s[1]; // the string starts here - // (at least 1 char for trailing null) - // allocated & expanded via non-public fcts -}; - -// primitive ops on StrReps -- nearly all String fns go through these. - -StrRep* Salloc(StrRep*, const char*, int, int); -StrRep* Scopy(StrRep*, StrRep*); -StrRep* Sresize(StrRep*, int); -StrRep* Scat(StrRep*, const char*, int, const char*, int); -StrRep* Scat(StrRep*, const char*, int,const char*,int, const char*,int); -StrRep* Sprepend(StrRep*, const char*, int); -StrRep* Sreverse(StrRep*, StrRep*); -StrRep* Supcase(StrRep*, StrRep*); -StrRep* Sdowncase(StrRep*, StrRep*); -StrRep* Scapitalize(StrRep*, StrRep*); - -// These classes need to be defined in the order given - -class String; -class SubString; - -class SubString -{ - friend class String; -protected: - - String& S; // The String I'm a substring of - unsigned short pos; // starting position in S's rep - unsigned short len; // length of substring - - void assign(StrRep*, const char*, int = -1); - SubString(String& x, int p, int l); - SubString(const SubString& x); - -public: - -// Note there are no public constructors. SubStrings are always -// created via String operations - - ~SubString(); - - void operator = (const String& y); - void operator = (const SubString& y); - void operator = (const char* t); - void operator = (char c); - -// return 1 if target appears anywhere in SubString; else 0 - - int contains(char c) const; - int contains(const String& y) const; - int contains(const SubString& y) const; - int contains(const char* t) const; - int contains(const Regex& r) const; - -// return 1 if target matches entire SubString - - int matches(const Regex& r) const; - -// IO - - friend ostream& operator<<(ostream& s, const SubString& x); - -// status - - unsigned int length() const; - int empty() const; - const char* chars() const; - - int OK() const; - -}; - - -class String -{ - friend class SubString; - -protected: - StrRep* rep; // Strings are pointers to their representations - -// some helper functions - - int search(int, int, const char*, int = -1) const; - int search(int, int, char) const; - int match(int, int, int, const char*, int = -1) const; - int _gsub(const char*, int, const char* ,int); - int _gsub(const Regex&, const char*, int); - SubString _substr(int, int); - -public: - -// constructors & assignment - - String(); - String(const String& x); - String(const SubString& x); - String(const char* t); - String(const char* t, int len); - String(char c); - - ~String(); - - void operator = (const String& y); - void operator = (const char* y); - void operator = (char c); - void operator = (const SubString& y); - -// concatenation - - void operator += (const String& y); - void operator += (const SubString& y); - void operator += (const char* t); - void operator += (char c); - - void prepend(const String& y); - void prepend(const SubString& y); - void prepend(const char* t); - void prepend(char c); - - -// procedural versions: -// concatenate first 2 args, store result in last arg - - friend void cat(const String&, const String&, String&); - friend void cat(const String&, const SubString&, String&); - friend void cat(const String&, const char*, String&); - friend void cat(const String&, char, String&); - - friend void cat(const SubString&, const String&, String&); - friend void cat(const SubString&, const SubString&, String&); - friend void cat(const SubString&, const char*, String&); - friend void cat(const SubString&, char, String&); - - friend void cat(const char*, const String&, String&); - friend void cat(const char*, const SubString&, String&); - friend void cat(const char*, const char*, String&); - friend void cat(const char*, char, String&); - -// double concatenation, by request. (yes, there are too many versions, -// but if one is supported, then the others should be too...) -// Concatenate first 3 args, store in last arg - - friend void cat(const String&,const String&, const String&,String&); - friend void cat(const String&,const String&,const SubString&,String&); - friend void cat(const String&,const String&, const char*, String&); - friend void cat(const String&,const String&, char, String&); - friend void cat(const String&,const SubString&,const String&,String&); - friend void cat(const String&,const SubString&,const SubString&,String&); - friend void cat(const String&,const SubString&, const char*, String&); - friend void cat(const String&,const SubString&, char, String&); - friend void cat(const String&,const char*, const String&, String&); - friend void cat(const String&,const char*, const SubString&, String&); - friend void cat(const String&,const char*, const char*, String&); - friend void cat(const String&,const char*, char, String&); - - friend void cat(const char*, const String&, const String&,String&); - friend void cat(const char*,const String&,const SubString&,String&); - friend void cat(const char*,const String&, const char*, String&); - friend void cat(const char*,const String&, char, String&); - friend void cat(const char*,const SubString&,const String&,String&); - friend void cat(const char*,const SubString&,const SubString&,String&); - friend void cat(const char*,const SubString&, const char*, String&); - friend void cat(const char*,const SubString&, char, String&); - friend void cat(const char*,const char*, const String&, String&); - friend void cat(const char*,const char*, const SubString&, String&); - friend void cat(const char*,const char*, const char*, String&); - friend void cat(const char*,const char*, char, String&); - - -// searching & matching - -// return position of target in string or -1 for failure - - int index(char c, int startpos = 0) const; - int index(const String& y, int startpos = 0) const; - int index(const SubString& y, int startpos = 0) const; - int index(const char* t, int startpos = 0) const; - int index(const Regex& r, int startpos = 0) const; - -// return 1 if target appears anyhere in String; else 0 - - int contains(char c) const; - int contains(const String& y) const; - int contains(const SubString& y) const; - int contains(const char* t) const; - int contains(const Regex& r) const; - -// return 1 if target appears anywhere after position pos -// (or before, if pos is negative) in String; else 0 - - int contains(char c, int pos) const; - int contains(const String& y, int pos) const; - int contains(const SubString& y, int pos) const; - int contains(const char* t, int pos) const; - int contains(const Regex& r, int pos) const; - -// return 1 if target appears at position pos in String; else 0 - - int matches(char c, int pos = 0) const; - int matches(const String& y, int pos = 0) const; - int matches(const SubString& y, int pos = 0) const; - int matches(const char* t, int pos = 0) const; - int matches(const Regex& r, int pos = 0) const; - -// return number of occurences of target in String - - int freq(char c) const; - int freq(const String& y) const; - int freq(const SubString& y) const; - int freq(const char* t) const; - -// SubString extraction - -// Note that you can't take a substring of a const String, since -// this leaves open the possiblility of indirectly modifying the -// String through the SubString - - SubString at(int pos, int len); - SubString operator () (int pos, int len); // synonym for at - - SubString at(const String& x, int startpos = 0); - SubString at(const SubString& x, int startpos = 0); - SubString at(const char* t, int startpos = 0); - SubString at(char c, int startpos = 0); - SubString at(const Regex& r, int startpos = 0); - - SubString before(int pos); - SubString before(const String& x, int startpos = 0); - SubString before(const SubString& x, int startpos = 0); - SubString before(const char* t, int startpos = 0); - SubString before(char c, int startpos = 0); - SubString before(const Regex& r, int startpos = 0); - - SubString through(int pos); - SubString through(const String& x, int startpos = 0); - SubString through(const SubString& x, int startpos = 0); - SubString through(const char* t, int startpos = 0); - SubString through(char c, int startpos = 0); - SubString through(const Regex& r, int startpos = 0); - - SubString from(int pos); - SubString from(const String& x, int startpos = 0); - SubString from(const SubString& x, int startpos = 0); - SubString from(const char* t, int startpos = 0); - SubString from(char c, int startpos = 0); - SubString from(const Regex& r, int startpos = 0); - - SubString after(int pos); - SubString after(const String& x, int startpos = 0); - SubString after(const SubString& x, int startpos = 0); - SubString after(const char* t, int startpos = 0); - SubString after(char c, int startpos = 0); - SubString after(const Regex& r, int startpos = 0); - - -// deletion - -// delete len chars starting at pos - void del(int pos, int len); - -// delete the first occurrence of target after startpos - - void del(const String& y, int startpos = 0); - void del(const SubString& y, int startpos = 0); - void del(const char* t, int startpos = 0); - void del(char c, int startpos = 0); - void del(const Regex& r, int startpos = 0); - -// global substitution: substitute all occurrences of pat with repl - - int gsub(const String& pat, const String& repl); - int gsub(const SubString& pat, const String& repl); - int gsub(const char* pat, const String& repl); - int gsub(const char* pat, const char* repl); - int gsub(const Regex& pat, const String& repl); - -// friends & utilities - -// split string into array res at separators; return number of elements - - friend int split(const String& x, String res[], int maxn, - const String& sep); - friend int split(const String& x, String res[], int maxn, - const Regex& sep); - - friend String common_prefix(const String& x, const String& y, - int startpos = 0); - friend String common_suffix(const String& x, const String& y, - int startpos = -1); - friend String replicate(char c, int n); - friend String replicate(const String& y, int n); - friend String join(String src[], int n, const String& sep); - -// simple builtin transformations - - friend String reverse(const String& x); - friend String upcase(const String& x); - friend String downcase(const String& x); - friend String capitalize(const String& x); - -// in-place versions of above - - void reverse(); - void upcase(); - void downcase(); - void capitalize(); - -// element extraction - - char& operator [] (int i); - char elem(int i) const; - char firstchar() const; - char lastchar() const; - -// conversion - - operator const char*() const; - const char* chars() const; - - -// IO - - friend ostream& operator<<(ostream& s, const String& x); - friend ostream& operator<<(ostream& s, const SubString& x); - friend istream& operator>>(istream& s, String& x); - - friend int readline(istream& s, String& x, - char terminator = '\n', - int discard_terminator = 1); - -// status - - unsigned int length() const; - int empty() const; - -// preallocate some space for String - void alloc(int newsize); - -// report current allocation (not length!) - - int allocation() const; - - - volatile void error(const char* msg) const; - - int OK() const; -}; - -typedef String StrTmp; // for backward compatibility - -// other externs - -int compare(const String& x, const String& y); -int compare(const String& x, const SubString& y); -int compare(const String& x, const char* y); -int compare(const SubString& x, const String& y); -int compare(const SubString& x, const SubString& y); -int compare(const SubString& x, const char* y); -int fcompare(const String& x, const String& y); // ignore case - -extern StrRep _nilStrRep; -extern String _nilString; - -// other inlines - -String operator + (const String& x, const String& y); -String operator + (const String& x, const SubString& y); -String operator + (const String& x, const char* y); -String operator + (const String& x, char y); -String operator + (const SubString& x, const String& y); -String operator + (const SubString& x, const SubString& y); -String operator + (const SubString& x, const char* y); -String operator + (const SubString& x, char y); -String operator + (const char* x, const String& y); -String operator + (const char* x, const SubString& y); - -int operator==(const String& x, const String& y); -int operator!=(const String& x, const String& y); -int operator> (const String& x, const String& y); -int operator>=(const String& x, const String& y); -int operator< (const String& x, const String& y); -int operator<=(const String& x, const String& y); -int operator==(const String& x, const SubString& y); -int operator!=(const String& x, const SubString& y); -int operator> (const String& x, const SubString& y); -int operator>=(const String& x, const SubString& y); -int operator< (const String& x, const SubString& y); -int operator<=(const String& x, const SubString& y); -int operator==(const String& x, const char* t); -int operator!=(const String& x, const char* t); -int operator> (const String& x, const char* t); -int operator>=(const String& x, const char* t); -int operator< (const String& x, const char* t); -int operator<=(const String& x, const char* t); -int operator==(const SubString& x, const String& y); -int operator!=(const SubString& x, const String& y); -int operator> (const SubString& x, const String& y); -int operator>=(const SubString& x, const String& y); -int operator< (const SubString& x, const String& y); -int operator<=(const SubString& x, const String& y); -int operator==(const SubString& x, const SubString& y); -int operator!=(const SubString& x, const SubString& y); -int operator> (const SubString& x, const SubString& y); -int operator>=(const SubString& x, const SubString& y); -int operator< (const SubString& x, const SubString& y); -int operator<=(const SubString& x, const SubString& y); -int operator==(const SubString& x, const char* t); -int operator!=(const SubString& x, const char* t); -int operator> (const SubString& x, const char* t); -int operator>=(const SubString& x, const char* t); -int operator< (const SubString& x, const char* t); -int operator<=(const SubString& x, const char* t); - - - - -// status reports, needed before defining other things - -inline unsigned int String::length() const { return rep->len; } -inline int String::empty() const { return rep->len == 0; } -inline const char* String::chars() const { return &(rep->s[0]); } -inline int String::allocation() const { return rep->sz; } -inline void String::alloc(int newsize) { rep = Sresize(rep, newsize); } - -inline unsigned int SubString::length() const { return len; } -inline int SubString::empty() const { return len == 0; } -inline const char* SubString::chars() const { return &(S.rep->s[pos]); } - - -// constructors - -inline String::String() - : rep(&_nilStrRep) {} -inline String::String(const String& x) - : rep(Scopy(0, x.rep)) {} -inline String::String(const char* t) - : rep(Salloc(0, t, -1, -1)) {} -inline String::String(const char* t, int tlen) - : rep(Salloc(0, t, tlen, tlen)) {} -inline String::String(const SubString& y) - : rep(Salloc(0, y.chars(), y.length(), y.length())) {} -inline String::String(char c) - : rep(Salloc(0, &c, 1, 1)) {} - -inline String::~String() { if (rep != &_nilStrRep) delete rep; } - -inline SubString::SubString(const SubString& x) - :S(x.S), pos(x.pos), len(x.len) {} -inline SubString::SubString(String& x, int first, int l) - :S(x), pos(first), len(l) {} - -inline SubString::~SubString() {} - -// assignment - -inline void String::operator = (const String& y) -{ - rep = Scopy(rep, y.rep); -} - -inline void String::operator=(const char* t) -{ - rep = Salloc(rep, t, -1, -1); -} - -inline void String::operator=(const SubString& y) -{ - rep = Salloc(rep, y.chars(), y.length(), y.length()); -} - -inline void String::operator=(char c) -{ - rep = Salloc(rep, &c, 1, 1); -} - - -inline void SubString::operator = (const char* ys) -{ - assign(0, ys); -} - -inline void SubString::operator = (char ch) -{ - assign(0, &ch, 1); -} - -inline void SubString::operator = (const String& y) -{ - assign(y.rep, y.chars(), y.length()); -} - -inline void SubString::operator = (const SubString& y) -{ - assign(y.S.rep, y.chars(), y.length()); -} - -// Zillions of cats... - -inline void cat(const String& x, const String& y, String& r) -{ - r.rep = Scat(r.rep, x.chars(), x.length(), y.chars(), y.length()); -} - -inline void cat(const String& x, const SubString& y, String& r) -{ - r.rep = Scat(r.rep, x.chars(), x.length(), y.chars(), y.length()); -} - -inline void cat(const String& x, const char* y, String& r) -{ - r.rep = Scat(r.rep, x.chars(), x.length(), y, -1); -} - -inline void cat(const String& x, char y, String& r) -{ - r.rep = Scat(r.rep, x.chars(), x.length(), &y, 1); -} - -inline void cat(const SubString& x, const String& y, String& r) -{ - r.rep = Scat(r.rep, x.chars(), x.length(), y.chars(), y.length()); -} - -inline void cat(const SubString& x, const SubString& y, String& r) -{ - r.rep = Scat(r.rep, x.chars(), x.length(), y.chars(), y.length()); -} - -inline void cat(const SubString& x, const char* y, String& r) -{ - r.rep = Scat(r.rep, x.chars(), x.length(), y, -1); -} - -inline void cat(const SubString& x, char y, String& r) -{ - r.rep = Scat(r.rep, x.chars(), x.length(), &y, 1); -} - -inline void cat(const char* x, const String& y, String& r) -{ - r.rep = Scat(r.rep, x, -1, y.chars(), y.length()); -} - -inline void cat(const char* x, const SubString& y, String& r) -{ - r.rep = Scat(r.rep, x, -1, y.chars(), y.length()); -} - -inline void cat(const char* x, const char* y, String& r) -{ - r.rep = Scat(r.rep, x, -1, y, -1); -} - -inline void cat(const char* x, char y, String& r) -{ - r.rep = Scat(r.rep, x, -1, &y, 1); -} - -inline void cat(const String& a, const String& x, const String& y, String& r) -{ - r.rep = Scat(r.rep, a.chars(), a.length(), x.chars(), x.length(), y.chars(), y.length()); -} - -inline void cat(const String& a, const String& x, const SubString& y, String& r) -{ - r.rep = Scat(r.rep, a.chars(), a.length(), x.chars(), x.length(), y.chars(), y.length()); -} - -inline void cat(const String& a, const String& x, const char* y, String& r) -{ - r.rep = Scat(r.rep, a.chars(), a.length(), x.chars(), x.length(), y, -1); -} - -inline void cat(const String& a, const String& x, char y, String& r) -{ - r.rep = Scat(r.rep, a.chars(), a.length(), x.chars(), x.length(), &y, 1); -} - -inline void cat(const String& a, const SubString& x, const String& y, String& r) -{ - r.rep = Scat(r.rep, a.chars(), a.length(), x.chars(), x.length(), y.chars(), y.length()); -} - -inline void cat(const String& a, const SubString& x, const SubString& y, String& r) -{ - r.rep = Scat(r.rep, a.chars(), a.length(), x.chars(), x.length(), y.chars(), y.length()); -} - -inline void cat(const String& a, const SubString& x, const char* y, String& r) -{ - r.rep = Scat(r.rep, a.chars(), a.length(), x.chars(), x.length(), y, -1); -} - -inline void cat(const String& a, const SubString& x, char y, String& r) -{ - r.rep = Scat(r.rep, a.chars(), a.length(), x.chars(), x.length(), &y, 1); -} - -inline void cat(const String& a, const char* x, const String& y, String& r) -{ - r.rep = Scat(r.rep, a.chars(), a.length(), x, -1, y.chars(), y.length()); -} - -inline void cat(const String& a, const char* x, const SubString& y, String& r) -{ - r.rep = Scat(r.rep, a.chars(), a.length(), x, -1, y.chars(), y.length()); -} - -inline void cat(const String& a, const char* x, const char* y, String& r) -{ - r.rep = Scat(r.rep, a.chars(), a.length(), x, -1, y, -1); -} - -inline void cat(const String& a, const char* x, char y, String& r) -{ - r.rep = Scat(r.rep, a.chars(), a.length(), x, -1, &y, 1); -} - - -inline void cat(const char* a, const String& x, const String& y, String& r) -{ - r.rep = Scat(r.rep, a, -1, x.chars(), x.length(), y.chars(), y.length()); -} - -inline void cat(const char* a, const String& x, const SubString& y, String& r) -{ - r.rep = Scat(r.rep, a, -1, x.chars(), x.length(), y.chars(), y.length()); -} - -inline void cat(const char* a, const String& x, const char* y, String& r) -{ - r.rep = Scat(r.rep, a, -1, x.chars(), x.length(), y, -1); -} - -inline void cat(const char* a, const String& x, char y, String& r) -{ - r.rep = Scat(r.rep, a, -1, x.chars(), x.length(), &y, 1); -} - -inline void cat(const char* a, const SubString& x, const String& y, String& r) -{ - r.rep = Scat(r.rep, a, -1, x.chars(), x.length(), y.chars(), y.length()); -} - -inline void cat(const char* a, const SubString& x, const SubString& y, String& r) -{ - r.rep = Scat(r.rep, a, -1, x.chars(), x.length(), y.chars(), y.length()); -} - -inline void cat(const char* a, const SubString& x, const char* y, String& r) -{ - r.rep = Scat(r.rep, a, -1, x.chars(), x.length(), y, -1); -} - -inline void cat(const char* a, const SubString& x, char y, String& r) -{ - r.rep = Scat(r.rep, a, -1, x.chars(), x.length(), &y, 1); -} - -inline void cat(const char* a, const char* x, const String& y, String& r) -{ - r.rep = Scat(r.rep, a, -1, x, -1, y.chars(), y.length()); -} - -inline void cat(const char* a, const char* x, const SubString& y, String& r) -{ - r.rep = Scat(r.rep, a, -1, x, -1, y.chars(), y.length()); -} - -inline void cat(const char* a, const char* x, const char* y, String& r) -{ - r.rep = Scat(r.rep, a, -1, x, -1, y, -1); -} - -inline void cat(const char* a, const char* x, char y, String& r) -{ - r.rep = Scat(r.rep, a, -1, x, -1, &y, 1); -} - - -// operator versions - -inline void String::operator +=(const String& y) -{ - cat(*this, y, *this); -} - -inline void String::operator +=(const SubString& y) -{ - cat(*this, y, *this); -} - -inline void String::operator += (const char* y) -{ - cat(*this, y, *this); -} - -inline void String:: operator +=(char y) -{ - cat(*this, y, *this); -} - -// constructive concatenation - - - -inline String operator + (const String& x, const String& y) return r; -{ - cat(x, y, r); -} - -inline String operator + (const String& x, const SubString& y) return r; -{ - cat(x, y, r); -} - -inline String operator + (const String& x, const char* y) return r; -{ - cat(x, y, r); -} - -inline String operator + (const String& x, char y) return r; -{ - cat(x, y, r); -} - -inline String operator + (const SubString& x, const String& y) return r; -{ - cat(x, y, r); -} - -inline String operator + (const SubString& x, const SubString& y) return r; -{ - cat(x, y, r); -} - -inline String operator + (const SubString& x, const char* y) return r; -{ - cat(x, y, r); -} - -inline String operator + (const SubString& x, char y) return r; -{ - cat(x, y, r); -} - -inline String operator + (const char* x, const String& y) return r; -{ - cat(x, y, r); -} - -inline String operator + (const char* x, const SubString& y) return r; -{ - cat(x, y, r); -} - -inline String reverse(const String& x) return r; -{ - r.rep = Sreverse(x.rep, r.rep); -} - -inline String upcase(const String& x) return r; -{ - r.rep = Supcase(x.rep, r.rep); -} - -inline String downcase(const String& x) return r; -{ - r.rep = Sdowncase(x.rep, r.rep); -} - -inline String capitalize(const String& x) return r; -{ - r.rep = Scapitalize(x.rep, r.rep); -} - -//# 883 "/projects/gnu-cygnus/gnu-cygnus-8/common/g++-include/String.h" - - -// prepend - -inline void String::prepend(const String& y) -{ - rep = Sprepend(rep, y.chars(), y.length()); -} - -inline void String::prepend(const char* y) -{ - rep = Sprepend(rep, y, -1); -} - -inline void String::prepend(char y) -{ - rep = Sprepend(rep, &y, 1); -} - -inline void String::prepend(const SubString& y) -{ - rep = Sprepend(rep, y.chars(), y.length()); -} - -// misc transformations - - -inline void String::reverse() -{ - rep = Sreverse(rep, rep); -} - - -inline void String::upcase() -{ - rep = Supcase(rep, rep); -} - - -inline void String::downcase() -{ - rep = Sdowncase(rep, rep); -} - - -inline void String::capitalize() -{ - rep = Scapitalize(rep, rep); -} - -// element extraction - -inline char& String::operator [] (int i) -{ - if (((unsigned)i) >= length()) error("invalid index"); - return rep->s[i]; -} - -inline char String::elem (int i) const -{ - if (((unsigned)i) >= length()) error("invalid index"); - return rep->s[i]; -} - -inline char String::firstchar() const -{ - return elem(0); -} - -inline char String::lastchar() const -{ - return elem(length() - 1); -} - -// searching - -inline int String::index(char c, int startpos) const -{ - return search(startpos, length(), c); -} - -inline int String::index(const char* t, int startpos) const -{ - return search(startpos, length(), t); -} - -inline int String::index(const String& y, int startpos) const -{ - return search(startpos, length(), y.chars(), y.length()); -} - -inline int String::index(const SubString& y, int startpos) const -{ - return search(startpos, length(), y.chars(), y.length()); -} - -inline int String::index(const Regex& r, int startpos) const -{ - int unused; return r.search(chars(), length(), unused, startpos); -} - -inline int String::contains(char c) const -{ - return search(0, length(), c) >= 0; -} - -inline int String::contains(const char* t) const -{ - return search(0, length(), t) >= 0; -} - -inline int String::contains(const String& y) const -{ - return search(0, length(), y.chars(), y.length()) >= 0; -} - -inline int String::contains(const SubString& y) const -{ - return search(0, length(), y.chars(), y.length()) >= 0; -} - -inline int String::contains(char c, int p) const -{ - return match(p, length(), 0, &c, 1) >= 0; -} - -inline int String::contains(const char* t, int p) const -{ - return match(p, length(), 0, t) >= 0; -} - -inline int String::contains(const String& y, int p) const -{ - return match(p, length(), 0, y.chars(), y.length()) >= 0; -} - -inline int String::contains(const SubString& y, int p) const -{ - return match(p, length(), 0, y.chars(), y.length()) >= 0; -} - -inline int String::contains(const Regex& r) const -{ - int unused; return r.search(chars(), length(), unused, 0) >= 0; -} - -inline int String::contains(const Regex& r, int p) const -{ - return r.match(chars(), length(), p) >= 0; -} - - -inline int String::matches(const SubString& y, int p) const -{ - return match(p, length(), 1, y.chars(), y.length()) >= 0; -} - -inline int String::matches(const String& y, int p) const -{ - return match(p, length(), 1, y.chars(), y.length()) >= 0; -} - -inline int String::matches(const char* t, int p) const -{ - return match(p, length(), 1, t) >= 0; -} - -inline int String::matches(char c, int p) const -{ - return match(p, length(), 1, &c, 1) >= 0; -} - -inline int String::matches(const Regex& r, int p) const -{ - int l = (p < 0)? -p : length() - p; - return r.match(chars(), length(), p) == l; -} - - -inline int SubString::contains(const char* t) const -{ - return S.search(pos, pos+len, t) >= 0; -} - -inline int SubString::contains(const String& y) const -{ - return S.search(pos, pos+len, y.chars(), y.length()) >= 0; -} - -inline int SubString::contains(const SubString& y) const -{ - return S.search(pos, pos+len, y.chars(), y.length()) >= 0; -} - -inline int SubString::contains(char c) const -{ - return S.search(pos, pos+len, 0, c) >= 0; -} - -inline int SubString::contains(const Regex& r) const -{ - int unused; return r.search(chars(), len, unused, 0) >= 0; -} - -inline int SubString::matches(const Regex& r) const -{ - return r.match(chars(), len, 0) == len; -} - - -inline int String::gsub(const String& pat, const String& r) -{ - return _gsub(pat.chars(), pat.length(), r.chars(), r.length()); -} - -inline int String::gsub(const SubString& pat, const String& r) -{ - return _gsub(pat.chars(), pat.length(), r.chars(), r.length()); -} - -inline int String::gsub(const Regex& pat, const String& r) -{ - return _gsub(pat, r.chars(), r.length()); -} - -inline int String::gsub(const char* pat, const String& r) -{ - return _gsub(pat, -1, r.chars(), r.length()); -} - -inline int String::gsub(const char* pat, const char* r) -{ - return _gsub(pat, -1, r, -1); -} - - - -inline ostream& operator<<(ostream& s, const String& x) -{ - s << x.chars(); return s; -} - -// a zillion comparison operators - -inline int operator==(const String& x, const String& y) -{ - return compare(x, y) == 0; -} - -inline int operator!=(const String& x, const String& y) -{ - return compare(x, y) != 0; -} - -inline int operator>(const String& x, const String& y) -{ - return compare(x, y) > 0; -} - -inline int operator>=(const String& x, const String& y) -{ - return compare(x, y) >= 0; -} - -inline int operator<(const String& x, const String& y) -{ - return compare(x, y) < 0; -} - -inline int operator<=(const String& x, const String& y) -{ - return compare(x, y) <= 0; -} - -inline int operator==(const String& x, const SubString& y) -{ - return compare(x, y) == 0; -} - -inline int operator!=(const String& x, const SubString& y) -{ - return compare(x, y) != 0; -} - -inline int operator>(const String& x, const SubString& y) -{ - return compare(x, y) > 0; -} - -inline int operator>=(const String& x, const SubString& y) -{ - return compare(x, y) >= 0; -} - -inline int operator<(const String& x, const SubString& y) -{ - return compare(x, y) < 0; -} - -inline int operator<=(const String& x, const SubString& y) -{ - return compare(x, y) <= 0; -} - -inline int operator==(const String& x, const char* t) -{ - return compare(x, t) == 0; -} - -inline int operator!=(const String& x, const char* t) -{ - return compare(x, t) != 0; -} - -inline int operator>(const String& x, const char* t) -{ - return compare(x, t) > 0; -} - -inline int operator>=(const String& x, const char* t) -{ - return compare(x, t) >= 0; -} - -inline int operator<(const String& x, const char* t) -{ - return compare(x, t) < 0; -} - -inline int operator<=(const String& x, const char* t) -{ - return compare(x, t) <= 0; -} - -inline int operator==(const SubString& x, const String& y) -{ - return compare(y, x) == 0; -} - -inline int operator!=(const SubString& x, const String& y) -{ - return compare(y, x) != 0; -} - -inline int operator>(const SubString& x, const String& y) -{ - return compare(y, x) < 0; -} - -inline int operator>=(const SubString& x, const String& y) -{ - return compare(y, x) <= 0; -} - -inline int operator<(const SubString& x, const String& y) -{ - return compare(y, x) > 0; -} - -inline int operator<=(const SubString& x, const String& y) -{ - return compare(y, x) >= 0; -} - -inline int operator==(const SubString& x, const SubString& y) -{ - return compare(x, y) == 0; -} - -inline int operator!=(const SubString& x, const SubString& y) -{ - return compare(x, y) != 0; -} - -inline int operator>(const SubString& x, const SubString& y) -{ - return compare(x, y) > 0; -} - -inline int operator>=(const SubString& x, const SubString& y) -{ - return compare(x, y) >= 0; -} - -inline int operator<(const SubString& x, const SubString& y) -{ - return compare(x, y) < 0; -} - -inline int operator<=(const SubString& x, const SubString& y) -{ - return compare(x, y) <= 0; -} - -inline int operator==(const SubString& x, const char* t) -{ - return compare(x, t) == 0; -} - -inline int operator!=(const SubString& x, const char* t) -{ - return compare(x, t) != 0; -} - -inline int operator>(const SubString& x, const char* t) -{ - return compare(x, t) > 0; -} - -inline int operator>=(const SubString& x, const char* t) -{ - return compare(x, t) >= 0; -} - -inline int operator<(const SubString& x, const char* t) -{ - return compare(x, t) < 0; -} - -inline int operator<=(const SubString& x, const char* t) -{ - return compare(x, t) <= 0; -} - - -// a helper needed by at, before, etc. - -inline SubString String::_substr(int first, int l) -{ - if (first >= length() ) // ??? THIS LINE IS QUESTIONABLE - return SubString(_nilString, 0, 0) ; - else - return SubString(*this, first, l); -} - - - - - -//# 26 "../../GctSymbol.h" 2 - - -//# 1 "../../../../../../mips/include/Gct/Object/GctHashObject.h" 1 -// -*- C++ -*- - - - -// -// GctHashObject class (is abstract) -// -// Expects to be included by Object.h or where needed explicitly. -// -// Wendell Baker, Berkeley CAD Group, 1992 (wbaker@ic.Berkeley.EDU) -// - - - - - -//#pragma interface - - - -//# 1 "../../../../../../mips/include/Gct/Object/GctObject.h" 1 -// -*- C++ -*- - - - -// -// GctObject class (is abstract) -// -// Expects to be included by Object.h or where needed explicitly. -// -// Wendell Baker, Berkeley CAD Group, 1992 (wbaker@ic.Berkeley.EDU) -// - - - - - -//#pragma interface - - - -//# 1 "/sandbox/wbaker/wbaker0/source/mips/include/tostrstream.h" 1 -// -*- C++ -*- - - - -// -// tostrstream class -// -// A terminated oststream - an ostsrstream that auto-terminates on str() -// -// Wendell Baker, Berkeley CAD Group, 1992 (wbaker@ic.Berkeley.EDU) -// - - - - - -//#pragma interface - - - -//# 1 "/projects/gnu-cygnus/gnu-cygnus-8/common/g++-include/strstream.h" 1 -// This is part of the iostream library, providing input/output for C++. -// Copyright (C) 1991 Per Bothner. -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Library General Public -// License as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Library General Public License for more details. -// -// You should have received a copy of the GNU Library General Public -// License along with this library; if not, write to the Free -// Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - - - - -//#pragma interface - -//# 1 "/projects/gnu-cygnus/gnu-cygnus-8/common/g++-include/iostream.h" 1 -// This is part of the iostream library, providing -*- C++ -*- input/output. -// Copyright (C) 1991 Per Bothner. -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Library General Public -// License as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Library General Public License for more details. -// -// You should have received a copy of the GNU Library General Public -// License along with this library; if not, write to the Free -// Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - -//# 210 "/projects/gnu-cygnus/gnu-cygnus-8/common/g++-include/iostream.h" - -//# 23 "/projects/gnu-cygnus/gnu-cygnus-8/common/g++-include/strstream.h" 2 - - -class strstreambuf : public streambuf { - size_t *lenp; /* current (logical) length (i.e. valid data bytes) */ - size_t *sizep; /* allocated (physical) buffer size */ - char **bufp; - size_t _len; - size_t _size; - char *buf; - int _frozen; - protected: - virtual int overflow(int = (-1) ); - public: - strstreambuf(); - strstreambuf(int initial); - strstreambuf(char *ptr, int size, char *pstart = (__null) ); - ~strstreambuf(); - int frozen() { return _frozen; } - void freeze(int n=1) { _frozen = n != 0; } - size_t pcount(); - char *str(); -}; - -class istrstream : public istream { - public: - istrstream(char*); - istrstream(char*, int); - strstreambuf* rdbuf() { return (strstreambuf*)_strbuf; } -}; - -class ostrstream : public ostream { - public: - ostrstream(); - ostrstream(char *cp, int n, int mode=ios::out); - size_t pcount() { return ((strstreambuf*)_strbuf)->pcount(); } - char *str() { return ((strstreambuf*)_strbuf)->str(); } - void freeze(int n = 1) { ((strstreambuf*)_strbuf)->freeze(n); } - int frozen() { return ((strstreambuf*)_strbuf)->frozen(); } - strstreambuf* rdbuf() { return (strstreambuf*)_strbuf; } -}; - - -//# 25 "/sandbox/wbaker/wbaker0/source/mips/include/tostrstream.h" 2 - - -// -// tostrstream class -// -// An isteam class that doesn't have that nasty skipws parameter that -// you have to remember to set. This class simply provides the istream -// functionality with a set of constructors which defaults skipws to -// FALSE (instead of defaulting to TRUE as is the case with plain istream). -// -class tostrstream: public ostrstream { -public: - tostrstream(): ostrstream() - { } - // This constructor defines cp as the buffer to use for the - // stream (instead of one of its own devising); it does NOT - // initialize the ostrstream to contain cp (of length n). - tostrstream(char *cp, int n, int mode=ios::out): ostrtream(cp, n, mode) // ERROR - - { } - char *str() - { - char *s = ostrstream::str(); - s[ostrstream::pcount()] = '\0'; - return s; - } -}; - - -//# 25 "../../../../../../mips/include/Gct/Object/GctObject.h" 2 - - -//# 1 "/sandbox/wbaker/wbaker0/source/mips/include/Gtt/GttObject.h" 1 -// -*- C++ -*- - - - -// -// GttObject class (is abstract) -// -// Expects to be included where needed explicitly. -// -// Wendell Baker, Berkeley CAD Group, 1992 (wbaker@ic.Berkeley.EDU) -// - - - - - -//#pragma interface - - - -//# 1 "/sandbox/wbaker/wbaker0/source/mips/include/tostrstream.h" 1 -// -*- C++ -*- -//# 52 "/sandbox/wbaker/wbaker0/source/mips/include/tostrstream.h" - -//# 25 "/sandbox/wbaker/wbaker0/source/mips/include/Gtt/GttObject.h" 2 - - -//# 1 "/sandbox/wbaker/wbaker0/source/mips/include/Gtt/GttErrorHandler.h" 1 -// -*- C++ -*- - - - -// -// GttErrorHandler class -// -// Expects to be included by Gtt.h -// -// Wendell Baker, Berkeley CAD Group, 1992 (wbaker@ic.Berkeley.EDU) -// - - - - - -//#pragma interface - - - -//# 1 "/projects/gnu-cygnus/gnu-cygnus-8/common/g++-include/bool.h" 1 - - - - - - - -//# 25 "/sandbox/wbaker/wbaker0/source/mips/include/Gtt/GttErrorHandler.h" 2 - - -//# 1 "/sandbox/wbaker/wbaker0/source/mips/include/stuff++.h" 1 -// -*- C++ -*- - - - -// -// Fake up a libstuff++ -// -// This is done as a complete and utter hack; this library has no function -// at all being in the boot area; it is here solely in order to provide a -// libstuff++ against which the Makefiles can resolve link lines. -// -// The only reason that this is done is to allow the STANDARD_C++_LIBRARIES -// as provided by the Makefile templates in the boot area to be the same -// ones that are used by the tools outside this hierarchy. -// -// The tools outside this hierarchy use a different libstuff++; one that is -// written in C++. This one is not written in C++ in order to be simpler. -// - - - - - -//#pragma interface - - - -extern "C" { -//# 1 "/sandbox/wbaker/wbaker0/source/mips/include/stuff.h" 1 - - - -/* - * Useful stuff - */ - -/* - */ - -//# 1 "/sandbox/wbaker/wbaker0/source/mips/include/ansi.h" 1 - - - - -/* - * ANSI Compiler Support - * - * David Harrison - * University of California, Berkeley - * 1988 - * - * ANSI compatible compilers are supposed to define the preprocessor - * directive __STDC__. Based on this directive, this file defines - * certain ANSI specific macros. - * - * ARGS: - * Used in function prototypes. Example: - * extern int foo - * ARGS((char *blah, double threshold)); - */ - -/* - * - * Modifications - * Wendell C Baker - * University of California, Berkeley - */ - -/* Function prototypes */ - - - - - - - - - - - - - - - - - - - - - - - - - - - -//# 15 "/sandbox/wbaker/wbaker0/source/mips/include/stuff.h" 2 - - - -/* - * If g++, then we stub out part of this thing and let the C++ types take - * over and do the same job; some compatibility must be given however - */ - -/* - * Use the GNU libg++ definition - */ -//# 1 "/projects/gnu-cygnus/gnu-cygnus-8/common/g++-include/bool.h" 1 - - - - - - - -//# 26 "/sandbox/wbaker/wbaker0/source/mips/include/stuff.h" 2 - -//# 35 "/sandbox/wbaker/wbaker0/source/mips/include/stuff.h" - - -/* - * Make various pieces of C code that use the old ``Boolean'' - * be compatible by faking up the definition of Boolean using - * the new bool type. - */ - - -//# 58 "/sandbox/wbaker/wbaker0/source/mips/include/stuff.h" - - -typedef long FitAny; /* can fit any integral type */ - -/* - * typedef char *String; - DO NOT USE THIS - it conflicts with C++ - * typedef char **Stringv; - just use char* and char** instead. - * - void* can be used for arbitrary pointers - */ - - - - -extern int nocase_strcmp (char *, char *) ; -extern int nocase_strncmp (char *, char *, int) ; - -extern bool nocase_strequal (char *, char *) ; -extern bool nocase_strnequal (char *, char *, int) ; - -extern bool lead_strequal (char *, char *) ; -extern bool nocase_lead_strequal (char *, char *) ; - -extern int strhash (char *, int) ; -extern int nocase_strhash (char *, int) ; - -extern int sign (int) ; - -/* - * Some useful macros. - */ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -//# 33 "/sandbox/wbaker/wbaker0/source/mips/include/stuff++.h" 2 - -} - -// -// This is here because we wish to provide externs for the two -// functions btoa(bool, unsigned = 0) and operator<<(ostream&, bool) -// because they are not provided in bool.h. -// -//# 1 "/projects/gnu-cygnus/gnu-cygnus-8/common/g++-include/bool.h" 1 - - - - - - - -//# 41 "/sandbox/wbaker/wbaker0/source/mips/include/stuff++.h" 2 - -extern const char *stringify(bool b); -//# 1 "/projects/gnu-cygnus/gnu-cygnus-8/common/g++-include/iostream.h" 1 -// This is part of the iostream library, providing -*- C++ -*- input/output. -// Copyright (C) 1991 Per Bothner. -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Library General Public -// License as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Library General Public License for more details. -// -// You should have received a copy of the GNU Library General Public -// License along with this library; if not, write to the Free -// Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - -//# 210 "/projects/gnu-cygnus/gnu-cygnus-8/common/g++-include/iostream.h" - -//# 43 "/sandbox/wbaker/wbaker0/source/mips/include/stuff++.h" 2 - -extern ostream& operator<<(ostream&, bool); - -// Should this be kept separate? bool isn't, but then is -// included here only to define ostream& operator<<(ostream&, bool) -//# 1 "/sandbox/wbaker/wbaker0/source/mips/include/unit.h" 1 -// -*- C++ -*- - - - -// -// unit enum -// -// Wendell Baker, Berkeley CAD Group, 1991 (wbaker@ic.Berkeley.EDU) -// - - -// -// unit enum -// -// This _looks_ silly, but it has an important theoretical basis in category -// theory. For the pragmatic reason for its existence, see the example below. -// -enum unit { - UNIT = 1, -}; - -extern const char *stringify(unit u); - -//# 1 "/projects/gnu-cygnus/gnu-cygnus-8/common/g++-include/iostream.h" 1 -// This is part of the iostream library, providing -*- C++ -*- input/output. -// Copyright (C) 1991 Per Bothner. -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Library General Public -// License as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Library General Public License for more details. -// -// You should have received a copy of the GNU Library General Public -// License along with this library; if not, write to the Free -// Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - -//# 210 "/projects/gnu-cygnus/gnu-cygnus-8/common/g++-include/iostream.h" - -//# 28 "/sandbox/wbaker/wbaker0/source/mips/include/unit.h" 2 - -extern ostream& operator<<(ostream&, unit); - -// -// A unit is used in cases where the type signature of an overloaded -// function must be differentiated in some stronger way than can be -// denoted unambiguously in the C++ syntax. This enum is used to give -// one of the functions a different type signature, thereby allowing -// the overloading. -// -// The use of ``unit'' instead of int or bool is important because a unit -// has only one possible value; therefore it adds no more information to -// the code. For example, say a bool was used instead, then in the testing -// phase, would have to ask: what if TRUE was given, what if FALSE was given. -// The problem is compounded if char or int is used. -// -// Example: -// -// class ID { -// public: -// ID(); // construct a null ID -// ID(unit); // alloc a ID with a new id -// private: -// static unsigned high_water; -// unsigned id; -// }; -// -// Try working this example save that ID implements all of the generic -// features of the identifier object, but the high_water is stored -// in the heir. That is what originally motivated the creation of unit. -// - - -//# 48 "/sandbox/wbaker/wbaker0/source/mips/include/stuff++.h" 2 - - -// -// In the spirit of the standard GNU error handler functions -// as described in -// typedef void (*one_arg_error_handler_t)(const char*); -// a one argument error handler function pointer -// typedef void (*two_arg_error_handler_t)(const char*, const char*); -// a two argument error handler function pointer -// -// And now the NEW -// -// typedef void (*zero_arg_error_handler_t)(); -// a zero argument error handler function pointer -// -typedef void (*zero_arg_error_handler_t)(); - -// -// In the spirit of the default GNU error handler functions -// as described in -// extern void default_one_arg_error_handler(const char *message); -// print out message on stderr, and do the default thing (abort) -// extern void default_two_arg_error_handler(const char *kind, const char *message); -// print out kind and message on stderr, and do the default thing (abort) -// -// And now the NEW -// -// extern void default_zero_arg_error_handler(const char *message); -// do the default thing (abort) -// -extern void default_zero_arg_error_handler(); - -// Guaranteed to exit (1) -extern void exit_zero_arg_error_handler(); -extern void exit_one_arg_error_handler(const char *message); -extern void exit_two_arg_error_handler(const char *kind, const char *message); - -// Guaranteed to abort() -extern void abort_zero_arg_error_handler(); -extern void abort_one_arg_error_handler(const char *message); -extern void abort_two_arg_error_handler(const char *kind, const char *message); - -// -// In the spirit of the standard GNU error handlers -// as described in -// extern void verbose_File_error_handler(const char*); -// perror and set errno = 0 -// extern void quiet_File_error_handler(const char*); -// set errno = 0 -// extern void fatal_File_error_handler(const char*); -// perror and exit 1 -// -// And now the NEW -// -// extern void preserve_File_error_handler(const char *message); -// no perror, no assignment to errno. -// -extern void preserve_File_error_handler(const char *message); - - -//# 27 "/sandbox/wbaker/wbaker0/source/mips/include/Gtt/GttErrorHandler.h" 2 - -//# 1 "/sandbox/wbaker/wbaker0/source/mips/include/tostrstream.h" 1 -// -*- C++ -*- -//# 52 "/sandbox/wbaker/wbaker0/source/mips/include/tostrstream.h" - -//# 28 "/sandbox/wbaker/wbaker0/source/mips/include/Gtt/GttErrorHandler.h" 2 - - -// -// It is expected that this will be virtually multiply inherited -// into all of the classes that need error reporting services. -// -// The typical way to have that done is by inheriting the GttObject -// as a virtual base class. -// - -// -// GttErrorHandler class -// -class GttErrorHandler { -public: - GttErrorHandler(); - GttErrorHandler(const char *program); - virtual ~GttErrorHandler(); - - // - // Error messages - // - an unacceptable, but expected and recoverable condition - // was detected (but the test fails) - // - errors are for ``the expected environment was not found'' - // rather than for ``file couldn't be opened'' - // - these messages cannot be shut off - // - the error handler determines the recovery action - // TODO - one day exceptions will be used here - // - static void error(const char *message); - static void error(tostrstream& message); - - static void error(const char *function, const char *message); - static void error(const char *function, tostrstream& message); - - static void error(const char *class_name, const char *method, const char *message); - static void error(const char *class_name, const char *method, tostrstream& message); - - // - // Fatal messages - // - an unacceptable and unexpected error was detected - // the data invariants were violated, there is no recovery - // - these messages cannot be shut off - // - the error handler determines the recovery action - // TODO - one day exceptions will be used here - // - static void fatal(const char *message); - static void fatal(tostrstream& message); - - static void fatal(const char *function, const char *message); - static void fatal(const char *function, tostrstream& message); - - static void fatal(const char *class_name, const char *method, const char *message); - static void fatal(const char *class_name, const char *method, tostrstream& message); -private: - // - // Two underscores are used here in order to prevent confusion of these - // private variables with any of the heir's private variables. Note that - // access control is different than visibility in C++, so all the variable - // names in a class hierarchy must be unique. - // - - static bool __partial_init; - static void __partial_initialize(); - static bool __full_init; - static void __full_initialize(const char *program); - static char *__program; - - static void __handle_error(); - static void __handle_fatal(); - static void __add_newline(const char *message); - - static bool __output_valid(); - static ostream *__output; -}; - - -//# 27 "/sandbox/wbaker/wbaker0/source/mips/include/Gtt/GttObject.h" 2 - - -// -// GttObject class (is abstract) -// -class GttObject: virtual public GttErrorHandler { -protected: - GttObject(); - GttObject(const GttObject&); - virtual ~GttObject(); // ensure descendants have virtual destructors - -public: - // - // I/O Support - // - // The value typically persists only long enough for an i/o operation - // to be performed (see the defintion of output via operator<<(... ) below) - virtual const char *stringify(); -protected: - // This is the buffer into which the printed representation of this - // object will be put when the time comes. It is associated with the - // object so it will never go away (so long as the object exists). - // Use a pointer so that you only pay for the space when I/O is used - tostrstream *stringbuf; - void clear_stringbuf(); - -public: - // - // Consistency - // - // The global data invariant for the whole object (heirs included). - // This OK function will call the local invariant function ok() if - // necessary and in addition the OK functions of the heirs - // This is expected to compute the data invariant of the object. - // It will execute GctErrorHandler::fatal if there is wrong. - virtual void OK() const; - -protected: - // - // consistency - // - // This function computes the invariant which is local to this object. - // It does not call any of the ancestor's OK() or ok() functions. - // It is not a virtual function so that it can be called from within a - // constructor with impunity. Thus this function MUST NOT call any - // virtual functions either; it should call them by their full name if - // that is necessary. The global OK() function will call this function - // as necessary. - // - // This function must NOT NEVER EVER be made virtual. - void ok() const; - -protected: - // - // Class Name - // - // This must return a static (constant) string which is the name - // of the class being declared. By convention, not all classes - // must have one of these, but the major root abstract class must - // have one in order to allow the stringify() to work approximately - // correctly. - virtual const char *class_name() const = 0; -}; - -//# 1 "/projects/gnu-cygnus/gnu-cygnus-8/common/g++-include/iostream.h" 1 -// This is part of the iostream library, providing -*- C++ -*- input/output. -// Copyright (C) 1991 Per Bothner. -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Library General Public -// License as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Library General Public License for more details. -// -// You should have received a copy of the GNU Library General Public -// License along with this library; if not, write to the Free -// Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - -//# 210 "/projects/gnu-cygnus/gnu-cygnus-8/common/g++-include/iostream.h" - -//# 91 "/sandbox/wbaker/wbaker0/source/mips/include/Gtt/GttObject.h" 2 - -extern ostream& operator<<(ostream&, GttObject&); - -// There may be other X& operator<<(X&, GttObject&) defined in the -// packages defining class X. For example see the definition of -// GttUnitObject& operator<<(GttUnitObject&, GttObject&) in Unit. - - -//# 27 "../../../../../../mips/include/Gct/Object/GctObject.h" 2 - - -//# 1 "../../../../../../mips/include/Gct/GctErrorHandler.h" 1 -// -*- C++ -*- - - - -// -// GctErrorHandler class -// -// Expects to be included by Gct.h -// -// Wendell Baker, Berkeley CAD Group, 1991 (wbaker@ic.Berkeley.EDU) -// - - - - - -//#pragma interface - - - -//# 1 "/projects/gnu-cygnus/gnu-cygnus-8/common/g++-include/bool.h" 1 - - - - - - - -//# 25 "../../../../../../mips/include/Gct/GctErrorHandler.h" 2 - -//# 1 "/projects/gnu-cygnus/gnu-cygnus-8/common/g++-include/String.h" 1 -// This may look like C code, but it is really -*- C++ -*- -/* -Copyright (C) 1988 Free Software Foundation - written by Doug Lea (dl@rocky.oswego.edu) - -This file is part of the GNU C++ Library. This library is free -software; you can redistribute it and/or modify it under the terms of -the GNU Library General Public License as published by the Free -Software Foundation; either version 2 of the License, or (at your -option) any later version. This library is distributed in the hope -that it will be useful, but WITHOUT ANY WARRANTY; without even the -implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR -PURPOSE. See the GNU Library General Public License for more details. -You should have received a copy of the GNU Library General Public -License along with this library; if not, write to the Free Software -Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. -*/ - - -//# 1321 "/projects/gnu-cygnus/gnu-cygnus-8/common/g++-include/String.h" - -//# 26 "../../../../../../mips/include/Gct/GctErrorHandler.h" 2 - -//# 1 "/projects/gnu-cygnus/gnu-cygnus-8/common/g++-include/iostream.h" 1 -// This is part of the iostream library, providing -*- C++ -*- input/output. -// Copyright (C) 1991 Per Bothner. -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Library General Public -// License as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Library General Public License for more details. -// -// You should have received a copy of the GNU Library General Public -// License along with this library; if not, write to the Free -// Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - -//# 210 "/projects/gnu-cygnus/gnu-cygnus-8/common/g++-include/iostream.h" - -//# 27 "../../../../../../mips/include/Gct/GctErrorHandler.h" 2 - - -//# 1 "/sandbox/wbaker/wbaker0/source/mips/include/stuff++.h" 1 -// -*- C++ -*- -//# 107 "/sandbox/wbaker/wbaker0/source/mips/include/stuff++.h" - -//# 29 "../../../../../../mips/include/Gct/GctErrorHandler.h" 2 - -//# 1 "/sandbox/wbaker/wbaker0/source/mips/include/tostrstream.h" 1 -// -*- C++ -*- -//# 52 "/sandbox/wbaker/wbaker0/source/mips/include/tostrstream.h" - -//# 30 "../../../../../../mips/include/Gct/GctErrorHandler.h" 2 - - -//# 1 "/sandbox/wbaker/wbaker0/source/mips/include/Gtt/GttObject.h" 1 -// -*- C++ -*- -//# 98 "/sandbox/wbaker/wbaker0/source/mips/include/Gtt/GttObject.h" - -//# 32 "../../../../../../mips/include/Gct/GctErrorHandler.h" 2 - - -// -// It is expected that this will be virtually multiply inherited -// into all of the classes that need error reporting services. -// -// The typical way to have that done is by inheriting the GctObject -// as a virtual base class. -// - -// -// GctErrorHandler class -// -// GPP_1_96_BUG -// NOTE - virtual public GttObject should be MI into GctObject - but that -// causes g++ 1.96 to segfault; so we must inherit GttObject here and use SI -// GPP_1_96_BUG -class GctErrorHandler: virtual public GttObject { -public: - GctErrorHandler(); - GctErrorHandler(const String& program); - virtual ~GctErrorHandler(); - - // - // Debugging messages - // - these are turned off for production code. - // - these messages can be shut off - // - static void debug(const char *message); - static void debug(tostrstream& message); - - static void debug(const char *function, const char *message); - static void debug(const char *function, tostrstream& message); - - static void debug(const char *class_name, const char *method, const char *message); - static void debug(const char *class_name, const char *method, tostrstream& message); - - static bool debug(); // current debug switch - static void debug(bool value); // change the debug switch - - // - // Informational messages - // - these correspond to a ``verbose'' mode - // - these are not errors, just chatty progress reports - // - these messages can be shut off - // - static void note(const char *message); - static void note(tostrstream& message); - - static void note(const char *function, const char *message); - static void note(const char *function, tostrstream& message); - - static void note(const char *class_name, const char *method, const char *message); - static void note(const char *class_name, const char *method, tostrstream& message); - - static bool note(); // current note switch - static void note(bool value); // change the note switch - - // - // Warning messages - // - warnings are system-recoverable errors - // - the system has noticed something and taken some - // corrective action - // - these messages can be shut off - // - static void warning(const char *message); - static void warning(tostrstream& message); - - static void warning(const char *function, const char *message); - static void warning(const char *function, tostrstream& message); - - static void warning(const char *class_name, const char *method, const char *message); - static void warning(const char *class_name, const char *method, tostrstream& message); - - static bool warning(); // current warning switch - static void warning(bool value); // change the warning switch - - // - // Error messages - // - an unacceptable, but expected and recoverable - // condition was detected - // - errors are for ``the expected environment was not found'' - // rather than for ``file couldn't be opened'' - // - these messages cannot be shut off - // - the error handler determines the recovery action - // TODO - one day exceptions will be used here - // - static void error(const char *message); - static void error(tostrstream& message); - - static void error(const char *function, const char *message); - static void error(const char *function, tostrstream& message); - - static void error(const char *class_name, const char *method, const char *message); - static void error(const char *class_name, const char *method, tostrstream& message); - - // can't turn off errors - no ``static void error(bool value);'' - static zero_arg_error_handler_t error(); // current error handler - static void error(zero_arg_error_handler_t handler);// change the error handler - - static void error_is_lib_error_handler(); // change the error handler - static void error_is_exit(); // change the error handler - - // Describes the fatal handler - WATCHOUT - implicitly uses AllocRing - static const char *error_handler_description(); - - // - // Fatal messages - // - an unacceptable and unexpected error was detected - // the data invariants were violated, there is no recovery - // - these messages cannot be shut off - // - the error handler determines the recovery action - // TODO - one day exceptions will be used here - // - static void fatal(const char *message); - static void fatal(tostrstream& message); - - static void fatal(const char *function, const char *message); - static void fatal(const char *function, tostrstream& message); - - static void fatal(const char *class_name, const char *method, const char *message); - static void fatal(const char *class_name, const char *method, tostrstream& message); - - // can't turn off fatals - no ``static void fatal(bool value);'' - static zero_arg_error_handler_t fatal(); // return the fatal handler - static void fatal(zero_arg_error_handler_t handler); // change the fatal handler - - static void fatal_is_exit(); // change the fatal handler - static void fatal_is_abort(); // change the fatal handler - - // Describes the fatal handler - WATCHOUT - implicitly uses AllocRing - static const char *fatal_handler_description(); -private: - // - // Two underscores are used here in order to prevent confusion of these - // private variables with any of the heir's private variables. Note that - // access control is different than visibility in C++, so all the variable - // names in a class hierarchy must be unique. - // - static bool __debug; - static bool __note; - static bool __warning; - static void (*__error_handler)(); // can't turn off errors - static void (*__fatal_handler)(); // can't turn off fatals - - static bool __partial_init; - static void __partial_initialize(); - static bool __full_init; - static void __full_initialize(const char *program); - static char *__program; - - static void __handle_error(); - static void __handle_fatal(); - static void __add_newline(const char *message); - static void __message_switch(bool value, bool& flag, const char *description); - static void __message_switch(bool value, bool& flag); - static const char *__describe_handler(zero_arg_error_handler_t handler); - - static bool __output_valid(); - static ostream *__output; - - // GPP_1_96_BUG - const char *class_name() const; - // GPP_1_96_BUG -}; - - -//# 29 "../../../../../../mips/include/Gct/Object/GctObject.h" 2 - - -// -// GctObject class (is abstract) -// -class GctObject: virtual public GctErrorHandler /*, virtual public GttObject*/ { -protected: - GctObject(); - GctObject(const GctObject&); - virtual ~GctObject(); // ensure descendants have virtual destructors - -public: - // - // I/O Support - // - // The value typically persists only long enough for an i/o operation - // to be performed (see the defintion of output via operator<<(... ) below) - virtual const char *stringify(); -protected: - // This is the buffer into which the printed representation of this - // object will be put when the time comes. It is associated with the - // object so it will never go away (so long as the object exists). - // Use a pointer so that you only pay for the space when I/O is used - tostrstream *stringbuf; - void clear_stringbuf(); - -public: - // - // Consistency (global consistency) - // - // The global data invariant for the whole object (heirs included). - // This OK function will call the local invariant function ok() if - // necessary and in addition the OK functions of the heirs - // This is expected to compute the data invariant of the object. - // It will execute GctErrorHandler::fatal if there is wrong. - virtual void OK() const; - -protected: - // - // consistency (local consistency) - // - // This function computes the invariant which is local to this object. - // It does not call any of the ancestor's OK() or ok() functions. - // It is not a virtual function so that it can be called from within a - // constructor with impunity. Thus this function MUST NOT call any - // virtual functions either; it should call them by their full name if - // that is necessary. The global OK() function will call this function - // as necessary. - // - // This function must NOT NEVER EVER be made virtual. - void ok() const; -protected: - // - // Class Name - // - // This must return a static (constant) string which is the name - // of the class being declared. By convention, not all classes - // must have one of these, but the major root abstract class must - // have one in order to allow the stringify() to work approximately - // correctly. - virtual const char *class_name() const = 0; - -public: - // - // The ``id'' of this object - // - // NOTE - we explicitly allow the situation where this function - // can return the address of the object - the ``this'' pointer - // instead of a computed id field (the __object_id field below). - // - // This function is protected because we don't want too much dependence - // on this notion of object identity. I want to be able to rip it - // out if it becomes to cumbersome. - unsigned objectId() const; -private: - // - // Symbolic ID - // - // NOTE - Normally this would be implemented by the `this' pointer. - // TODO - remove this for production code - // - // However, in order to make the test suites run on all machines, we - // make this into a symbolic id that is maintained with each object. - // Thus the valid outputs are always consistent across all machines. - unsigned __object_id; - static unsigned __next_id; -}; - -//# 1 "/projects/gnu-cygnus/gnu-cygnus-8/common/g++-include/iostream.h" 1 -// This is part of the iostream library, providing -*- C++ -*- input/output. -// Copyright (C) 1991 Per Bothner. -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Library General Public -// License as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Library General Public License for more details. -// -// You should have received a copy of the GNU Library General Public -// License along with this library; if not, write to the Free -// Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - -//# 210 "/projects/gnu-cygnus/gnu-cygnus-8/common/g++-include/iostream.h" - -//# 117 "../../../../../../mips/include/Gct/Object/GctObject.h" 2 - -extern ostream& operator<<(ostream&, GctObject&); - - -//# 25 "../../../../../../mips/include/Gct/Object/GctHashObject.h" 2 - - -// -// GctHashObject class (is abstract) -// -class GctHashObject: virtual public GctObject { -protected: - GctHashObject(); - GctHashObject(const GctHashObject&); - -public: - // - // hash support - // - virtual unsigned hash() const; -}; - - -//# 28 "../../GctSymbol.h" 2 - - -// -// GctSymbol -// -class GctSymbol: virtual public GctHashObject, String { -public: - GctSymbol(); // vacuous symbol required for genclass usage - GctSymbol(const char*); - GctSymbol(const String&); - GctSymbol(const GctSymbol&); - - operator const char *() const; - - bool operator==(const GctSymbol&) const; - bool operator!=(const GctSymbol&) const; - - bool operator<=(const GctSymbol&) const; - bool operator<(const GctSymbol&) const; - bool operator>=(const GctSymbol&) const; - bool operator>(const GctSymbol&) const; - - unsigned hash() const; - - // I/O Support - const char *stringify(); - - // Consistency - void OK() const; -private: - const char *class_name() const; -}; - -extern unsigned hash(GctSymbol&); // genclass support (no const) - -// -// Inline functions -// -// Note - none of the String operators save for operator const char *() -// are String member functions, instead, they are anonymous functions -// which work by overloading. -// - - - - - -GctSymbol::operator const char *() const -{ - - - - - - return String::operator const char *(); -} - -bool -GctSymbol::operator==(const GctSymbol& other) const -{ - - - - - - return (bool)::operator==(*this, other); -} - -bool -GctSymbol::operator!=(const GctSymbol& other) const -{ - - - - - - return (bool)::operator!=(*this, other); -} - -bool -GctSymbol::operator<=(const GctSymbol& other) const -{ - - - - - - return (bool)::operator<=(*this, other); -} - -bool -GctSymbol::operator<(const GctSymbol& other) const -{ - - - - - - return (bool)::operator<(*this, other); -} - -bool -GctSymbol::operator>=(const GctSymbol& other) const -{ - - - - - - return (bool)::operator>=(*this, other); -} - -bool -GctSymbol::operator>(const GctSymbol& other) const -{ - - - - - - return (bool)::operator>(*this, other); -} - - -//# 25 "GctSymbol.defs.h" 2 - - -// equality operator - - - - -// less-than-or-equal - - - - -// comparison : less-than -> 0 - - - - -// hash function - -extern unsigned int hash(GctSymbol&); - - - -// initial capacity for structures requiring one - - - - - - - -//# 27 "GctSymbol.GctSymbol.Map.h" 2 - - -class GctSymbolGctSymbolMap -{ -protected: - int count; - GctSymbol def; - -public: - GctSymbolGctSymbolMap(GctSymbol& dflt); - virtual ~GctSymbolGctSymbolMap(); - - int length(); // current number of items - int empty(); - - virtual int contains(GctSymbol& key); // is key mapped? - - virtual void clear(); // delete all items - - virtual GctSymbol& operator [] (GctSymbol& key) = 0; // access contents by key - - virtual void del(GctSymbol& key) = 0; // delete entry - - virtual Pix first() = 0; // Pix of first item or 0 - virtual void next(Pix& i) = 0; // advance to next or 0 - virtual GctSymbol& key(Pix i) = 0; // access key at i - virtual GctSymbol& contents(Pix i) = 0; // access contents at i - - virtual int owns(Pix i); // is i a valid Pix ? - virtual Pix seek(GctSymbol& key); // Pix of key - - GctSymbol& dflt(); // access default val - - void error(const char* msg); - virtual int OK() = 0; // rep invariant -}; - - - -inline GctSymbolGctSymbolMap::~GctSymbolGctSymbolMap() {} - -inline int GctSymbolGctSymbolMap::length() -{ - return count; -} - -inline int GctSymbolGctSymbolMap::empty() -{ - return count == 0; -} - -inline GctSymbol& GctSymbolGctSymbolMap::dflt() -{ - return def; -} - -inline GctSymbolGctSymbolMap::GctSymbolGctSymbolMap(GctSymbol& dflt) :def(dflt) -{ - count = 0; -} - - - - -//# 26 "GctSymbol.GctSymbol.CHMap.h" 2 - - - - - -struct GctSymbolGctSymbolCHNode -{ - GctSymbolGctSymbolCHNode* tl; - GctSymbol hd; - GctSymbol cont; - GctSymbolGctSymbolCHNode(); - GctSymbolGctSymbolCHNode(GctSymbol& h, GctSymbol& c, GctSymbolGctSymbolCHNode* t = 0); - ~GctSymbolGctSymbolCHNode(); -}; - - - -inline GctSymbolGctSymbolCHNode::GctSymbolGctSymbolCHNode() {} - -inline GctSymbolGctSymbolCHNode::GctSymbolGctSymbolCHNode(GctSymbol& h, GctSymbol& c, GctSymbolGctSymbolCHNode* t) - : hd(h), cont(c), tl(t) {} - -inline GctSymbolGctSymbolCHNode::~GctSymbolGctSymbolCHNode() {} - - - - -typedef GctSymbolGctSymbolCHNode* GctSymbolGctSymbolCHNodePtr; - - - - -class GctSymbolGctSymbolCHMap : public GctSymbolGctSymbolMap -{ -protected: - GctSymbolGctSymbolCHNode** tab; - unsigned int size; - -public: - GctSymbolGctSymbolCHMap(GctSymbol& dflt,unsigned int sz=100 ); - GctSymbolGctSymbolCHMap(GctSymbolGctSymbolCHMap& a); - ~GctSymbolGctSymbolCHMap(); - - GctSymbol& operator [] (GctSymbol& key); - - void del(GctSymbol& key); - - Pix first(); - void next(Pix& i); - GctSymbol& key(Pix i); - GctSymbol& contents(Pix i); - - Pix seek(GctSymbol& key); - int contains(GctSymbol& key); - - void clear(); - int OK(); -}; - - - -inline GctSymbolGctSymbolCHMap::~GctSymbolGctSymbolCHMap() -{ - clear(); - delete tab; -} - -inline int GctSymbolGctSymbolCHMap::contains(GctSymbol& key) -{ - return seek(key) != 0; -} - -inline GctSymbol& GctSymbolGctSymbolCHMap::key(Pix p) -{ - if (p == 0) error("null Pix"); - return ((GctSymbolGctSymbolCHNode*)p)->hd; -} - -inline GctSymbol& GctSymbolGctSymbolCHMap::contents(Pix p) -{ - if (p == 0) error("null Pix"); - return ((GctSymbolGctSymbolCHNode*)p)->cont; -} - - - - -//# 22 "GctSymbol.GctSymbol.CHMap.cc" 2 - - -// The nodes are linked together serially via a version -// of a trick used in some vtables: odd pointers are -// actually links to the next table entry. -// Not terrible, but not wonderful either - -static inline int goodCHptr(GctSymbolGctSymbolCHNode* t) -{ - return ((((unsigned)t) & 1) == 0); -} - -static inline GctSymbolGctSymbolCHNode* index_to_CHptr(int i) -{ - return (GctSymbolGctSymbolCHNode*)((i << 1) + 1); -} - -static inline int CHptr_to_index(GctSymbolGctSymbolCHNode* t) -{ - return ( ((unsigned) t) >> 1); -} - -GctSymbolGctSymbolCHMap::GctSymbolGctSymbolCHMap(GctSymbol& dflt, unsigned int sz) - :GctSymbolGctSymbolMap(dflt) -{ - tab = (GctSymbolGctSymbolCHNode**)(new GctSymbolGctSymbolCHNodePtr[size = sz]); - for (unsigned int i = 0; i < size; ++i) tab[i] = index_to_CHptr(i+1); - count = 0; -} - -GctSymbolGctSymbolCHMap::GctSymbolGctSymbolCHMap(GctSymbolGctSymbolCHMap& a) :GctSymbolGctSymbolMap(a.def) -{ - tab = (GctSymbolGctSymbolCHNode**)(new GctSymbolGctSymbolCHNodePtr[size = a.size]); - for (unsigned int i = 0; i < size; ++i) tab[i] = index_to_CHptr(i+1); - count = 0; - for (Pix p = a.first(); p; a.next(p)) (*this)[a.key(p)] = a.contents(p); // gets bogus error - type `GctSymbol' is derived from private `String' -} diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p786.C b/gcc/testsuite/g++.old-deja/g++.mike/p786.C deleted file mode 100644 index c55d0c07f88..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/p786.C +++ /dev/null @@ -1,35 +0,0 @@ -// prms-id: 786 - -extern "C" void printf (char *, ...); -extern "C" void exit(int); -class C - { - int a; -public: - C() {a = 1;} - }; - -void func(const C& a, C& b) -{ - printf ("in const func\n"); - exit(1); -} - -void func(C& a, C& b) -{ - printf ("in non-const func\n"); -} - -void testit(const C& a, C& b) -{ - func(a,b); -} - -int main() -{ - C a; - C b; - - func(a,b); - return 0; -} diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p7865.C b/gcc/testsuite/g++.old-deja/g++.mike/p7865.C deleted file mode 100644 index 2cac1d57a8c..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/p7865.C +++ /dev/null @@ -1,28 +0,0 @@ -// prms-id: 7865 - -int count; - -struct A { - A() { ++count; } - ~A() { --count; } -}; - -int foo() { return 1; } - -int bar() -{ - A a; - for (;;) { - A b; - if (foo()) - return 0; - if (foo()) - return 0; - } - return 0; -} - -int main() { - bar(); - return count; -} diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p7868.C b/gcc/testsuite/g++.old-deja/g++.mike/p7868.C deleted file mode 100644 index d79e2aa3de2..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/p7868.C +++ /dev/null @@ -1,21 +0,0 @@ -// Build don't link: -// prms-id: 7868 - -struct DIAGTYP { -}; -struct DIAGTYP1 { - struct DIAGTYP; // ERROR - forward declaration - void bar() { new struct DIAGTYP; } // ERROR - undefined - void foo() { new struct DIAGTYP1; } -}; - -int main () { - struct DIAGTYP; // ERROR - forward declaration - struct DIAGTYP *lerror_desc; - lerror_desc= new struct DIAGTYP; // ERROR - undefined -} - -void foo () { - struct DIAGTYP *lerror_desc; - lerror_desc= new struct DIAGTYP; -} diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p789.C b/gcc/testsuite/g++.old-deja/g++.mike/p789.C deleted file mode 100644 index 9cad4fd805f..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/p789.C +++ /dev/null @@ -1,28 +0,0 @@ -// prms-id: 789 - -extern "C" void printf (char *, ...); -struct foo -{ - static int count; - virtual void print (int i, int j) { printf ("foo[%d][%d] = %d\n", i, j, x); } - int x; - foo () { x = count++; } -}; -int foo::count; -struct bar : virtual public foo -{ - virtual void print (int i, int j) { printf ("bar[%d][%d] = %d\n", i, j, x); } -}; - -// bar array[3][3]; -foo array[3][3]; - -int main () -{ - for (int i = 0; i < 3; i++) - for (int j = 0; j < 3; j++) { -// printf("&a[%d][%d] = %x\n", i, j, (void *)&array[i][j]); - array[i][j].print (i, j); - } - return 0; -} diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p789a.C b/gcc/testsuite/g++.old-deja/g++.mike/p789a.C deleted file mode 100644 index b0df9f646de..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/p789a.C +++ /dev/null @@ -1,43 +0,0 @@ -// global and local multidimensional array objects are not getting -// constructors called on any dimension, other than the first. Also, -// the destructors are not being called. Seems odd, they probably -// used to work. :-( -// prms-id: 789 - -extern "C" void printf (char *, ...); -struct foo -{ - static int count; - void print (int i, int j) { printf ("foo[%d][%d] = %d\n", i, j, x); } - int x; - foo () { - x = count++; - printf("this %d = %x\n", x, (void *)this); - } - virtual ~foo () { - printf("this %d = %x\n", x, (void *)this); - --count; - } -}; -int foo::count; - - -int main () -{ - { - foo array[3][3]; - for (int i = 0; i < 3; i++) - { - for (int j = 0; j < 3; j++) - { - printf("&a[%d][%d] = %x\n", i, j, (void *)&array[i][j]); - } - } - // The count should be nine, if not, fail the test. - if (foo::count != 9) - return 1; - } - if (foo::count != 0) - return 1; - return 0; -} diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p7912.C b/gcc/testsuite/g++.old-deja/g++.mike/p7912.C deleted file mode 100644 index 40f45c48c12..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/p7912.C +++ /dev/null @@ -1,23 +0,0 @@ -// Special g++ Options: -fexceptions -// excess errors test - XFAIL a29k-*-* sparc64-*-elf sh-*-* arm-*-pe**-* -// prms-id: 7912 - -int count = 0; - -class Foo { -public: - Foo() { ++count; }; - Foo(const Foo&) { ++count; }; - ~Foo() { --count; }; -}; - - -main() -{ - try { - throw Foo(); - } - catch (Foo object) { - } - return count; -} diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p8009.C b/gcc/testsuite/g++.old-deja/g++.mike/p8009.C deleted file mode 100644 index e8a124b40cf..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/p8009.C +++ /dev/null @@ -1,12 +0,0 @@ -// prms-id: 8009 - -class A { -public: - int i; -}; - -class B : public A { - B(); -}; - -B::B() : i (-1) {} // ERROR - diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p8018.C b/gcc/testsuite/g++.old-deja/g++.mike/p8018.C deleted file mode 100644 index 37035bcd591..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/p8018.C +++ /dev/null @@ -1,85 +0,0 @@ -// prms-id: 8018 - -class RefCount { -private: - int nref; - -public: - RefCount() : nref(0) {} - ~RefCount() {} - - int nrefs() const { return nref; } - int reference() { - nref++; - return nref; - } - int unreference() { - nref--; - return nref; - } -}; - -class A : public RefCount { -public: - A() {} - ~A() {} -}; - -class RefA { -private: - A *p; - - void clear() { - if (p) { - p->unreference(); - if (!p->nrefs()) - delete p; - } - } - -public: - RefA(A* a) : p(a) { if (p) p->reference(); } - RefA(const RefA& a) : p(a.p) { if (p) p->reference(); } - ~RefA() { clear(); } - - A* operator->() { return p; } - - RefA& operator=(const RefA& a) { - clear(); - p=a.p; - if (p) - p->reference(); - return *this; - } - - RefA& operator=(A* a) { - clear(); - p=a; - if (p) - p->reference(); - return *this; - } -}; - -class AccRefA { -private: - RefA a; - -public: - AccRefA(A* ap) : a(ap) {} - AccRefA(const RefA& ar) : a(ar) {} - ~AccRefA() {} - - operator RefA&() { return a; } - RefA& result() { return a; } -}; - -int -main() { - RefA a1 = new A; - AccRefA aa1(a1); - RefA a3 = aa1; - - if (a1->nrefs() != 3) - return 1; -} diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p8039.C b/gcc/testsuite/g++.old-deja/g++.mike/p8039.C deleted file mode 100644 index fe58d09a6dc..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/p8039.C +++ /dev/null @@ -1,14 +0,0 @@ -// prms-id: 8039 - -class C { -public: - int func (); -}; - -extern void bar(int*); - -int main() -{ - int (C::*mfp)() = &C::func; - bar((int*)mfp); // ERROR - no clear semantics -} diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p807.C b/gcc/testsuite/g++.old-deja/g++.mike/p807.C deleted file mode 100644 index 00c49e72ece..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/p807.C +++ /dev/null @@ -1,34 +0,0 @@ -// prms-id: 807 - -extern "C" int printf(const char*, ...); - -class B; - -class AX -{ - protected: - int x; - - public: - operator B(); -}; - - -class B -{ - private: - int x; - public: - B(const AX&); -}; - - -int foo(B& b); // ERROR - referenced below - - -int main() -{ - AX a; - foo(a); // ERROR - Ambiguous B(a) or a.operator B() // See ARM 12.3.2 - -} diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p807a.C b/gcc/testsuite/g++.old-deja/g++.mike/p807a.C deleted file mode 100644 index d7b797af8e0..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/p807a.C +++ /dev/null @@ -1,22 +0,0 @@ -// Build don't link: -// prms-id: 807 - -// See ARM page 275 Section 12.3.2 - -extern "C" void printf (char *, ...); -extern "C" void exit(int); - -class B; - -class A { -public: - A(B&); // ERROR - fn ref in err msg -}; - -class B { -public: - operator A(); // ERROR - fn ref in err msg -}; - -B b; -A a = b; // ERROR - should fail as it is ambigious. diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p811.C b/gcc/testsuite/g++.old-deja/g++.mike/p811.C deleted file mode 100644 index 07ab9408055..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/p811.C +++ /dev/null @@ -1,549 +0,0 @@ -// This test case caused the compiler to abort at one point in time. -// Build don't link: -// Special g++ Options: -// prms-id: 811 - -class ostream; class streambuf; - -typedef long streamoff, streampos; - -struct _ios_fields { - streambuf *_strbuf; - ostream* _tie; - int _width; - unsigned long _flags; - char _fill; - unsigned char _state; - unsigned short _precision; -}; - - -enum state_value { _good = 0, _eof = 1, _fail = 2, _bad = 4 }; -enum open_mode { input=1, output=2, append=8 }; - - -class ios : public _ios_fields { - public: - enum io_state { goodbit=0, eofbit=1, failbit=2, badbit=4 }; - enum open_mode { - in=1, - out=2, - ate=4, - app=8, - trunc=16, - nocreate=32, - noreplace=64 }; - enum seek_dir { beg, cur, end}; - enum { skipws=01, left=02, right=04, internal=010, - dec=020, oct=040, hex=0100, - showbase=0200, showpoint=0400, uppercase=01000, showpos=02000, - scientific=04000, fixed=0100000, unitbuf=020000, stdio=040000, - dont_close=0x80000000 - }; - - ostream* tie() const { return _tie; } - ostream* tie(ostream* val) { ostream* save=_tie; _tie=val; return save; } - - - char fill() const { return _fill; } - char fill(char newf) { char oldf = _fill; _fill = newf; return oldf; } - unsigned long flags() const { return _flags; } - unsigned long flags(unsigned long new_val) { - unsigned long old_val = _flags; _flags = new_val; return old_val; } - unsigned short precision() const { return _precision; } - unsigned short precision(int newp) { - unsigned short oldp = _precision; _precision = (unsigned short)newp; - return oldp; } - unsigned long setf(unsigned long val) { - unsigned long oldbits = _flags; - _flags |= val; return oldbits; } - unsigned long setf(unsigned long val, unsigned long mask) { - unsigned long oldbits = _flags; - _flags = (_flags & ~mask) | (val & mask); return oldbits; } - unsigned long unsetf(unsigned long mask) { - unsigned long oldbits = _flags & mask; - _flags &= ~mask; return oldbits; } - int width() const { return _width; } - int width(long val) { long save = _width; _width = val; return save; } - - static const unsigned long basefield; - static const unsigned long adjustfield; - static const unsigned long floatfield; - - streambuf* rdbuf() const { return _strbuf; } - void clear(int state = 0) { _state = state; } - int good() const { return _state == 0; } - int eof() const { return _state & ios::eofbit; } - int fail() const { return _state & (ios::badbit|ios::failbit); } - int bad() const { return _state & ios::badbit; } - int rdstate() const { return _state; } - void set(int flag) { _state |= flag; } - operator void*() const { return fail() ? (void*)0 : (void*)this; } - int operator!() const { return fail(); } - - - void unset(state_value flag) { _state &= ~flag; } - void close(); - int is_open(); - int readable(); - int writable(); - - - protected: - ios(streambuf*sb) { _strbuf=sb; _state=0; _width=0; _fill=' '; - _flags=ios::skipws; _precision=6; } -}; - - - - -typedef ios::seek_dir _seek_dir; - - - - - - - - - - - - - - - - - - - - - - -//# 168 "/usr/latest/lib/g++-include/streambuf.h" 3 - - -struct __streambuf { - - int _flags; - char* _gptr; - char* _egptr; - char* _eback; - char* _pbase; - char* _pptr; - char* _epptr; - char* _base; - char* _ebuf; - struct streambuf *_chain; - - - - -}; - -struct streambuf : private __streambuf { - friend class ios; - friend class istream; - friend class ostream; - protected: - static streambuf* _list_all; - streambuf*& xchain() { return _chain; } - void _un_link(); - void _link_in(); - char* gptr() const { return _gptr; } - char* pptr() const { return _pptr; } - char* egptr() const { return _egptr; } - char* epptr() const { return _epptr; } - char* pbase() const { return _pbase; } - char* eback() const { return _eback; } - char* ebuf() const { return _ebuf; } - char* base() const { return _base; } - void xput_char(char c) { *_pptr++ = c; } - int xflags() { return _flags; } - int xflags(int f) { int fl = _flags; _flags = f; return fl; } - void xsetflags(int f) { _flags |= f; } - void gbump(int n) { _gptr += n; } - void pbump(int n) { _pptr += n; } - void setb(char* b, char* eb, int a=0); - void setp(char* p, char* ep) { _pbase=_pptr=p; _epptr=ep; } - void setg(char* eb, char* g, char *eg) { _eback=eb; _gptr=g; _egptr=eg; } - public: - static int flush_all(); - static void flush_all_linebuffered(); - virtual int underflow(); - virtual int overflow(int c = (-1) ); - virtual int doallocate(); - virtual streampos seekoff(streamoff, _seek_dir, int mode=ios::in|ios::out); - virtual streampos seekpos(streampos pos, int mode = ios::in|ios::out); - int sputbackc(char c); - int sungetc(); - streambuf(); - virtual ~streambuf(); - int unbuffered() { return _flags & 2 ? 1 : 0; } - int linebuffered() { return _flags & 0x4000 ? 1 : 0; } - void unbuffered(int i) - { if (i) _flags |= 2 ; else _flags &= ~2 ; } - void linebuffered(int i) - { if (i) _flags |= 0x4000 ; else _flags &= ~0x4000 ; } - int allocate() { - if (base() || unbuffered()) return 0; - else return doallocate(); } - virtual int sync(); - virtual int pbackfail(int c); - virtual int ungetfail(); - virtual streambuf* setbuf(char* p, int len); - int in_avail() { return _egptr - _gptr; } - int out_waiting() { return _pptr - _pbase; } - virtual int sputn(const char* s, int n); - virtual int sgetn(char* s, int n); - long sgetline(char* buf, int n, char delim, int putback_delim); - int sbumpc() { - if (_gptr >= _egptr && underflow() == (-1) ) return (-1) ; - else return *(unsigned char*)_gptr++; } - int sgetc() { - if (_gptr >= _egptr && underflow() == (-1) ) return (-1) ; - else return *(unsigned char*)_gptr; } - int snextc() { - if (++_gptr >= _egptr && underflow() == (-1) ) return (-1) ; - else return *(unsigned char*)_gptr; } - int sputc(int c) { - if (_pptr >= _epptr) return overflow(c); - return *_pptr++ = c, (unsigned char)c; } - int vscan(char const *fmt0, char* ap); - int vform(char const *fmt0, char* ap); - - - - - - -}; - -struct __file_fields { - char _fake; - char _shortbuf[1]; - short _fileno; - int _blksize; - char* _save_gptr; - char* _save_egptr; - long _offset; -}; - -class filebuf : public streambuf { - struct __file_fields _fb; - void init(); - public: - filebuf(); - filebuf(int fd); - filebuf(int fd, char* p, int len); - ~filebuf(); - filebuf* attach(int fd); - filebuf* open(const char *filename, const char *mode); - filebuf* open(const char *filename, int mode, int prot = 0664); - virtual int underflow(); - virtual int overflow(int c = (-1) ); - int is_open() { return _fb._fileno >= 0; } - int fd() { return is_open() ? _fb._fileno : (-1) ; } - filebuf* close(); - virtual int doallocate(); - virtual streampos seekoff(streamoff, _seek_dir, int mode=ios::in|ios::out); - int sputn(const char* s, int n); - int sgetn(char* s, int n); - virtual int sync(); - protected: - virtual int pbackfail(int c); - int is_reading() { return eback() != egptr(); } - char* cur_ptr() { return is_reading() ? gptr() : pptr(); } - - char* file_ptr() { return _fb._save_gptr ? _fb._save_egptr : egptr(); } - int do_flush(); - - virtual int sys_read(char* buf, int size); - virtual long sys_seek(long , _seek_dir); - virtual long sys_write(const void*, long); - virtual int sys_stat(void*); - virtual int sys_close(); -}; - - -inline int ios::readable() { return rdbuf()->_flags & 4 ; } -inline int ios::writable() { return rdbuf()->_flags & 8 ; } -inline int ios::is_open() {return rdbuf()->_flags & 4 +8 ;} - - - - -//# 25 "/usr/latest/lib/g++-include/iostream.h" 2 3 - - -class istream; class ostream; -typedef istream& (*__imanip)(istream&); -typedef ostream& (*__omanip)(ostream&); - -extern istream& ws(istream& ins); -extern ostream& flush(ostream& outs); -extern ostream& endl(ostream& outs); -extern ostream& ends(ostream& outs); - -class ostream : public ios -{ - void do_osfx(); - public: - ostream(); - ostream(streambuf* sb, ostream* tied=__null ); - ~ostream(); - - int opfx() { if (!good()) return 0; if (_tie) _tie->flush(); return 1; } - void osfx() { if (flags() & (ios::unitbuf|ios::stdio)) - do_osfx(); } - streambuf* ostreambuf() const { return _strbuf; } - ostream& flush(); - ostream& put(char c); - ostream& write(const char *s, int n); - ostream& write(const unsigned char *s, int n) { return write((char*)s, n);} - ostream& write(const void *s, int n) { return write((char*)s, n);} - ostream& seekp(streampos); - ostream& seekp(streamoff, _seek_dir); - streampos tellp(); - ostream& form(const char *format ...); - ostream& vform(const char *format, char* args); -}; - -extern ostream& operator<<(ostream&, char c); -inline ostream& operator<<(ostream& os, unsigned char c) -{ return os << (char)c; } - -extern ostream& operator<<(ostream&, const char *s); -inline ostream& operator<<(ostream& os, const unsigned char *s) -{ return os << (const char*)s; } - - -extern ostream& operator<<(ostream&, void *p); -extern ostream& operator<<(ostream&, int n); -extern ostream& operator<<(ostream&, long n); -extern ostream& operator<<(ostream&, unsigned int n); -extern ostream& operator<<(ostream&, unsigned long n); -inline ostream& operator<<(ostream& os, short n) {return os << (int)n;} -inline ostream& operator<<(ostream& os, unsigned short n) -{return os << (unsigned int)n;} -extern ostream& operator<<(ostream&, float n); -extern ostream& operator<<(ostream&, double n); -inline ostream& operator<<(ostream& os, __omanip func) { return (*func)(os); } -extern ostream& operator<<(ostream&, streambuf*); - -class istream : public ios -{ - int _gcount; - public: - istream(); - istream(streambuf* sb, ostream*tied=__null ); - ~istream(); - streambuf* istreambuf() const { return _strbuf; } - istream& get(char& c); - istream& get(unsigned char& c); - istream& read(char *ptr, int n); - istream& read(unsigned char *ptr, int n) { return read((char*)ptr, n); } - istream& read(void *ptr, int n) { return read((char*)ptr, n); } - - istream& getline(char* ptr, int len, char delim = '\n'); - istream& get(char* ptr, int len, char delim = '\n'); - istream& gets(char **s, char delim = '\n'); - int ipfx(int need) { - if (!good()) { set(ios::failbit); return 0; } - if (_tie && (need == 0 || rdbuf()->in_avail() < need)) _tie->flush(); - if (!need && (flags() & ios::skipws) && !ws(*this)) return 0; - return 1; - } - int ipfx0() { - if (!good()) { set(ios::failbit); return 0; } - if (_tie) _tie->flush(); - if ((flags() & ios::skipws) && !ws(*this)) return 0; - return 1; - } - int ipfx1() { - if (!good()) { set(ios::failbit); return 0; } - if (_tie && rdbuf()->in_avail() == 0) _tie->flush(); - return 1; - } - int get() { if (!ipfx1()) return (-1) ; - int ch = _strbuf->sbumpc(); - if (ch == (-1) ) set(ios::eofbit); - return ch; } - int peek() { if (!ipfx1()) return (-1) ; - int ch = _strbuf->sgetc(); - if (ch == (-1) ) set(ios::eofbit); - return ch; } - int gcount() { return _gcount; } - istream& ignore(int n=1, int delim = (-1) ); - istream& seekg(streampos); - istream& seekg(streamoff, _seek_dir); - streampos tellg(); - istream& putback(char ch) { - if (good() && _strbuf->sputbackc(ch) == (-1) ) clear(ios::badbit); - return *this;} - istream& unget() { - if (good() && _strbuf->sungetc() == (-1) ) clear(ios::badbit); - return *this;} - - istream& unget(char ch) { return putback(ch); } - int skip(int i); - -}; - -extern istream& operator>>(istream&, char*); -inline istream& operator>>(istream& is, unsigned char* p) -{ return is >> (char*)p; } - -extern istream& operator>>(istream&, char& c); -extern istream& operator>>(istream&, unsigned char& c); - -extern istream& operator>>(istream&, int&); -extern istream& operator>>(istream&, long&); -extern istream& operator>>(istream&, short&); -extern istream& operator>>(istream&, unsigned int&); -extern istream& operator>>(istream&, unsigned long&); -extern istream& operator>>(istream&, unsigned short&); -extern istream& operator>>(istream&, float&); -extern istream& operator>>(istream&, double&); -inline istream& operator>>(istream& is, __imanip func) { return (*func)(is); } - -inline ostream& ostream::put(char c) { _strbuf->sputc(c); return *this; } - -class iostream : public ios { - int _gcount; - public: - iostream(); - iostream(streambuf* sb, ostream*tied=__null ); - operator istream&() { return *(istream*)this; } - operator ostream&() { return *(ostream*)this; } - ~iostream(); - - istream& get(char& c) { return ((istream*)this)->get(c); } - istream& get(unsigned char& c) { return ((istream*)this)->get(c); } - istream& read(char *ptr, int n) { return ((istream*)this)->read(ptr, n); } - istream& read(unsigned char *ptr, int n) - { return ((istream*)this)->read((char*)ptr, n); } - istream& read(void *ptr, int n) - { return ((istream*)this)->read((char*)ptr, n); } - istream& getline(char* ptr, int len, char delim = '\n') - { return ((istream*)this)->getline(ptr, len, delim); } - istream& get(char* ptr, int len, char delim = '\n') - { return ((istream*)this)->get(ptr, len, delim); } - istream& gets(char **s, char delim = '\n') - { return ((istream*)this)->gets(s, delim); } - istream& ignore(int n=1, int delim = (-1) ) - { return ((istream*)this)->ignore(n, delim); } - int ipfx(int need) { return ((istream*)this)->ipfx(need); } - int ipfx0() { return ((istream*)this)->ipfx0(); } - int ipfx1() { return ((istream*)this)->ipfx1(); } - int get() { return _strbuf->sbumpc(); } - int peek() { return ipfx1() ? _strbuf->sgetc() : (-1) ; } - int gcount() { return _gcount; } - istream& putback(char ch) { return ((istream*)this)->putback(ch); } - istream& unget() { return ((istream*)this)->unget(); } - istream& seekg(streampos pos) { return ((istream*)this)->seekg(pos); } - istream& seekg(streamoff off, _seek_dir dir) - { return ((istream*)this)->seekg(off, dir); } - streampos tellg() { return ((istream*)this)->tellg(); } - - istream& unget(char ch) { return putback(ch); } - - - - int opfx() { return ((ostream*)this)->opfx(); } - void osfx() { ((ostream*)this)->osfx(); } - ostream& flush() { return ((ostream*)this)->flush(); } - ostream& put(char c) { return ((ostream*)this)->put(c); } - ostream& write(const char *s, int n) - { return ((ostream*)this)->write(s, n); } - ostream& write(const unsigned char *s, int n) - { return ((ostream*)this)->write((char*)s, n); } - ostream& write(const void *s, int n) - { return ((ostream*)this)->write((char*)s, n); } - ostream& form(const char *format ...); - ostream& vform(const char *format, char* args) - { return ((ostream*)this)->vform(format, args); } - ostream& seekp(streampos pos) { return ((ostream*)this)->seekp(pos); } - ostream& seekp(streamoff off, _seek_dir dir) - { return ((ostream*)this)->seekp(off, dir); } - streampos tellp() { return ((ostream*)this)->tellp(); } -}; - -extern istream cin; -extern ostream cout, cerr, clog; - -struct Iostream_init { } ; - -inline ios& dec(ios& i) -{ i.setf(ios::dec, ios::dec|ios::hex|ios::oct); return i; } -inline ios& hex(ios& i) -{ i.setf(ios::hex, ios::dec|ios::hex|ios::oct); return i; } -inline ios& oct(ios& i) -{ i.setf(ios::oct, ios::dec|ios::hex|ios::oct); return i; } - - -//# 7 "/usr/latest/lib/g++-include/stream.h" 2 3 - - -extern char* form(const char*, ...); - -extern char* dec(long, int=0); -extern char* dec(int, int=0); -extern char* dec(unsigned long, int=0); -extern char* dec(unsigned int, int=0); - -extern char* hex(long, int=0); -extern char* hex(int, int=0); -extern char* hex(unsigned long, int=0); -extern char* hex(unsigned int, int=0); - -extern char* oct(long, int=0); -extern char* oct(int, int=0); -extern char* oct(unsigned long, int=0); -extern char* oct(unsigned int, int=0); - -inline istream& WS(istream& str) { return ws(str); } - - -//# 9 "test.C" 2 - - -class Y { -public: - Y() {} - virtual const char *stringify() = 0; - virtual char *stringify2() const = 0; // ERROR - -}; - -class X: public Y { -public: - X(): Y() {} - char *stringify(); // ERROR - ok - const char *stringify2() const; // ERROR - ok -}; - -char * -X::stringify() const -{ // ERROR - ok - return "stringify"; -} - -const char * -X::stringify2() -{ // ERROR - ok - return "stringify2"; -} - -main() -{ - X x; - Y& y = x; - - cout << "x\n"; - cout << x.stringify() << '\n'; - cout << x.stringify2() << '\n'; - - cout << "y\n"; - cout << y.stringify() << '\n'; - cout << y.stringify2() << '\n'; -} diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p8154.C b/gcc/testsuite/g++.old-deja/g++.mike/p8154.C deleted file mode 100644 index b68ea5dd194..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/p8154.C +++ /dev/null @@ -1,19 +0,0 @@ -// Build don't link: -// Special g++ Options: -// prms-id: 8154 - -class QvFieldData; -class QvNode { - QvFieldData *fieldData; -}; -class QvGroup : public QvNode { - static QvFieldData *fieldData; -}; -class QvUnknownNode : public QvGroup -{ -public: - QvUnknownNode :: QvUnknownNode (); -private: - static QvFieldData *fieldData; - virtual QvFieldData *getFieldData() { return fieldData; } -}; diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p8155.C b/gcc/testsuite/g++.old-deja/g++.mike/p8155.C deleted file mode 100644 index 5be14913a6a..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/p8155.C +++ /dev/null @@ -1,147 +0,0 @@ -// prms-id: 8155 - -int fail = 1; - -class CMainWindow; -class CFrameWnd; -class CWnd; -class CCmdTarget; - -typedef void (CCmdTarget::*AFX_PMSG)( void); -typedef void (CWnd::*AFX_PMSGW)( void); - -struct AFX_MSGMAP_ENTRY { - unsigned int nMessage; - AFX_PMSG pfn; -}; - -struct AFX_MSGMAP { - const AFX_MSGMAP* pBaseMap; - const AFX_MSGMAP_ENTRY* lpEntries; -}; - -class CCmdTarget { -public: - CCmdTarget(); -private: - static AFX_MSGMAP_ENTRY _messageEntries[]; -protected: - static const AFX_MSGMAP messageMap; - virtual const AFX_MSGMAP* GetMessageMap() const; -}; - -const AFX_MSGMAP CCmdTarget::messageMap = { - 0, &CCmdTarget::_messageEntries[0] -}; - -const AFX_MSGMAP* CCmdTarget::GetMessageMap() const { - return &CCmdTarget::messageMap; -} - -AFX_MSGMAP_ENTRY CCmdTarget::_messageEntries[] = -{ - { 0, 0 } -}; - -CCmdTarget :: CCmdTarget() { } - -class CWnd : public CCmdTarget { -public: - CWnd(); - -protected: - void OnPaint(); -private: - static AFX_MSGMAP_ENTRY _messageEntries[]; -protected: - static const AFX_MSGMAP messageMap; - virtual const AFX_MSGMAP* GetMessageMap() const; -}; - -CWnd :: CWnd() { -} - -void CWnd :: OnPaint() { -} - -const AFX_MSGMAP* CWnd ::GetMessageMap() const { - return & CWnd ::messageMap; -} -const AFX_MSGMAP CWnd ::messageMap = { - & CCmdTarget ::messageMap, & CWnd ::_messageEntries[0] - }; -AFX_MSGMAP_ENTRY CWnd ::_messageEntries[] = { - {0, (AFX_PMSG)0 } }; - -class CFrameWnd : public CWnd { -public: - CFrameWnd(); -protected: -private: - static AFX_MSGMAP_ENTRY _messageEntries[]; -protected: - static const AFX_MSGMAP messageMap; - virtual const AFX_MSGMAP* GetMessageMap() const; -}; - -CFrameWnd :: CFrameWnd() { } - -const AFX_MSGMAP* CFrameWnd ::GetMessageMap() const { - return & CFrameWnd ::messageMap; -} -const AFX_MSGMAP CFrameWnd ::messageMap = { - & CWnd ::messageMap, & CFrameWnd ::_messageEntries[0] - }; -AFX_MSGMAP_ENTRY CFrameWnd ::_messageEntries[] = { - {0, (AFX_PMSG)0 } }; - -class CMainWindow : public CFrameWnd { -public: - CMainWindow(); - void OnPaint(); - void callProc(); -private: - static AFX_MSGMAP_ENTRY _messageEntries[]; -protected: - static const AFX_MSGMAP messageMap; - virtual const AFX_MSGMAP* GetMessageMap() const; -}; - -CMainWindow :: CMainWindow() -{ -} -void CMainWindow :: OnPaint() -{ - fail = 0; -} - -void CMainWindow :: callProc() -{ - const AFX_MSGMAP* pMessageMap; - const AFX_MSGMAP_ENTRY *lpEntry; - - pMessageMap = GetMessageMap(); - lpEntry = pMessageMap->lpEntries; - - if( lpEntry->nMessage == 100) { - (this->*lpEntry->pfn)(); - } -} - -const AFX_MSGMAP* CMainWindow ::GetMessageMap() const { - return & CMainWindow ::messageMap; -} -const AFX_MSGMAP CMainWindow ::messageMap = { - & CFrameWnd ::messageMap, & CMainWindow ::_messageEntries[0] - }; -AFX_MSGMAP_ENTRY CMainWindow ::_messageEntries[] = { - { 100, (AFX_PMSG)(AFX_PMSGW)(void (CWnd::*)(void))&CMainWindow::OnPaint }, - {0, (AFX_PMSG)0 } -}; - -int main( int argc, char **argv) { - CMainWindow myWindow; - - myWindow.callProc(); - return fail; -} diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p8175.C b/gcc/testsuite/g++.old-deja/g++.mike/p8175.C deleted file mode 100644 index 8ae40588ad8..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/p8175.C +++ /dev/null @@ -1,14 +0,0 @@ -// prms-id: 8175 - -class AtoBoolC { -public: - AtoBoolC(const AtoBoolC& aBool); -private: - int myValue; -}; - -struct TestCase { - AtoBoolC is_call_on_unack; -}; - -static TestCase the_cases[] = { { 0 } }; // ERROR - diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p8269.C b/gcc/testsuite/g++.old-deja/g++.mike/p8269.C deleted file mode 100644 index f886fe78fca..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/p8269.C +++ /dev/null @@ -1,11 +0,0 @@ -// Build don't link: -// prms-id: 8269 - -typedef char* const char_ptr; - -class Foo_Bar { -public: - static char* const counter; -}; - -char_ptr Foo_Bar::counter = 0; diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p8460.C b/gcc/testsuite/g++.old-deja/g++.mike/p8460.C deleted file mode 100644 index d4b3e8fb14f..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/p8460.C +++ /dev/null @@ -1,17 +0,0 @@ -// Build don't link: -// prms-id: 8460 - -class A { -public: - A(); - A(int) { } - A(const A&) { } -private: -}; - -int main() -{ - A a; - - a.A(1); // ERROR - cannot find name this way -} diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p8483.C b/gcc/testsuite/g++.old-deja/g++.mike/p8483.C deleted file mode 100644 index 8e6293f5b1f..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/p8483.C +++ /dev/null @@ -1,35 +0,0 @@ -// prms-id: 8483 - -int count; - -class A { -public: - A() { ++count; } - ~A() { } -}; - -class B { -private: - A b[2]; -}; - -class C { -public: -private: - A c[2][2]; -}; - -class D { -public: -private: - A d[2][2][2]; -}; - -int main() { - { A a; } - { B b; } - { C c; } - { D d; } - if (count != 15) - return 1; -} diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p8620.C b/gcc/testsuite/g++.old-deja/g++.mike/p8620.C deleted file mode 100644 index dc6f017adff..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/p8620.C +++ /dev/null @@ -1,14 +0,0 @@ -// Build don't link: -// prms-id: 8620 - -struct S { - long l; -}; - -typedef unsigned long l; - -void f() { - S* p; - if (p->l < 0) - return; -} diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p8785.C b/gcc/testsuite/g++.old-deja/g++.mike/p8785.C deleted file mode 100644 index e10f4cfd40e..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/p8785.C +++ /dev/null @@ -1,25 +0,0 @@ -// Build don't link: -// prms-id: 8785 - -class Outer { -private: - int x; // ERROR - private -public: - struct Inner { - int y; - void f( Outer * p, int i) { - p->x = i; // ERROR - - }; - void f( Outer & p) { - p.x = y; // ERROR - - }; - }; -}; - -int main() { - Outer::Inner A; - Outer Thing; - - A.f(Thing); - A.f(&Thing,2); -} diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p8786.C b/gcc/testsuite/g++.old-deja/g++.mike/p8786.C deleted file mode 100644 index b5443c0fa6b..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/p8786.C +++ /dev/null @@ -1,24 +0,0 @@ -// Build don't link: -// Special g++ Options: -O -// prms-id: 8786 - -class B { -public: - inline ~B(); -}; - -class D : public B { -public: - D(int); -}; - -int foo() { - D t(0); - - bool h = 1; - if (h) { - D p(0); - return 0; - } - return 0; -} diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p8804.C b/gcc/testsuite/g++.old-deja/g++.mike/p8804.C deleted file mode 100644 index df787b8fee9..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/p8804.C +++ /dev/null @@ -1,18 +0,0 @@ -// prms-id: 8804 - -extern "C" int printf (const char *, ...); - -struct Fails { - int i; - union { - union { - int c; - }; - }; -}; - -Fails d; - -int main() { - return &d.i == &d.c; -} diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p8825.C b/gcc/testsuite/g++.old-deja/g++.mike/p8825.C deleted file mode 100644 index 11de74e78d2..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/p8825.C +++ /dev/null @@ -1,14 +0,0 @@ -// Build don't link: -// prms-id: 8825 - -class A { - typedef A x; -}; - -class B { - typedef B x; -}; - -class C : public A, public B { - typedef C x; -}; diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p9068.C b/gcc/testsuite/g++.old-deja/g++.mike/p9068.C deleted file mode 100644 index 67e879fbd94..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/p9068.C +++ /dev/null @@ -1,21 +0,0 @@ -// prms-id: 9068 - -struct ostream { - void operator<< (int); // ERROR - fn ref in err msg -}; - -class C { -public: - static int& i (); - static int& i (int signatureDummy); -}; - -void foo (ostream& lhs, const C& rhs) -{ - lhs << rhs.i; // ERROR - no such i for any opr << () -} - -int& C::i () { - static int _i = 4711; - return _i; -} diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p9129.C b/gcc/testsuite/g++.old-deja/g++.mike/p9129.C deleted file mode 100644 index d66dab52d09..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/p9129.C +++ /dev/null @@ -1,12 +0,0 @@ -// Build don't link: -// Special g++ Options: -ansi -pedantic-errors -// prms-id: 9129 - -class Foo { -public: - int DoSomething(); -}; - -int (Foo::*pA)() = { &Foo::DoSomething }; -int (Foo::*X[1])(int) = { { &Foo::DoSomething } }; // ERROR - -int (Foo::*Y[])(int) = { { &Foo::DoSomething, &Foo::DoSomething, 0 } }; // ERROR - diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p9206.C b/gcc/testsuite/g++.old-deja/g++.mike/p9206.C deleted file mode 100644 index 5c4b578b866..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/p9206.C +++ /dev/null @@ -1,21 +0,0 @@ -// prms-id: 9206 - -class X { -public: - void xtest() { } -}; - -class Y { }; - -typedef void (X::*Xptr)(); -typedef void (Y::*Yptr)(); - -int main() { - X xx; - - Xptr xp = &X::xtest; - Yptr yp = reinterpret_cast<Yptr>(xp); - xp = reinterpret_cast<Xptr>(yp); - - (xx.*xp)(); -} diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p9506.C b/gcc/testsuite/g++.old-deja/g++.mike/p9506.C deleted file mode 100644 index 7c6e47b8e47..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/p9506.C +++ /dev/null @@ -1,7 +0,0 @@ -// Build don't link: -// prms-id: 9506 - -char * volatile p; -void foo() { - --p = 0; -} diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p9706.C b/gcc/testsuite/g++.old-deja/g++.mike/p9706.C deleted file mode 100644 index c21f6c6585c..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/p9706.C +++ /dev/null @@ -1,33 +0,0 @@ -// Special g++ Options: -fexceptions -// excess errors test - XFAIL a29k-*-* sparc64-*-elf sh-*-* arm-*-pe**-* -// prms-id: 9706 - -#include <stdlib.h> - -int count, acount; - -void *operator new(size_t sz) { ++count; return malloc (sz); } -void operator delete(void *p) throw() { --count; free (p); } - -class A { -public: - A() { ++acount; } - A(const A&) { ++acount; } - ~A() { --acount; } -}; - -int main() { - int i; - - for( i = 0; i < 10; i++ ) { - try { - throw A(); - } - catch (A& a) { - } - } - if (acount) - return 1; - if (count) - return 2; -} diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p9732a.C b/gcc/testsuite/g++.old-deja/g++.mike/p9732a.C deleted file mode 100644 index 13c89892b84..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/p9732a.C +++ /dev/null @@ -1,36 +0,0 @@ -// prms-id: 9732 - -class A { - int i; -public: - A() { i = 1; } - ~A() { } -}; - -struct value { - A x,y,z; -}; - -int crash(const value* capt, value* jet) { - return capt == jet; -} - -class euler { -public: - value number() const { return _value; } - int distance(); - -private: - value _value; -}; - -int euler::distance() { - const value& capt = number(); - value jet; - return crash (&capt, &jet); -} - -int main() { - euler e; - return e.distance(); -} diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p9732b.C b/gcc/testsuite/g++.old-deja/g++.mike/p9732b.C deleted file mode 100644 index 59cfe4c578d..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/p9732b.C +++ /dev/null @@ -1,44 +0,0 @@ -// prms-id: 9732 - -int count; -int bail = 0; - -extern "C" void _exit (int); - -struct base { - base () { ++count; } - ~base () { --count; } - base(const base&o) { ++count; } -}; - -class D { -public: - ~D() { - if (bail++) - { - // On some Linux boxes, we run the dtor for d twice, - // once before exit, and once after! - abort (); - } - else - { - if (count != 0) - _exit (1); - _exit (0); - } - } -} d; - -base base_object; - -base base_returning_function (); - -const base& base_ref = base_returning_function (); - -int main () { -} - -base base_returning_function () { - base local_base_object; - return local_base_object; -} diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p9732c.C b/gcc/testsuite/g++.old-deja/g++.mike/p9732c.C deleted file mode 100644 index 9ec773cc9af..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/p9732c.C +++ /dev/null @@ -1,5 +0,0 @@ -// Build don't link: -// prms-id: 9732 - -struct foo {}; -foo& x() { return foo(); } // WARNING - diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p991.C b/gcc/testsuite/g++.old-deja/g++.mike/p991.C deleted file mode 100644 index 037227c4f3e..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/p991.C +++ /dev/null @@ -1,22 +0,0 @@ -// Build don't link: -// prms-id: 991 - -class Complex { -public: - double re; - double im; - Complex(double r,double i) : re(r), im(i) {} -}; - -Complex cos(const Complex&); - -extern "C" double cos (double); // not the same as the above -extern "C" double cosh (double); -extern "C" double sin (double); -extern "C" double sinh (double); - -Complex cos(const Complex& arg) { - double nr = cos(arg.re)*cosh(arg.im); - double ni = -sin(arg.re)*sinh(arg.im); - return Complex(nr,ni); -} diff --git a/gcc/testsuite/g++.old-deja/g++.mike/parse1.C b/gcc/testsuite/g++.old-deja/g++.mike/parse1.C deleted file mode 100644 index 12e26cf26ea..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/parse1.C +++ /dev/null @@ -1,7 +0,0 @@ -// Build don't link: - -enum { name1 }; -struct name0 { }; -struct name1 { }; -struct derived1 : public name1 { }; -struct derived2 : public name0, public name1 { }; diff --git a/gcc/testsuite/g++.old-deja/g++.mike/pmd1.C b/gcc/testsuite/g++.old-deja/g++.mike/pmd1.C deleted file mode 100644 index 260dc095eba..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/pmd1.C +++ /dev/null @@ -1,12 +0,0 @@ -// Build don't link: - -class A; -struct XX { int A::*py; }; - -class A { -public: - int p; - void setp(XX *xp); -}; - -void A::setp(XX *xp) { xp->py = &A::p; } diff --git a/gcc/testsuite/g++.old-deja/g++.mike/pmf1.C b/gcc/testsuite/g++.old-deja/g++.mike/pmf1.C deleted file mode 100644 index a39512f42d4..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/pmf1.C +++ /dev/null @@ -1,90 +0,0 @@ -// extern "C" printf(const char *, ...); - -class X -{ -public: - int a; - int f(int); -}; - -class Y -{ -public: - int b; - int c; - int g(int); -}; - -class MD : public X, public Y -{ -public: - int c; - int hf(int); -}; - -int MD::* pmi0 = &MD::a; -int MD::* pmi1 = &MD::b; -int MD::* pmi2 = &MD::c; - -int (MD::* pmf0)(int) = &MD::f; -int (MD::* pmf1)(int) = &MD::g; -int (MD::* pmf2)(int) = &MD::hf; - -int main() -{ - MD obj; - int fail = 0; - - obj.a = 1; - obj.b = 2; - obj.c = 3; - - obj.*pmi0 = 7; - obj.*pmi1 = 8; - obj.*pmi2 = 9; - - fail += (obj.*pmf0)(7); - fail += (obj.*pmf1)(8); - fail += (obj.*pmf2)(9); - -#if 0 - if (fail != 0) - printf ("failed %d tests\n", fail); - else - printf ("passed\n"); - - printf ("sizeof(X) = %d, sizeof(Y) = %d, sizeof(MD) = %d\n", - sizeof(X), sizeof(Y), sizeof(MD)); -#endif - return fail; -} - -int X::f(int v) -{ - if (v != a) - { -// printf ("failed in X::f, a = %d\n", a); - return 1; - } - return 0; -} - -int Y::g(int v) -{ - if (v != b) - { -// printf ("failed in Y::g, b = %d\n", b); - return 1; - } - return 0; -} - -int MD::hf(int v) -{ - if (v != c) - { -// printf ("failed in MD::hf, c = %d\n", c); - return 1; - } - return 0; -} diff --git a/gcc/testsuite/g++.old-deja/g++.mike/pmf2.C b/gcc/testsuite/g++.old-deja/g++.mike/pmf2.C deleted file mode 100644 index 5a5aa0667b6..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/pmf2.C +++ /dev/null @@ -1,54 +0,0 @@ -extern "C" int printf(const char *, ...); - -class A_table { - int c; -public: - A_table() { c = 3;} - virtual void func2(int &item) { printf("func2(%d,) c=%d\n",item,c);} -}; - -class B_table : private A_table { - typedef void (B_table::* B_ti_fn) (int &item); -public: - B_table() { j = 0x4321;} - virtual void call_fn_fn1(int &item, void *pfn1); - void func1(int &item) { printf("func1(%d)\n",item);} - virtual void func2(int &item) { printf("func2(%d) j=%d\n",item,j);} - int j; -}; - -class foo : public A_table { -public: - int i; - virtual ~foo(); - virtual void func2(int &item) { printf("func2(%d) i=%d\n",item,i);} -}; -foo::~foo() { i = 0;} - -class bar :public foo,public B_table { -public: - int w; - virtual ~bar(); - virtual void func2(int &item) { printf("func2(%d) w=%d\n",item,w);} -}; -bar::~bar() { w = 0;} - -void B_table::call_fn_fn1(int &item, void *pfn1) { - (this->*(*(B_ti_fn*)pfn1))(item); -} - -B_table b; -bar jar; - -int main() { - printf("ptr to B_table=%x, ptr to A_table=%x\n",&b,(A_table*)&b); - B_table::B_ti_fn z = &B_table::func1; - int j = 1; - jar.call_fn_fn1(j,(void *)&z); - j++; - z = &B_table::func2; - b.call_fn_fn1(j,(void *)&z); - j++; - jar.call_fn_fn1(j,(void *)&z); - return 0; -} diff --git a/gcc/testsuite/g++.old-deja/g++.mike/pmf3.C b/gcc/testsuite/g++.old-deja/g++.mike/pmf3.C deleted file mode 100644 index b38f0b7d16b..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/pmf3.C +++ /dev/null @@ -1,19 +0,0 @@ -struct Fooey { - void f(char* pX); - void f(int in); - void f(float fx); - void h(double dx); -}; - -void Fooey::f(char*) { } // ERROR - candidate -void Fooey::f(int) { } // ERROR - candidate -void Fooey::f(float) { } // ERROR - candidate -void Fooey::h(double zahl) { } - -int main() { - Fooey Blah; - void (Fooey::*pointer)(double); - pointer = &Fooey::f; // ERROR - don't call Fooey::h - (Blah.*pointer)(42.5); - return 0; -} diff --git a/gcc/testsuite/g++.old-deja/g++.mike/pmf4.C b/gcc/testsuite/g++.old-deja/g++.mike/pmf4.C deleted file mode 100644 index 02e5b10c1ac..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/pmf4.C +++ /dev/null @@ -1,13 +0,0 @@ -// Build don't link: - -class NF { }; - -struct QF { - NF nf; - - typedef float(NF::* const NPF)() const; - - void p (NPF npf) const { - float q = (nf.*npf)(); - } -}; diff --git a/gcc/testsuite/g++.old-deja/g++.mike/pmf5.C b/gcc/testsuite/g++.old-deja/g++.mike/pmf5.C deleted file mode 100644 index 685801a8591..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/pmf5.C +++ /dev/null @@ -1,31 +0,0 @@ -// Special g++ Options: -w - -class A { - int j; -}; - -class Space { - int j; -}; - -typedef int (A::*pma)(); - -class B : public Space, virtual public A { -public: - int i; - int foo () { - return i!=42; - } - B() { - i = 42; - } -}; - -int call_base (A* ap, pma pmf) { - return (ap->*pmf)(); -} - -int main() { - B b; - return call_base ((A*)&b, (pma)&B::foo); -} diff --git a/gcc/testsuite/g++.old-deja/g++.mike/pmf6.C b/gcc/testsuite/g++.old-deja/g++.mike/pmf6.C deleted file mode 100644 index 6848781aca3..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/pmf6.C +++ /dev/null @@ -1,12 +0,0 @@ -// Special g++ Options: - -class S { -public: - void (S::*pmf)(); - void foo() { - pmf(); // WARNING - - } - static void foo1(S* sp) { - (sp->pmf)(); // ERROR - - } -}; diff --git a/gcc/testsuite/g++.old-deja/g++.mike/pmf7.C b/gcc/testsuite/g++.old-deja/g++.mike/pmf7.C deleted file mode 100644 index b238171ba5f..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/pmf7.C +++ /dev/null @@ -1,29 +0,0 @@ -class A; -typedef int (A::*f_ptr) (void); - -class B { -public: - B() {}; ~B() {}; - B& dummy(f_ptr cb) { return *this; }; -}; - -template<class SP, class CB> SP& call_dummy(SP* sp, CB cb) { - sp->dummy(cb); - return *sp; -}; - -class A { -public: - A() {}; ~A() {}; - int ok() { return 0; }; - A& call_it(B* s) { - call_dummy(s, &A::ok); - return *this; - }; -}; - -int main() { - A a; B b; - a.call_it(&b); - return 0; -} diff --git a/gcc/testsuite/g++.old-deja/g++.mike/pmf8.C b/gcc/testsuite/g++.old-deja/g++.mike/pmf8.C deleted file mode 100644 index 41a4c0194fb..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/pmf8.C +++ /dev/null @@ -1,31 +0,0 @@ -int fail; - -class A *ptr_a; - -class A { -public: - char space1[24]; - virtual void foo() { - if (this != ptr_a) - fail = 1; - } -}; - -class Space { - char space2[36]; -}; - -class B : public Space, public A { -} b; - -void (B::*pmf1)() = &A::foo; -void (A::*pmf2)() = &A::foo; - -int main() { - ptr_a = &b; - (b .* (void (B::*) ()) &A::foo) (); - (b .* pmf1) (); - (b .* pmf2) (); - (b .* &A::foo) (); - return fail; -} diff --git a/gcc/testsuite/g++.old-deja/g++.mike/pmf9.C b/gcc/testsuite/g++.old-deja/g++.mike/pmf9.C deleted file mode 100644 index 800618ff6c6..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/pmf9.C +++ /dev/null @@ -1,23 +0,0 @@ -class K { -public: - int f(int i) { return i; } -}; - -class Q { -public: - Q() { kp = new K; } - int g(); -private: - K * kp; -}; - -int Q::g() { - return (kp->f)(42); -}; - - -int main () { - Q q; - if (q.g() != 42) - return 1; -} diff --git a/gcc/testsuite/g++.old-deja/g++.mike/pt1.C b/gcc/testsuite/g++.old-deja/g++.mike/pt1.C deleted file mode 100644 index 2ef8556b13d..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/pt1.C +++ /dev/null @@ -1,36 +0,0 @@ -template <class T, class V> -class A { -public: - A (T at, V av); - void print () { } -protected: - T t; - V v; -}; - -template <class T, class V> -A<T, V>::A (T at, V av) { - t = at; - v = av; -} - - -template <class T, class V> -class B: public virtual A<T, V> { -public: - B (T at, V av); - void print () { } -}; - -template <class T, class V> -B<T, V>::B (T at, V av) : A<T, V> (at, av) { } // gets bogus error - - -int main () { - int i = 2; - double x = 2; - - B<int, double> ab(i, x); - ab.print(); - - return 0; -} diff --git a/gcc/testsuite/g++.old-deja/g++.mike/pt2.C b/gcc/testsuite/g++.old-deja/g++.mike/pt2.C deleted file mode 100644 index 7c96cabff4d..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/pt2.C +++ /dev/null @@ -1,22 +0,0 @@ -class A { -public: -}; - -template <class T> -class B: public virtual A { -public: - B (); - ~B (); -}; - -template <class T> -B<T>::B () { } - -template <class T> -B<T>::~B () { } - -int main () { - B<int> ab; - - return 0; -} diff --git a/gcc/testsuite/g++.old-deja/g++.mike/pt3.C b/gcc/testsuite/g++.old-deja/g++.mike/pt3.C deleted file mode 100644 index a61d9023f8c..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/pt3.C +++ /dev/null @@ -1,29 +0,0 @@ -// Build don't link: - -template<class Repr> -class syHandle -{ -protected: - syHandle(); - ~syHandle(); - Repr *_repr; -}; - -template<class Repr> -syHandle<Repr>::~syHandle() -{ -} - -typedef char * char_ptr_t; - -template <> -syHandle<char_ptr_t>::syHandle() -{ - _repr = 0; -} - -template <> -syHandle<char_ptr_t>::~syHandle() -{ - _repr = 0; -} diff --git a/gcc/testsuite/g++.old-deja/g++.mike/pt4.C b/gcc/testsuite/g++.old-deja/g++.mike/pt4.C deleted file mode 100644 index 7c1563e93a7..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/pt4.C +++ /dev/null @@ -1,4 +0,0 @@ -// Build don't link: - -template <char* c> struct B { B() { } }; -B<0> bnull; // ERROR - could not convert template argument diff --git a/gcc/testsuite/g++.old-deja/g++.mike/ref1.C b/gcc/testsuite/g++.old-deja/g++.mike/ref1.C deleted file mode 100644 index 054c9850c67..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/ref1.C +++ /dev/null @@ -1,21 +0,0 @@ -int count; - -struct base { - base () { ++count; } - ~base () { --count; } - base(const base&o) { ++count; } -}; - -base base_returning_function (); - -const base& base_ref = base_returning_function (); - -int main () { - if (count != 1) - return 1; -} - -base base_returning_function () { - base local_base_object; - return local_base_object; -} diff --git a/gcc/testsuite/g++.old-deja/g++.mike/rtti1.C b/gcc/testsuite/g++.old-deja/g++.mike/rtti1.C deleted file mode 100644 index e44c5fafdc5..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/rtti1.C +++ /dev/null @@ -1,4 +0,0 @@ -// Build don't link: - -#include <typeinfo> -#include <iostream.h> diff --git a/gcc/testsuite/g++.old-deja/g++.mike/rtti2.C b/gcc/testsuite/g++.old-deja/g++.mike/rtti2.C deleted file mode 100644 index 0c8b8b0c24c..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/rtti2.C +++ /dev/null @@ -1,5 +0,0 @@ -#include <typeinfo> - -int main() { - typeid(bool); -} diff --git a/gcc/testsuite/g++.old-deja/g++.mike/rtti3.C b/gcc/testsuite/g++.old-deja/g++.mike/rtti3.C deleted file mode 100644 index a250a26b0f4..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/rtti3.C +++ /dev/null @@ -1,23 +0,0 @@ -class base { -public: - virtual ~base() {} - virtual void m1() = 0; - virtual void m2() = 0; -}; - -class intermediate : public virtual base { -public: - virtual ~intermediate() {} - virtual void m1() {} - virtual void m2() {} -}; - -class derived : public intermediate { -public: - virtual int IwantedThisMethod() { return 0; } - virtual int ButIgotThisOne() { return 1; } -}; - -int main() { - return derived().IwantedThisMethod(); -} diff --git a/gcc/testsuite/g++.old-deja/g++.mike/s9959.C b/gcc/testsuite/g++.old-deja/g++.mike/s9959.C deleted file mode 100644 index 654f7d57dd5..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/s9959.C +++ /dev/null @@ -1,20 +0,0 @@ -// Build don't link: - -class A { -protected: - int aData; -}; - -class B : public A { -public: - virtual void func1() { - A::aData = 1; - } -}; - -class C : virtual public B { -public: - virtual void func1(void) { - A::aData = 2; - } -}; diff --git a/gcc/testsuite/g++.old-deja/g++.mike/scast1.C b/gcc/testsuite/g++.old-deja/g++.mike/scast1.C deleted file mode 100644 index 11666b45430..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/scast1.C +++ /dev/null @@ -1,7 +0,0 @@ -class A {}; -class C {}; - -int main() { - A* a = 0; - C* c = static_cast<C*>(a); // ERROR - bad static cast -} diff --git a/gcc/testsuite/g++.old-deja/g++.mike/temp.C b/gcc/testsuite/g++.old-deja/g++.mike/temp.C deleted file mode 100644 index 5a1ce6754a9..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/temp.C +++ /dev/null @@ -1,31 +0,0 @@ -extern "C" int printf(const char *, ...); -extern "C" const char *getenv(const char *); - -class T { - int i; -public: - T() { - i = 1; - printf("T() at %x\n", this); - } - T(const T& o) { - i = o.i; - printf("T(const T&) at %x <-- %x\n", this, &o); - } - T operator +(const T& o) { - T r; - r.i = this->i + o.i; - return r; - } - operator int () { - return i; - } - ~T() { printf("~T() at %x\n", this); } -} s, b; - -int foo() { return getenv("TEST") == 0; } - -int main() { - int i = foo() ? s+b : s; - return i != 2; -} diff --git a/gcc/testsuite/g++.old-deja/g++.mike/thunk1.C b/gcc/testsuite/g++.old-deja/g++.mike/thunk1.C deleted file mode 100644 index 9780c05bc97..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/thunk1.C +++ /dev/null @@ -1,19 +0,0 @@ -// Build don't link: -// Special g++ Options: -fvtable-thunks - -struct C1 -{ - virtual ~C1(); -}; - -struct C2 : public virtual C1 -{ - virtual ~C2(); -}; - -struct C3 : public virtual C2 -{ - virtual ~C3(); -}; - -C3::~C3() {} diff --git a/gcc/testsuite/g++.old-deja/g++.mike/thunk2.C b/gcc/testsuite/g++.old-deja/g++.mike/thunk2.C deleted file mode 100644 index 9bc4558d9f7..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/thunk2.C +++ /dev/null @@ -1,39 +0,0 @@ -// Special g++ Options: -fvtable-thunks - -#include <typeinfo> - -int state; -int fail; - -class A { -public: - A() { - if (++state != 1) - fail = 1; - } - virtual int foo() { - if (++state != 2) - fail = 1; - } - virtual ~A() { - if (++state != 3) - fail = 1; - } -}; - -A* bar() { - return new A; -} - -main() { - A *aptr = bar(); - aptr->foo(); - if (dynamic_cast <void*> (aptr) != aptr) - fail = 1; - if (typeid (*aptr) != typeid (A)) - fail = 1; - delete aptr; - if (++state != 4) - fail = 1; - return fail; -} diff --git a/gcc/testsuite/g++.old-deja/g++.mike/thunk3.C b/gcc/testsuite/g++.old-deja/g++.mike/thunk3.C deleted file mode 100644 index 9a52c9d6916..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/thunk3.C +++ /dev/null @@ -1,35 +0,0 @@ -// Special g++ Options: -fvtable-thunks - -int state; -int fail; - -class A { -public: - A() { - if (++state != 1) - fail = 1; - } - virtual int foo() { - if (++state != 2) - fail = 1; - } - virtual ~A() { - if (++state != 3) - fail = 1; - } -}; - -A* bar() { - return new A; -} - -main() { - A *aptr = bar(); - aptr->foo(); - if (dynamic_cast <void*> (aptr) != aptr) - fail = 1; - delete aptr; - if (++state != 4) - fail = 1; - return fail; -} diff --git a/gcc/testsuite/g++.old-deja/g++.mike/unroll1.C b/gcc/testsuite/g++.old-deja/g++.mike/unroll1.C deleted file mode 100644 index 90f37f1ef92..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/unroll1.C +++ /dev/null @@ -1,11 +0,0 @@ -// Build don't link: -// Special g++ Options: -g -O -funroll-loops - -struct A { - inline ~A() { } -}; - -void foo (A) { - while (1) - A bar; -} diff --git a/gcc/testsuite/g++.old-deja/g++.mike/virt1.C b/gcc/testsuite/g++.old-deja/g++.mike/virt1.C deleted file mode 100644 index 28483177bf9..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/virt1.C +++ /dev/null @@ -1,13 +0,0 @@ -// Build don't link: - -struct S0 { virtual void f1 () { } }; - -struct S1 : virtual public S0 { virtual void f1 () { } }; - -struct S2 : public S1 { virtual void f1 () { } }; - -struct S3 : virtual public S0 { virtual void f1 () { } }; - -struct S4 : public S3 { }; - -void creator () { new S4; } diff --git a/gcc/testsuite/g++.old-deja/g++.mike/virt2.C b/gcc/testsuite/g++.old-deja/g++.mike/virt2.C deleted file mode 100644 index 612d07e49e3..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/virt2.C +++ /dev/null @@ -1,25 +0,0 @@ -struct S0 { - virtual int is_kind_of_S1 () const { return 0; } - virtual void dummy () { } -}; - -struct S1 : virtual public S0 { - virtual int is_kind_of_S1 () const { return 1; } - virtual void dummy () { } -}; - -struct S2 : virtual public S0 { - virtual void dummy () { } -}; - -struct S3 : public S2, public S1 { - virtual void dummy () { } -}; - -static struct S0 *var = new S3 (); - -int main () { - if (var->is_kind_of_S1() != 1) - return 1; - return 0; -} diff --git a/gcc/testsuite/g++.old-deja/g++.mike/virt3.C b/gcc/testsuite/g++.old-deja/g++.mike/virt3.C deleted file mode 100644 index de3ea3d07e2..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/virt3.C +++ /dev/null @@ -1,17 +0,0 @@ -// Build don't link: - -class B { -public: - int Bi; - virtual int g() { }; -}; - -class D : private B { - int Di; -}; - -class E : public virtual D, public B { - int Ei; -}; // WARNING - direct base inaccessible due to ambiguity - -E e; diff --git a/gcc/testsuite/g++.old-deja/g++.mike/virt4.C b/gcc/testsuite/g++.old-deja/g++.mike/virt4.C deleted file mode 100644 index 9750af6b0b5..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/virt4.C +++ /dev/null @@ -1,27 +0,0 @@ -// Special g++ Options: - -void Foo () {} - -class B { -public: - virtual void foo() = 0; -}; - -class D: virtual public B { -public: - void foo() { Foo(); } -}; - -class D1: public D {}; - -class D2: public D {}; - -class D1_2: public D1, public D2 { -public: - void foo() { D1::foo(); D2::foo(); } -}; - -main() { - D1_2 h; - h.foo(); -} diff --git a/gcc/testsuite/g++.old-deja/g++.mike/virt5.C b/gcc/testsuite/g++.old-deja/g++.mike/virt5.C deleted file mode 100644 index dac85cc2dba..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/virt5.C +++ /dev/null @@ -1,53 +0,0 @@ -// Ensure that virtual base upcast and downcasting works on this -// conversions during virtual function dispatch at ctor/dtor time -// when dynamic vtable fixups for deltas are needed. - -int fail = 0; - -struct BASE1 { - virtual ~BASE1 () { } -}; - -class MID; - -class BASE2 { -public: - virtual MID *VFN (){ return 0; } -}; - -class MIBASE : public BASE1, public BASE2 { }; - -class VBB : public MIBASE { -public: - virtual long get_STATE () const = 0; - void print_STATE() { if (get_STATE () != 87654321) fail = 1; } -}; - -class VBD : public virtual VBB { - long STATE; -public: - long get_STATE() const { return STATE; } - VBD() { STATE = 87654321; } - ~VBD() { STATE = 87654321; } -}; - -class MID : public virtual VBD { -public: - MID () { print_STATE(); } - ~MID () { print_STATE(); } - virtual MID *VFN() { return this; } -}; - -class LAST : public MID { -public: - LAST () { print_STATE(); } - ~LAST () { print_STATE(); } -}; - -int main() { - MIBASE *o = new LAST; - MID *p = o->VFN(); - p->print_STATE(); - delete o; - return fail; -} diff --git a/gcc/testsuite/g++.old-deja/g++.mike/virt6.C b/gcc/testsuite/g++.old-deja/g++.mike/virt6.C deleted file mode 100644 index 61491cede48..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/virt6.C +++ /dev/null @@ -1,39 +0,0 @@ -// This testcase ensures that we can build vtable names for complex MI -// classes. - -class C_A { -public: - virtual int foo(void *) { } -} a; - -class C_B : public C_A { -} b; - -class C_C : public C_A { -} c; - -class C_D : public C_A { -} d; - -class C_E : public C_C, public C_B { -public: - virtual int foo(void *) { } -} e; - -class C_F : public C_D, public C_B { -public: - virtual int foo(void *) { } -} f; - -class C_G : public C_A { -public: - virtual int foo(void *) { } -} g; - -class C_H : public C_G, public C_E, public C_F { -public: - virtual int foo(void *) { } -} h; - -int main() { -} diff --git a/gcc/testsuite/g++.old-deja/g++.mike/vtable1.C b/gcc/testsuite/g++.old-deja/g++.mike/vtable1.C deleted file mode 100644 index 260f93de048..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/vtable1.C +++ /dev/null @@ -1,12 +0,0 @@ -// Build don't run: -// Special g++ Options: -fno-implement-inlines -struct type { - virtual void m1(); - virtual void m2() { } -}; - -void type::m1() { } - -int main() { - type t; -} diff --git a/gcc/testsuite/g++.old-deja/g++.mike/warn1.C b/gcc/testsuite/g++.old-deja/g++.mike/warn1.C deleted file mode 100644 index 206042cb962..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/warn1.C +++ /dev/null @@ -1,13 +0,0 @@ -// Build don't link: -// Special g++ Options: -Wall - -typedef char * charptr; -char c[]={'A','B','C','D'}; -int i=int(&c); -int *pp=&i; -void foo() { } -int main() -{ - charptr(*pp)++; // WARNING - - return 0; -} diff --git a/gcc/testsuite/g++.old-deja/g++.mike/warn2.C b/gcc/testsuite/g++.old-deja/g++.mike/warn2.C deleted file mode 100644 index f865f1e52d9..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/warn2.C +++ /dev/null @@ -1,26 +0,0 @@ -// Build don't link: -// Special g++ Options: -Wall - -enum Boolean { - Ok = 0, - NotOk = 1, -}; - -enum OpResult { - Succeeded = 0, - TempFail = 1, - PermFail = 2, -}; - -OpResult fn1() { - return TempFail; -} - -extern void foo(); - -int -main () { - if (fn1() == Ok) { // WARNING - - foo(); - } -} diff --git a/gcc/testsuite/g++.old-deja/g++.mike/warn3.C b/gcc/testsuite/g++.old-deja/g++.mike/warn3.C deleted file mode 100644 index 7adc8a1c37f..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/warn3.C +++ /dev/null @@ -1,12 +0,0 @@ -// Build don't link: -// Special g++ Options: -Wall - -class B { -public: - B(int) { } -}; - -class D : public B { - int member; - D() : member(0), B(member) { } // WARNING - reordered -}; diff --git a/gcc/testsuite/g++.old-deja/g++.mike/warn4.C b/gcc/testsuite/g++.old-deja/g++.mike/warn4.C deleted file mode 100644 index 9b959b0316f..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/warn4.C +++ /dev/null @@ -1 +0,0 @@ -void foo (int a, int a) { } // ERROR - diff --git a/gcc/testsuite/g++.old-deja/g++.mike/warn5.C b/gcc/testsuite/g++.old-deja/g++.mike/warn5.C deleted file mode 100644 index 742c4bc1807..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/warn5.C +++ /dev/null @@ -1,21 +0,0 @@ -// Build don't link: -// Special g++ Options: -Wpointer-arith - -double X(const double x) { return x; } -double Y() { return 1.0; } -double Z() { return 2.0; } - -struct A { - void bar() { } - void foo() { } -}; - -typedef void (A::*pmf)(); - -static int mememe = &A::foo - &A::bar; // WARNING - -pmf b = &A::foo-1; // WARNING - - -int main() { - double y; - y=X(Y-Z); // WARNING - -} diff --git a/gcc/testsuite/g++.old-deja/g++.mike/warn6.C b/gcc/testsuite/g++.old-deja/g++.mike/warn6.C deleted file mode 100644 index 381a3424da2..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/warn6.C +++ /dev/null @@ -1,42 +0,0 @@ -// Build don't link: -// Special g++ Options: -Woverloaded-virtual - -struct B4 { - virtual void bothfardiff(float); // WARNING - was hidden -}; - -struct B3 : public B4 { -}; - -struct B2 { -}; - -struct B { - virtual void baseonly(int); - - virtual void bothsame(int); - - virtual void bothdiff(float); // WARNING - was hidden - - virtual void both2same(int); - virtual void both2same(float); - - virtual void both12diff(int); - virtual void both12diff(float); // WARNING - was hidden -}; - -struct D : public B, public B2, public B3 { - virtual void derivedonly(int); - - virtual void bothsame(int); - - virtual void bothdiff(int); // WARNING - - - virtual void both2same(int); - virtual void both2same(float); - - virtual void both12diff(int); // WARNING - - - virtual void bothfardiff(int); // WARNING - -}; - diff --git a/gcc/testsuite/g++.old-deja/g++.mike/warn7.C b/gcc/testsuite/g++.old-deja/g++.mike/warn7.C deleted file mode 100644 index 6772f9585f5..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/warn7.C +++ /dev/null @@ -1,14 +0,0 @@ -// Build don't link: -// Special g++ Options: -Wall - -const int& foo() { - extern int bar; - - return bar; -} - -const int* baz() { - extern int bar; - - return &bar; -} diff --git a/gcc/testsuite/g++.old-deja/g++.mike/warn8.C b/gcc/testsuite/g++.old-deja/g++.mike/warn8.C deleted file mode 100644 index 3c61c8e0afb..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.mike/warn8.C +++ /dev/null @@ -1,19 +0,0 @@ -// Build don't link: - -struct foo { - bool test(); -}; -bool func(); - -void test() { - foo A; - bool (foo::* pmf)() = &foo::test; - bool (*pf)() = func; - - if (A.test) ; // WARNING - - if (func) ; // WARNING - - if (bool(A.test)) ; // WARNING - - if (bool(func)) ; - if (pmf) ; - if (pf) ; -} |