]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
[multiple changes]
authorJason Merrill <jason@gcc.gnu.org>
Sun, 28 Sep 1997 19:21:52 +0000 (15:21 -0400)
committerJason Merrill <jason@gcc.gnu.org>
Sun, 28 Sep 1997 19:21:52 +0000 (15:21 -0400)
Sat Sep 27 16:48:00 1997  Jason Merrill  <jason@yorick.cygnus.com>

* std/complext.h: Lose injection decls.
* std/fcomplex.h: Likewise.
* std/dcomplex.h: Likewise.
* std/ldcomplex.h: Likewise.

Sat Sep 27 16:47:35 1997  Mark Mitchell  <mmitchell@usa.net>

* std/complext.h: Declare templates before making them
friends.  Use new friend <> syntax.
* std/complext.cc: Don't rely on guiding declarations.
* std/fcomplex.h: Use new friend <> syntax.
* std/dcomplex.h: Likewise.
* std/ldcomplex.h: Likewise.

From-SVN: r15776

libstdc++/ChangeLog
libstdc++/std/complext.cc
libstdc++/std/complext.h
libstdc++/std/dcomplex.h
libstdc++/std/fcomplex.h
libstdc++/std/ldcomplex.h
libstdc++/tests/tstring.exp

index b4bb2bb36bb6eb0a55a40bcb4bd84b3466716877..94a3460f80675ff843902c8b59e0b3b37460e42c 100644 (file)
@@ -1,3 +1,19 @@
+Sat Sep 27 16:48:00 1997  Jason Merrill  <jason@yorick.cygnus.com>
+
+       * std/complext.h: Lose injection decls.
+       * std/fcomplex.h: Likewise.
+       * std/dcomplex.h: Likewise.
+       * std/ldcomplex.h: Likewise.
+
+Sat Sep 27 16:47:35 1997  Mark Mitchell  <mmitchell@usa.net>
+
+       * std/complext.h: Declare templates before making them
+       friends.  Use new friend <> syntax.
+       * std/complext.cc: Don't rely on guiding declarations.
+       * std/fcomplex.h: Use new friend <> syntax.
+       * std/dcomplex.h: Likewise.
+       * std/ldcomplex.h: Likewise.
+
 Thu Sep 25 19:55:56 1997  Jason Merrill  <jason@yorick.cygnus.com>
 
        * std/bastring.h: Enable exceptions.
