Commit 5846d7f7 by Benjamin Kosnik Committed by Benjamin Kosnik

eb27.C: Convert.


2001-05-15  Benjamin Kosnik  <bkoz@redhat.com>

	* g++.old-deja/g++.robertl/eb27.C: Convert.

From-SVN: r42126
parent 99d8dccc
2001-05-15 Benjamin Kosnik <bkoz@redhat.com>
* g++.old-deja/g++.robertl/eb27.C: Convert.
2001-05-15 Nick Clifton <nickc@cambridge.redhat.com>
* g++.dg/friend-warn.C: New test. Do not warn about friend
......
......@@ -7,7 +7,7 @@
// for the test<T> record_type. This is marked as an expected failure for now,
// until we actually fix it.
#include <iostream.h>
#include <iostream>
template <class T> class test;
template <class T> test<T> operator + (const test<T>& a, const test<T>& b);
......@@ -22,7 +22,7 @@ class test
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 ostream& operator << (ostream& os, const test<T>& a)
friend std::ostream& operator << (std::ostream& os, const test<T>& a)
{ return os << a.elem; };
};
......@@ -34,6 +34,8 @@ test<T> operator + (const test<T>& a, const test<T>& b) return c(a);
int main()
{
test<int> x, y;
x += 5; cout << x << endl;
y = x + test<int>(2); cout << y << endl;
x += 5;
std::cout << x << std::endl;
y = x + test<int>(2);
std::cout << y << std::endl;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment