From eb861dc581c1c1357ac148dbf6bbb25a1643c8c4 Mon Sep 17 00:00:00 2001 From: Marc Espie Date: Thu, 17 Jun 1999 21:45:00 +0000 Subject: Update to 990608 snapshot. Highlights: - official fix for an alpha bug, - cpp changes semantic slightly, - valarray in libstdc++. --- .../testsuite/g++.old-deja/g++.other/cleanup2.C | 26 ++++++++++++++++++++++ .../gcc/testsuite/g++.old-deja/g++.other/empty1.C | 23 +++++++++++++++++++ .../gcc/testsuite/g++.old-deja/g++.other/new3.C | 25 +++++++++++++++++++++ .../testsuite/g++.old-deja/g++.other/overcnv2.C | 18 +++++++++++++++ 4 files changed, 92 insertions(+) create mode 100644 gnu/egcs/gcc/testsuite/g++.old-deja/g++.other/cleanup2.C create mode 100644 gnu/egcs/gcc/testsuite/g++.old-deja/g++.other/empty1.C create mode 100644 gnu/egcs/gcc/testsuite/g++.old-deja/g++.other/new3.C create mode 100644 gnu/egcs/gcc/testsuite/g++.old-deja/g++.other/overcnv2.C (limited to 'gnu/egcs') 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 +// 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 + +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 +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 *p = new A; +} 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 +} -- cgit v1.2.3