index d50bf0871f6111bb2d67b5df39ea1260686fba8d..60227f213299e6e3759ab7283153af9852d95d99 100644 (file)
@@ -236,7 +236,7 @@ pow (const complex<FLOAT>& xin, int y)
   if (y < 0)
     {
       y = -y;
-      x = 1/x;
+      x = FLOAT(1)/x;
     }
   for (;;)
     {
index 57976f002ce2116caaece4046fc4c0282a384bb8..6c55037bf94bc868f6c078fb5a4b3746872b5ee2 100644 (file)
@@ -41,6 +41,16 @@ class istream;
 class ostream;
 
 extern "C++" {
+template <class _FLT> class complex;
+template <class _FLT> complex<_FLT>&
+  __doapl (complex<_FLT>* ths, const complex<_FLT>& r);
+template <class _FLT> complex<_FLT>&
+  __doami (complex<_FLT>* ths, const complex<_FLT>& r);
+template <class _FLT> complex<_FLT>&
+  __doaml (complex<_FLT>* ths, const complex<_FLT>& r);
+template <class _FLT> complex<_FLT>&
+  __doadv (complex<_FLT>* ths, const complex<_FLT>& r);
+
 template <class _FLT>
 class complex
 {
@@ -55,40 +65,10 @@ public:
 private:
   _FLT re, im;
 
-  friend complex& __doapl (complex *, const complex&);
-  friend complex& __doami (complex *, const complex&);
-  friend complex& __doaml (complex *, const complex&);
-  friend complex& __doadv (complex *, const complex&);
-
-  // These functions are specified as friends for purposes of name injection;
-  // they do not actually reference private members.
-  friend _FLT real (const complex&) __attribute__ ((const));
-  friend _FLT imag (const complex&) __attribute__ ((const));
-  friend complex operator + (const complex&, const complex&) __attribute__ ((const));
-  friend complex operator + (const complex&, _FLT) __attribute__ ((const));
-  friend complex operator + (_FLT, const complex&) __attribute__ ((const));
-  friend complex operator - (const complex&, const complex&) __attribute__ ((const));
-  friend complex operator - (const complex&, _FLT) __attribute__ ((const));
-  friend complex operator - (_FLT, const complex&) __attribute__ ((const));
-  friend complex operator * (const complex&, const complex&) __attribute__ ((const));
-  friend complex operator * (const complex&, _FLT) __attribute__ ((const));
-  friend complex operator * (_FLT, const complex&) __attribute__ ((const));
-  friend complex operator / (const complex&, const complex&) __attribute__ ((const));
-  friend complex operator / (const complex&, _FLT) __attribute__ ((const));
-  friend complex operator / (_FLT, const complex&) __attribute__ ((const));
-  friend bool operator == (const complex&, const complex&) __attribute__ ((const));
-  friend bool operator == (const complex&, _FLT) __attribute__ ((const));
-  friend bool operator == (_FLT, const complex&) __attribute__ ((const));
-  friend bool operator != (const complex&, const complex&) __attribute__ ((const));
-  friend bool operator != (const complex&, _FLT) __attribute__ ((const));
-  friend bool operator != (_FLT, const complex&) __attribute__ ((const));
-  friend complex polar (_FLT, _FLT) __attribute__ ((const));
-  friend complex pow (const complex&, const complex&) __attribute__ ((const));
-  friend complex pow (const complex&, _FLT) __attribute__ ((const));
-  friend complex pow (const complex&, int) __attribute__ ((const));
-  friend complex pow (_FLT, const complex&) __attribute__ ((const));
-  friend istream& operator>> (istream&, complex&);
-  friend ostream& operator<< (ostream&, const complex&);
+  friend complex& __doapl<> (complex *, const complex&);
+  friend complex& __doami<> (complex *, const complex&);
+  friend complex& __doaml<> (complex *, const complex&);
+  friend complex& __doadv<> (complex *, const complex&);
 };
 
 // Declare specializations.
@@ -142,9 +122,6 @@ complex<_FLT>::operator *= (const complex<_FLT>& r)
   return __doaml (this, r);
 }
 
-template <class _FLT> complex<_FLT>&
-  __doadv (complex<_FLT>* ths, const complex<_FLT>& r);
-
 template <class _FLT>
 inline complex<_FLT>&
 complex<_FLT>::operator /= (const complex<_FLT>& r)
index fde3f09ca5c187b625c11e4626e9799f3dc4ec09..5bc329c9bc945b51b655ff136809ed3e2e0b4ace 100644 (file)
@@ -50,40 +50,10 @@ public:
 private:
   double re, im;
 
-  friend complex& __doapl (complex *, const complex&);
-  friend complex& __doami (complex *, const complex&);
-  friend complex& __doaml (complex *, const complex&);
-  friend complex& __doadv (complex *, const complex&);
-
-  // These functions are specified as friends for purposes of name injection;
-  // they do not actually reference private members.
-  friend double real (const complex& x) { return x.real (); }
-  friend double imag (const complex& x) { return x.imag (); }
-  friend complex operator + (const complex&, const complex&) __attribute__ ((const));
-  friend complex operator + (const complex&, double) __attribute__ ((const));
-  friend complex operator + (double, const complex&) __attribute__ ((const));
-  friend complex operator - (const complex&, const complex&) __attribute__ ((const));
-  friend complex operator - (const complex&, double) __attribute__ ((const));
-  friend complex operator - (double, const complex&) __attribute__ ((const));
-  friend complex operator * (const complex&, const complex&) __attribute__ ((const));
-  friend complex operator * (const complex&, double) __attribute__ ((const));
-  friend complex operator * (double, const complex&) __attribute__ ((const));
-  friend complex operator / (const complex&, const complex&) __attribute__ ((const));
-  friend complex operator / (const complex&, double) __attribute__ ((const));
-  friend complex operator / (double, const complex&) __attribute__ ((const));
-  friend bool operator == (const complex&, const complex&) __attribute__ ((const));
-  friend bool operator == (const complex&, double) __attribute__ ((const));
-  friend bool operator == (double, const complex&) __attribute__ ((const));
-  friend bool operator != (const complex&, const complex&) __attribute__ ((const));
-  friend bool operator != (const complex&, double) __attribute__ ((const));
-  friend bool operator != (double, const complex&) __attribute__ ((const));
-  friend complex polar (double, double) __attribute__ ((const));
-  friend complex pow (const complex&, const complex&) __attribute__ ((const));
-  friend complex pow (const complex&, double) __attribute__ ((const));
-  friend complex pow (const complex&, int) __attribute__ ((const));
-  friend complex pow (double, const complex&) __attribute__ ((const));
-  friend istream& operator>> (istream&, complex&);
-  friend ostream& operator<< (ostream&, const complex&);
+  friend complex& __doapl<> (complex *, const complex&);
+  friend complex& __doami<> (complex *, const complex&);
+  friend complex& __doaml<> (complex *, const complex&);
+  friend complex& __doadv<> (complex *, const complex&);
 };
 
 inline complex<float>::complex (const complex<double>& r)
