summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/lto/20091004-2_0.C
blob: 321e50bc28d7b4454d5e0547f0aa4aa2fe60950e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
// { dg-lto-do link }
// { dg-lto-options {{-fPIC -O -flto}} }

typedef double Real;
class Vector {
    int dimen;
    Real* val;
public:
    Vector& operator=(const Vector& vec);
    Vector(int p_dimen, Real *p_val)
	: dimen(p_dimen), val(p_val)    { }
    int dim() const;
};
class DVector : public Vector {
public:
    void reDim(int newdim);
    explicit DVector(const Vector& old);
    DVector& operator=(const Vector& vec)    {
	reDim(vec.dim());
	Vector::operator=(vec);
    }
};
class SLUFactor  {
    DVector vec;
    void solveRight (Vector& x, const Vector& b);
};
void SLUFactor::solveRight (Vector& x, const Vector& b) {
    vec = b;
}