x
authorJason Merrill <jason@gcc.gnu.org>
Wed, 21 Jul 1999 08:53:38 +0000 (04:53 -0400)
committerJason Merrill <jason@gcc.gnu.org>
Wed, 21 Jul 1999 08:53:38 +0000 (04:53 -0400)
From-SVN: r28205

gcc/testsuite/g++.old-deja/g++.brendan/crash5.C
gcc/testsuite/g++.old-deja/g++.ext/addrfunc4.C [new file with mode: 0644]
gcc/testsuite/g++.old-deja/g++.jason/builtin2.C
gcc/testsuite/g++.old-deja/g++.jason/thunk3.C
gcc/testsuite/g++.old-deja/g++.jason/tpt-1.cc [deleted file]
gcc/testsuite/g++.old-deja/g++.mike/net5.C
gcc/testsuite/g++.old-deja/g++.other/overcnv2.C
gcc/testsuite/g++.old-deja/g++.pt/parms1.C [new file with mode: 0644]
gcc/testsuite/g++.old-deja/g++.pt/static3.C

index 0e82e1607ba30ba0c2752dcebb9a35b99fa85d62..e41596714a2e4b3881686bd971d09ee2caca7994 100644 (file)
@@ -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<T>
                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 (file)
index 0000000..b8d02f7
--- /dev/null
@@ -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 <jason@cygnus.com>
+// 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;
+};
index 698d0a121120fb7278b526ec567e1735dd26e38e..e48e189d029b0423054a5c273c23edf0d9e0a9b9 100644 (file)
@@ -1,6 +1,6 @@
 // Build don't link:
 
-inline void strlen (const char *) { }
+static inline void strlen (const char *) { }
 
 void f ()
 {
index 5127b9b9fa7712f5ad8285fb30bd19a7787ea7b5..3e2bf74469fca9b6587d371de2422049520de8c9 100644 (file)
@@ -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 <stdarg.h>
 
diff --git a/gcc/testsuite/g++.old-deja/g++.jason/tpt-1.cc b/gcc/testsuite/g++.old-deja/g++.jason/tpt-1.cc
deleted file mode 100644 (file)
index 1509520..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-// Testcase for use of template parms as types for other template parms.
-
-template <class T, T t>
-class A {
-    T  a;
-public:
-    A(): a(t) {}
-
-    operator T () { return a; }
-};
-
-template <class S, S s>
-class B {
-    A<S,s> a;
-public:
-    B(A<S,s>& b): a(b) {}
-
-    operator S () { return a*20; }
-};
-
-main()
-{
-    A<int, 5> a;
-    B<int, 5> b(a);
-
-    if (b * a == 500)
-      return 0;
-    else
-      return 1;
-}
index e9144320479fdb8d3df49f2671423c049dc1d8fb..064c73c79ae0d1c63e1f0d0e7475726962058881 100644 (file)
@@ -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 - 
index 725ce0991ce43661cc51f37ccd928ef232a17f3c..f8ef3d39e9b8c0ad24fdc2b57c2f31e9ecda8483 100644 (file)
@@ -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++.pt/parms1.C b/gcc/testsuite/g++.old-deja/g++.pt/parms1.C
new file mode 100644 (file)
index 0000000..65330c6
--- /dev/null
@@ -0,0 +1,31 @@
+// Testcase for use of template parms as types for other template parms.
+
+template <class T, T t>
+class A {
+    T  a;
+public:
+    A(): a(t) {}
+
+    operator T () { return a; }
+};
+
+template <class S, S s>
+class B {
+    A<S,s> a;
+public:
+    B(A<S,s>& b): a(b) {}
+
+    operator S () { return a*20; }
+};
+
+int
+main()
+{
+    A<int, 5> a;
+    B<int, 5> b(a);
+
+    if (b * a == 500)
+      return 0;
+    else
+      return 1;
+}
index 6fe33f9ead9c6d45bd99696aca8d60d474a1321c..8072a60af8375e15b125c518900271f76b1b607e 100644 (file)
@@ -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<class T>
 struct A {