index 3a389e08a76aff1b69dd14ddbf26488aeda58ca6..476c4b60d8037a8729e3f98ec6de793acb3c3a74 100644 (file)
@@ -50,40 +50,10 @@ public:
 private:
   float re, im;
 
-  friend complex& __doapl (complex *, const complex&);
-  friend complex& __doami (complex *, const complex&);
-  friend complex& __doaml (complex *, const complex&);
-  friend complex& __doadv (complex *, const complex&);
-
-  // These functions are specified as friends for purposes of name injection;
-  // they do not actually reference private members.
-  friend float real (const complex& x) { return x.real (); }
-  friend float imag (const complex& x) { return x.imag (); }
-  friend complex operator + (const complex&, const complex&) __attribute__ ((const));
-  friend complex operator + (const complex&, float) __attribute__ ((const));
-  friend complex operator + (float, const complex&) __attribute__ ((const));
-  friend complex operator - (const complex&, const complex&) __attribute__ ((const));
-  friend complex operator - (const complex&, float) __attribute__ ((const));
-  friend complex operator - (float, const complex&) __attribute__ ((const));
-  friend complex operator * (const complex&, const complex&) __attribute__ ((const));
-  friend complex operator * (const complex&, float) __attribute__ ((const));
-  friend complex operator * (float, const complex&) __attribute__ ((const));
-  friend complex operator / (const complex&, const complex&) __attribute__ ((const));
-  friend complex operator / (const complex&, float) __attribute__ ((const));
-  friend complex operator / (float, const complex&) __attribute__ ((const));
-  friend bool operator == (const complex&, const complex&) __attribute__ ((const));
-  friend bool operator == (const complex&, float) __attribute__ ((const));
-  friend bool operator == (float, const complex&) __attribute__ ((const));
-  friend bool operator != (const complex&, const complex&) __attribute__ ((const));
-  friend bool operator != (const complex&, float) __attribute__ ((const));
-  friend bool operator != (float, const complex&) __attribute__ ((const));
-  friend complex polar (float, float) __attribute__ ((const));
-  friend complex pow (const complex&, const complex&) __attribute__ ((const));
-  friend complex pow (const complex&, float) __attribute__ ((const));
-  friend complex pow (const complex&, int) __attribute__ ((const));
-  friend complex pow (float, const complex&) __attribute__ ((const));
-  friend istream& operator>> (istream&, complex&);
-  friend ostream& operator<< (ostream&, const complex&);
+  friend complex& __doapl<> (complex *, const complex&);
+  friend complex& __doami<> (complex *, const complex&);
+  friend complex& __doaml<> (complex *, const complex&);
+  friend complex& __doadv<> (complex *, const complex&);
 };
 } // extern "C++"
 
