diff options
author | Marc Espie <espie@cvs.openbsd.org> | 1999-06-17 21:45:00 +0000 |
---|---|---|
committer | Marc Espie <espie@cvs.openbsd.org> | 1999-06-17 21:45:00 +0000 |
commit | eb861dc581c1c1357ac148dbf6bbb25a1643c8c4 (patch) | |
tree | 063acae0879ce8ff6e34e40df920b3246803c939 /gnu | |
parent | 51c89d822ef42cc891790f8015b220c7ef2454bd (diff) |
Update to 990608 snapshot.
Highlights:
- official fix for an alpha bug,
- cpp changes semantic slightly,
- valarray in libstdc++.
Diffstat (limited to 'gnu')
4 files changed, 92 insertions, 0 deletions
diff --git a/gnu/egcs/gcc/testsuite/g++.old-deja/g++.other/cleanup2.C b/gnu/egcs/gcc/testsuite/g++.old-deja/g++.other/cleanup2.C new file mode 100644 index 00000000000..4cd0b55e43d --- /dev/null +++ b/gnu/egcs/gcc/testsuite/g++.old-deja/g++.other/cleanup2.C @@ -0,0 +1,26 @@ +// Origin: Bryan Scattergood <bryan@fsel.com> +// Special g++ Options: -O -fno-exceptions + +extern "C" void abort(); + +class A +{ +public: + A(); + ~A(); + int foo(); +}; + +A::A() {} +A::~A() { abort (); } +int A::foo() {} + +extern int f() +{ + return 0; +} + +int main() +{ + return ((f() != 0) ? A().foo() : 0); +} diff --git a/gnu/egcs/gcc/testsuite/g++.old-deja/g++.other/empty1.C b/gnu/egcs/gcc/testsuite/g++.old-deja/g++.other/empty1.C new file mode 100644 index 00000000000..0789884079b --- /dev/null +++ b/gnu/egcs/gcc/testsuite/g++.old-deja/g++.other/empty1.C @@ -0,0 +1,23 @@ +// Origin: Mark Mitchell <mark@codesourcery.com> + +extern "C" void abort(); +extern "C" void printf(const char*, ...); + +int i; + +struct A; + +struct A* as[10]; + +struct A { + A () { as[i++] = this; } + A (const A&) { as[i++] = this; } + ~A() { if (i == 0 || as[--i] != this) abort(); } +}; + +A f() { return A(); } + +int main () +{ + A a (f ()); +} diff --git a/gnu/egcs/gcc/testsuite/g++.old-deja/g++.other/new3.C b/gnu/egcs/gcc/testsuite/g++.old-deja/g++.other/new3.C new file mode 100644 index 00000000000..fa32cdde6cb --- /dev/null +++ b/gnu/egcs/gcc/testsuite/g++.old-deja/g++.other/new3.C @@ -0,0 +1,25 @@ +typedef __SIZE_TYPE__ size_t; + +template <class T> +struct A +{ + int size; + A () + { + T *p; + p = new T[size]; + int foo; + foo = 5 * size; + }; +}; + +struct B +{ + virtual ~B() { } + void operator delete [] (void *ptr, size_t size) { } +}; + +int main () +{ + A<B> *p = new A<B>; +} diff --git a/gnu/egcs/gcc/testsuite/g++.old-deja/g++.other/overcnv2.C b/gnu/egcs/gcc/testsuite/g++.old-deja/g++.other/overcnv2.C new file mode 100644 index 00000000000..725ce0991ce --- /dev/null +++ b/gnu/egcs/gcc/testsuite/g++.old-deja/g++.other/overcnv2.C @@ -0,0 +1,18 @@ +// Test that we resolve this case as mandated by the standard, but also +// warn about it. We choose op char* not because it is a member of B -- +// the standard says that all conversion ops are treated as coming from +// the type of the argument -- but because it is non-const. + +struct A { + operator const char *() const; +}; + +struct B : public A { + operator char *() { return 0; } +}; + +int main() +{ + B b; + (const char *)b; // WARNING - surprising overload resolution +} |