summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.old-deja/g++.mike/p991.C
blob: fd71dde689542e9551879a73b51fadd4b166b195 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
// { dg-do assemble  }
// prms-id: 991

class Complex {
public:
	double re;
	double im;
	Complex(double r,double i) : re(r), im(i) {}
};

Complex cos(const Complex&);

extern "C" double cos (double);		// not the same as the above
extern "C" double cosh (double);
extern "C" double sin (double);
extern "C" double sinh (double);

Complex cos(const Complex& arg) {
	double nr = cos(arg.re)*cosh(arg.im);
	double ni = -sin(arg.re)*sinh(arg.im);
	return Complex(nr,ni);
}