index 9feb30326bd282bdc99f18f754748b0d01914abc..dd5cfa3fc39b36aba590d3d5750cb49eeebf0218 100644 (file)
@@ -50,40 +50,10 @@ public:
 private:
   long double re, im;
 
-  friend complex& __doapl (complex *, const complex&);
-  friend complex& __doami (complex *, const complex&);
-  friend complex& __doaml (complex *, const complex&);
-  friend complex& __doadv (complex *, const complex&);
-
-  // These functions are specified as friends for purposes of name injection;
-  // they do not actually reference private members.
-  friend long double real (const complex& x) { return x.real (); }
-  friend long double imag (const complex& x) { return x.imag (); }
-  friend complex operator + (const complex&, const complex&) __attribute__ ((const));
-  friend complex operator + (const complex&, long double) __attribute__ ((const));
-  friend complex operator + (long double, const complex&) __attribute__ ((const));
-  friend complex operator - (const complex&, const complex&) __attribute__ ((const));
-  friend complex operator - (const complex&, long double) __attribute__ ((const));
-  friend complex operator - (long double, const complex&) __attribute__ ((const));
-  friend complex operator * (const complex&, const complex&) __attribute__ ((const));
-  friend complex operator * (const complex&, long double) __attribute__ ((const));
-  friend complex operator * (long double, const complex&) __attribute__ ((const));
-  friend complex operator / (const complex&, const complex&) __attribute__ ((const));
-  friend complex operator / (const complex&, long double) __attribute__ ((const));
-  friend complex operator / (long double, const complex&) __attribute__ ((const));
-  friend bool operator == (const complex&, const complex&) __attribute__ ((const));
-  friend bool operator == (const complex&, long double) __attribute__ ((const));
-  friend bool operator == (long double, const complex&) __attribute__ ((const));
-  friend bool operator != (const complex&, const complex&) __attribute__ ((const));
-  friend bool operator != (const complex&, long double) __attribute__ ((const));
-  friend bool operator != (long double, const complex&) __attribute__ ((const));
-  friend complex polar (long double, long double) __attribute__ ((const));
-  friend complex pow (const complex&, const complex&) __attribute__ ((const));
-  friend complex pow (const complex&, long double) __attribute__ ((const));
-  friend complex pow (const complex&, int) __attribute__ ((const));
-  friend complex pow (long double, const complex&) __attribute__ ((const));
-  friend istream& operator>> (istream&, complex&);
-  friend ostream& operator<< (ostream&, const complex&);
+  friend complex& __doapl<> (complex *, const complex&);
+  friend complex& __doami<> (complex *, const complex&);
+  friend complex& __doaml<> (complex *, const complex&);
+  friend complex& __doadv<> (complex *, const complex&);
 };
 
 inline complex<float>::complex (const complex<long double>& r)
index 3333ab1231d3018052d30c0fabf49b1b1d737090..4526279b888a1c65d2ebe84e6e05fd55aade77ae 100644 (file)
@@ -5,6 +5,7 @@ A string initialized to (previous string, 1, 2):el
 A string initialized to @:@
 A string initialized to 20:20
 n = 20 atoi(n) = 20 atof(n) = 20
+is = Hello
 z = x + y = Helloworld
 x += y; x = Helloworld
 y.insert (0, x); y = Helloworld
@@ -15,6 +16,7 @@ ch = x[0] = H
 z = x.substr (2, 3) = llo
 x.replace (2, 2, r); x = Hero
 x.replace (0, 1, 'j'); x = jello
+x = jeHelloo
 enter a word:word =abcdefghijklmnopqrstuvwxyz length = 26
 
 End of test