OSDN Git Service

fix
authorjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 5 Jun 1998 02:20:36 +0000 (02:20 +0000)
committerjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 5 Jun 1998 02:20:36 +0000 (02:20 +0000)
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@20235 138bc75d-0d04-0410-961f-82ee72b054a4

14 files changed:
gcc/testsuite/g++.old-deja/g++.robertl/980310-2.C [deleted file]
gcc/testsuite/g++.old-deja/g++.robertl/980310-3.C [deleted file]
gcc/testsuite/g++.old-deja/g++.robertl/eb100.C [deleted file]
gcc/testsuite/g++.old-deja/g++.robertl/eb117.C [deleted file]
gcc/testsuite/g++.old-deja/g++.robertl/eb121.C
gcc/testsuite/g++.old-deja/g++.robertl/eb127.C
gcc/testsuite/g++.old-deja/g++.robertl/eb26.C
gcc/testsuite/g++.old-deja/g++.robertl/eb27.C
gcc/testsuite/g++.old-deja/g++.robertl/eb36.C
gcc/testsuite/g++.old-deja/g++.robertl/eb40.C [deleted file]
gcc/testsuite/g++.old-deja/g++.robertl/eb70.C
gcc/testsuite/g++.old-deja/g++.robertl/eb72.C [deleted file]
gcc/testsuite/g++.old-deja/g++.robertl/eb76.C
gcc/testsuite/g++.old-deja/g++.robertl/eb96.C [deleted file]

diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/980310-2.C b/gcc/testsuite/g++.old-deja/g++.robertl/980310-2.C
deleted file mode 100644 (file)
index 62c152f..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-// float mismatch.  Abors on i586-pc-linux-gnulibc1 with egcs 1.0.1
-// Should run smoothly. Aborts on i586-pc-linux-gnulibc1
-// From: Max Lawson <mlawson@drfmc.ceng.cea.fr>
-// Message-Id: <9803091022.AA07520@drfmc.ceng.cea.fr>
-
-#include <cstdlib>
-
-void f(double j, double& v)
-{
-  size_t sz = size_t(2*j+1);
-  double norm_ = j*(j+1);
-  double m = j;
-  int sign_ = -1;
-  for (size_t c=1;c<=sz;++c)
-    for (size_t r=1;r<=sz;++r)
-      if (r+sign_*1 == c)
-        {
-          double val = (norm_-m*(m+sign_));
-          for (size_t k=1;k<2;++k) 
-            val *= (norm_ - (m+sign_*k)*(m+sign_*(k+1)));
-          v = val;
-        }
-}
-
-int main()
-{
-  double v;
-  f(1,v);
-  if (v != 4) abort();
-
-  return 0;
-}
-
diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/980310-3.C b/gcc/testsuite/g++.old-deja/g++.robertl/980310-3.C
deleted file mode 100644 (file)
index a8c2e19..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-// Bug: Segfaults on egcs 1.0.1 i586-pc-linux-glibc1
-// From: Max Lawson <mlawson@drfmc.ceng.cea.fr>
-// Message-Id: <9803091022.AA07520@drfmc.ceng.cea.fr>
-
-class S0
-{
-public:
-
-  S0() { };
-
-  virtual ~S0() { }
-};
-
-
-
-struct S { };
-class S1 : public S, public S0
-{ 
-public:
-
-  S1() { }
-};
-
-
-void test_ptr(void *ctxt)
-{
-  S0 *ctxt1 = static_cast<S0*>(ctxt);
-
-  S1* ctxt2 = dynamic_cast<S1*>(ctxt1);
-}
-
-
-int main()
-{
-  S1 *ctxt = new S1();
-
-  test_ptr(ctxt);
-
-  return 0;
-}
-
-
diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb100.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb100.C
deleted file mode 100644 (file)
index fdf7396..0000000
+++ /dev/null
@@ -1,173 +0,0 @@
-// Special g++ Options: -Wall
-
-#include <list>
-
-template < class N, class A >
-class Base
-{
-public:
-    class NN : public N
-    {
-        friend Base<N,A>;
-        friend ostream& operator<<(ostream &os, const NN& n)
-        {
-            n.print(os);
-            return os;
-        }
-    public:
-        void print(ostream &os) const
-        {
-            os << "Base<N,A>::print()" << endl;
-            N::print(os);
-        }
-    };
-
-    typedef NN*                        NNPtr;
-    typedef list<NNPtr>                NList;
-    typedef NList::iterator            n_list_iter;
-
-    class n_iter : public n_list_iter 
-    {
-        friend bool operator<(n_iter a, n_iter b)
-        {
-            return (a->ind() < b->ind());
-        }
-        friend bool operator>(n_iter a, n_iter b)
-        {
-            return (a->ind() > b->ind());
-        }
-
-    public:
-        n_iter() {}
-        n_iter(n_list_iter i) : n_list_iter(i) {}
-        
-        NN& operator*()
-            { return *n_list_iter::operator*();};
-        NN* operator->() 
-            { return n_list_iter::operator*(); }
-    };
-private:
-    NList    ns;
-    n_iter new_n_aux(NN* nd)
-    {
-        ns.push_back(nd);
-        n_iter  nodi = --ns.end();
-        return (nodi);
-    }
-public:
-    n_iter new_n()
-    {
-        return new_n_aux(new NN());
-    }
-    void del_n(n_iter itr) 
-    {
-        NN* n = itr.operator->();
-        ns.erase(itr);
-        delete n;
-    }
-    n_iter           beg_n()          {   return (ns.begin()); }
-    n_iter           end_n()          {   return (ns.end());   }
-};
-
-template <class XN, class XA>
-class YN : public XN
-{
-public:    
-    YN() {};
-    void print(ostream& os) const
-    {
-        os << "YN<XN,XA>::print() " << endl;
-        XN::print(os);
-    }
-    friend ostream& operator<< (ostream& os, const YN& wn)
-    {
-        wn.print(os);
-        return os;
-    }
-};
-
-template <class XN, class XA>
-class YA : public XA
-{
-public:    
-    YA() {};
-    void print(ostream &os) const
-    {
-        os << "YA<XN,XA>::print() " << endl;
-        XA::print(os);
-    }
-    
-    friend ostream& operator<<(ostream& os, const YA &wa)
-    {
-        wa.print(os);
-        return os;
-    }
-};
-
-
-template<class XN, class XA>
-class XBase : public Base< YN<XN, XA>, YA<XN, XA> >
-{
-public:
-    typedef     Base< YN<XN,XA>, YA<XN,XA> >    Net;
-    typedef     Net::n_iter          n_iter;
-    XBase() {};
-};
-
-
-class MyClass
-{
-public:
-  struct ZN
-  {
-    void print(ostream &os) const
-      {
-        os << "MyClass::ZN::print()" << endl;
-      }
-    inline friend ostream& operator<<(ostream& os, const MyClass::ZN& nd)
-      {
-        nd.print(os);
-        return os;
-      }
-  };
-  struct ZA
-  {
-    void print(ostream& os) const
-      {
-        os << "MyClass::ZA::print()" << endl;
-      }
-    inline friend ostream& operator<<(ostream& os, const MyClass::ZA& ar)
-      {
-        ar.print(os);
-        return os;
-      }
-  };
-
-  typedef XBase<ZN,ZA>                    MyXBase;
-  typedef MyXBase::n_iter                 my_n_iter;
-  MyXBase                                 xbase;
-};
-
-main ()
-{
-  MyClass mine;
-  MyClass::my_n_iter  n1, n2, n3, n4;
-
-  n1 = mine.xbase.new_n();
-  n2 = mine.xbase.new_n();
-  n3 = mine.xbase.new_n();
-  n4 = mine.xbase.new_n();
-  
-  cout << *n1 << endl;
-  cout << *n2 << endl;
-  cout << *n3 << endl;
-  cout << *n4 << endl;
-  
-  mine.xbase.del_n(n1);
-  mine.xbase.del_n(n2);
-  mine.xbase.del_n(n3);
-  mine.xbase.del_n(n4);
-}
-
-
-
diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb117.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb117.C
deleted file mode 100644 (file)
index 492abb8..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-#include <stdio.h>
-#include <assert.h>
-
-struct F {
-  int i;
-};
-
-F f;
-
-int main( int, char** ) {
-
-  int F:: *of;
-  int *i = (int *) &of;
-  of = &F::i;
-
-  F *b = ((F*) ((int) &f.i - *i));
-  F *a = &f;
-
-
-  printf("%d\n", a-b);
-  printf("%d\n", b-a);
-
-  assert( (a-b) == -(b-a) );    // will fail with egcs-1.0
-
-  return 0;
-}
index 86be02a..456615d 100644 (file)
@@ -3,7 +3,7 @@ class A {
 private:
   int i1_;
 public:
-  void f(int const i1 = 1); // ERROR -
+  void f(int const i1 = 1); // ERROR - previous specification
 };
 
 void
@@ -19,4 +19,3 @@ main()
   a.f();
   return 0;
 }
