From 0f03776326098b582ff036d3f76ad2bda47850db Mon Sep 17 00:00:00 2001 From: Jason Merrill Date: Wed, 21 Jul 1999 04:53:38 -0400 Subject: [PATCH] x From-SVN: r28205 --- .../g++.old-deja/g++.brendan/crash5.C | 4 +--- .../g++.old-deja/g++.ext/addrfunc4.C | 24 +++++++++++++++++++ .../g++.old-deja/g++.jason/builtin2.C | 2 +- gcc/testsuite/g++.old-deja/g++.jason/thunk3.C | 2 +- gcc/testsuite/g++.old-deja/g++.mike/net5.C | 2 +- .../g++.old-deja/g++.other/overcnv2.C | 9 +++++-- .../{g++.jason/tpt-1.cc => g++.pt/parms1.C} | 1 + gcc/testsuite/g++.old-deja/g++.pt/static3.C | 2 +- 8 files changed, 37 insertions(+), 9 deletions(-) create mode 100644 gcc/testsuite/g++.old-deja/g++.ext/addrfunc4.C rename gcc/testsuite/g++.old-deja/{g++.jason/tpt-1.cc => g++.pt/parms1.C} (99%) diff --git a/gcc/testsuite/g++.old-deja/g++.brendan/crash5.C b/gcc/testsuite/g++.old-deja/g++.brendan/crash5.C index 0e82e1607ba3..e41596714a2e 100644 --- a/gcc/testsuite/g++.old-deja/g++.brendan/crash5.C +++ b/gcc/testsuite/g++.old-deja/g++.brendan/crash5.C @@ -7,8 +7,6 @@ // * cp-cvt.c (build_default_binary_type_conversion): Look deeper into // what ARG1 and ARG2 are if they're POINTER_TYPEs. -volatile void exit(int); - class CountableSet { public: @@ -71,7 +69,7 @@ class SimpleSet : virtual public MutSet SimpleSet() { size = 0; - array = ((void*)0) ; // ERROR - implicit conversion + array = 0; } int Get(int p, T& t) { diff --git a/gcc/testsuite/g++.old-deja/g++.ext/addrfunc4.C b/gcc/testsuite/g++.old-deja/g++.ext/addrfunc4.C new file mode 100644 index 000000000000..b8d02f7c35d2 --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.ext/addrfunc4.C @@ -0,0 +1,24 @@ +// Test that an object-dependent reference to a member function can be +// used to produce a pointer to member function, as in VC++. +// Contributed by Jason Merrill +// Special g++ Options: -fpermissive -w + +struct A +{ + int f(int a) { } + void f(int a, int b) { } +}; + +typedef int (A::* pmf1)(int); +typedef void (A::* pmf2)(int, int); + +int main() +{ + A a; + pmf1 fn1; + pmf2 fn2; + + fn1 = a.f; + fn1 = (pmf1)a.f; + fn2 = (pmf2)a.f; +}; diff --git a/gcc/testsuite/g++.old-deja/g++.jason/builtin2.C b/gcc/testsuite/g++.old-deja/g++.jason/builtin2.C index 698d0a121120..e48e189d029b 100644 --- a/gcc/testsuite/g++.old-deja/g++.jason/builtin2.C +++ b/gcc/testsuite/g++.old-deja/g++.jason/builtin2.C @@ -1,6 +1,6 @@ // Build don't link: -inline void strlen (const char *) { } +static inline void strlen (const char *) { } void f () { diff --git a/gcc/testsuite/g++.old-deja/g++.jason/thunk3.C b/gcc/testsuite/g++.old-deja/g++.jason/thunk3.C index 5127b9b9fa77..3e2bf74469fc 100644 --- a/gcc/testsuite/g++.old-deja/g++.jason/thunk3.C +++ b/gcc/testsuite/g++.old-deja/g++.jason/thunk3.C @@ -3,7 +3,7 @@ // support, because it doesn't support variadic functions. // Special g++ Options: -fvtable-thunks -// excess errors test - XFAIL mips*-*-* rs6000-*-* powerpc-*-eabi m68k-*-coff m68k-motorola-sysv m88k-motorola-sysv3 mn10300-*-* mn10200-*-* v850-*-* sh-*-*-* +// excess errors test - XFAIL mips*-*-* rs6000-*-* powerpc-*-eabi m68k-*-coff m68k-motorola-sysv m88k-motorola-sysv3 mn10300-*-* mn10200-*-* v850-*-* sh-*-* #include diff --git a/gcc/testsuite/g++.old-deja/g++.mike/net5.C b/gcc/testsuite/g++.old-deja/g++.mike/net5.C index e9144320479f..064c73c79ae0 100644 --- a/gcc/testsuite/g++.old-deja/g++.mike/net5.C +++ b/gcc/testsuite/g++.old-deja/g++.mike/net5.C @@ -1,7 +1,7 @@ // Build don't link: // Special g++ Options: -volatile void abort(); +volatile void abort(); // WARNING - mismatch volatile void oink() { abort() ; } // gets bogus error - diff --git a/gcc/testsuite/g++.old-deja/g++.other/overcnv2.C b/gcc/testsuite/g++.old-deja/g++.other/overcnv2.C index 725ce0991ce4..f8ef3d39e9b8 100644 --- a/gcc/testsuite/g++.old-deja/g++.other/overcnv2.C +++ b/gcc/testsuite/g++.old-deja/g++.other/overcnv2.C @@ -4,7 +4,7 @@ // the type of the argument -- but because it is non-const. struct A { - operator const char *() const; + operator const char *() const { return ""; } }; struct B : public A { @@ -14,5 +14,10 @@ struct B : public A { int main() { B b; - (const char *)b; // WARNING - surprising overload resolution + if ((const char *)b != 0) // WARNING - surprising overload resolution + return 1; + if ((const char *)(const B)b == 0) + return 2; + if ((const char *)(const B &)b == 0) + return 3; } diff --git a/gcc/testsuite/g++.old-deja/g++.jason/tpt-1.cc b/gcc/testsuite/g++.old-deja/g++.pt/parms1.C similarity index 99% rename from gcc/testsuite/g++.old-deja/g++.jason/tpt-1.cc rename to gcc/testsuite/g++.old-deja/g++.pt/parms1.C index 15095200d011..65330c6524e0 100644 --- a/gcc/testsuite/g++.old-deja/g++.jason/tpt-1.cc +++ b/gcc/testsuite/g++.old-deja/g++.pt/parms1.C @@ -18,6 +18,7 @@ public: operator S () { return a*20; } }; +int main() { A a; diff --git a/gcc/testsuite/g++.old-deja/g++.pt/static3.C b/gcc/testsuite/g++.old-deja/g++.pt/static3.C index 6fe33f9ead9c..8072a60af837 100644 --- a/gcc/testsuite/g++.old-deja/g++.pt/static3.C +++ b/gcc/testsuite/g++.old-deja/g++.pt/static3.C @@ -1,6 +1,6 @@ // On targets that don't support weak symbols, we require an explicit // instantiation of arr. -// excess errors test - XFAIL *-*-aout *-*-coff *-*-hpux* +// excess errors test - XFAIL *-*-aout *-*-coff *-*-hpux* alpha-dec-osf* template struct A {