PR c++/80290
[official-gcc.git] / gcc / testsuite / g++.dg / tree-ssa / pr50622.C
blobd7f4fa74b953d8f6ed9fbdf843a4562b4c49ee5e
1 // { dg-do compile }
2 // { dg-options "-O2" }
4 typedef __complex__ double Value;
5 struct LorentzVector
7   LorentzVector & operator+=(const LorentzVector & a) {
8     theX += a.theX;
9     theY += a.theY;
10     theZ += a.theZ;
11     theT += a.theT;
12     return *this;
13   }
15   Value theX;
16   Value theY;
17   Value theZ;
18   Value theT;
21 inline LorentzVector
22 operator+(LorentzVector a, const LorentzVector & b) {
23   return a += b;
26 Value ex, et;
27 LorentzVector sum() {
28   LorentzVector v1; v1.theX =ex; v1.theY =ex+et; v1.theZ =ex-et;   v1.theT =et;
29   return v1+v1;