-
index 38d51bc..8e0d0f8 100644 (file)
@@ -6,18 +6,23 @@
 
 class foo
 {
+public:
+  static int f();
+  class bar {
+    friend int foo::f();
+//  friend int f();
+    static int x;
   public:
-   static int f();
-   class bar {
-     friend int foo::f();
-//     friend int f();
-     static int x;
-     public:
-     static int f() {return foo::f();};
+    static int f() {return foo::f();};
    };
 };
 
 int foo::f() {
-   return bar::x;
+  return bar::x;
 }
 
+int
+main ()
+{
+  return foo::bar::f ();
+}
index 3b0ffd6..d85ed38 100644 (file)
@@ -2,9 +2,13 @@
 /* simple program to demonstrate the bug with named return values in gcc
 */
 /* (w) 4.9.97 by Kurt Garloff <K.Garloff@ping.de> */
+// Special g++ Options:
 
 #include <iostream.h>
 
+template <class T> class test;
+template <class T> test<T> operator + (const test<T>& a, const test<T>& b);
+
 // A simple numerical class
 template <class T>
 class test
@@ -14,29 +18,19 @@ class test
    test ()  { elem = 0; };
    test (const T& a)  { elem = a; };
    test<T>& operator += (const test<T>& a)  { elem += a.elem; return *this; };
-   friend test<T> operator + (const test<T>&, const test<T>&);
+   friend test<T> operator + <> (const test<T>&, const test<T>&);
    friend ostream& operator << (ostream& os, const test<T>& a)
      { return os << a.elem; };
 };
 
-#ifndef NOBUG
 // named return value version
 template <class T>
 test<T> operator + (const test<T>& a, const test<T>& b) return c(a);
 { c += b; };
 
-#else
-// equiv. version without named ret val
-template <class T>
-test<T> operator + (const test<T>& a, const test<T>& b)
-{ test<T> c(a); c += b; return c; };
-
-#endif
-
 int main()
 {
    test<int> x, y;
    x += 5; cout << x << endl;
-   y = x + 2; cout << y << endl;
+   y = x + test<int>(2); cout << y << endl;
 }
-
index 07fc4c5..542cbeb 100644 (file)
@@ -1,15 +1,19 @@
-  #include <vector>
+// Build don't link:
 
-  template <typename T=float> class foo {
-  public:
-    foo();
-    foo(vector<int> v);
-  private:
-    vector<int> v;
-    T t;
-  };
+#include <vector>
 
-  template <typename T=float> foo<T>::foo()               :v(),   t() {}
-  template <typename T=float> foo<T>::foo(vector<int> v_) :v(v_), t() {}
+template <typename T=float> class foo {
+public:
+  foo();
+  foo(vector<int> v);
+private:
+  vector<int> v;
+  T t;
+};
 
-  foo<float> a;
+template <typename T>
+foo<T>::foo()               :v(),   t() {}
+template <typename T=float>    // ERROR - default parm for member template
+foo<T>::foo(vector<int> v_) :v(v_), t() {}
+
+foo<float> a;
diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb40.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb40.C
deleted file mode 100644 (file)
index 2529fef..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-#include <complex>
-
-void foo() {
-    complex<double> x(0, 0);
-    complex<double> y = 1.0 + x;   // OK
-    complex<double> z = 1 + x;     // line 6: <<<< 1 doesn't match double
-}
index 346eda2..63a6de0 100644 (file)
@@ -1,4 +1,6 @@
-// Build don't link:  
+// conversion ops should be treated as coming from the most derived class
+// for overload resolution.  See [over.match.funcs].
+// Build don't link:
 
 class X {
 public:
@@ -11,7 +13,6 @@ private:
 };
 
 
-void f(Y const& y) {
-  if( bool(y) ) {
-  }
+int f(Y const& y) {
+  return bool(y);
 }
diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb72.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb72.C
deleted file mode 100644 (file)
index fbdf507..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-#include <vector>
-
-template <class T>
-class TPROGRAM
-    {
-    typedef vector< T > ITEMS;
-
-    class const_iterator
-        {
-        /*typename*/ ITEMS::const_iterator i;
-
-        const_iterator(const /*typename*/ ITEMS::const_iterator i2) {
-            i=i2;
-            }
-        };
-    };
index 80cccc8..61920c5 100644 (file)
@@ -1,9 +1,7 @@
 //Build don't link:
-// from include/g++/stl_relops.h
-template <class T>
-inline bool operator!=(const T& x, const T& y) {
-  return !(x == y);
-}
+// the template operator!= interferes.  It should be in a namespace.
+
+#include <utility>
 
 enum T {
   V1
diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb96.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb96.C
deleted file mode 100644 (file)
index 840b2d8..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-class foo
-{
-  public:
-   static int f();
-
-   class bar {
-     friend int foo::f();
-   };
-};
-
-int main()
-{
-   return 0;
-}