1/* { dg-do compile } */ 2/* { dg-options "-O2 -ftree-tail-merge" } */ 3 4float 5clamp (const float x) 6{ 7 return x <= 1 ? 1 : x; 8} 9 10template < class T > struct VECTOR 11{ 12 float x; 13}; 14template < class TV > class JOINT 15{ 16 virtual void Constrain_Angles (VECTOR < float >&angles) const; 17}; 18 19template < class TV > class ANGLE_JOINT:public JOINT < TV > 20{ 21 virtual ~ ANGLE_JOINT () 22 { 23 } 24 void Constrain_Angles (VECTOR < float >&angles) const 25 { 26 VECTOR < float >v; 27 if (v.x) 28 v.x = clamp (angles.x); 29 else 30 v.x = angles.x; 31 angles.x = v.x; 32 } 33}; 34template ANGLE_JOINT < int >::~ANGLE_JOINT (); 35