aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/g++.dg/pr50763-4.C
blob: 2605d81925bf14e9673cda59bea035e3bd86f658 (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
30
31
32
33
34
/* { dg-do compile } */
/* { dg-options "-O2 -ftree-tail-merge" } */

float
clamp (const float x)
{
  return x <= 1 ? 1 : x;
}

template < class T > struct VECTOR
{
  float x;
};
template < class TV > class JOINT
{
  virtual void Constrain_Angles (VECTOR < float >&angles) const;
};

template < class TV > class ANGLE_JOINT:public JOINT < TV >
{
  virtual ~ ANGLE_JOINT ()
  {
  }
  void Constrain_Angles (VECTOR < float >&angles) const
  {
    VECTOR < float >v;
    if (v.x)
        v.x = clamp (angles.x);
    else
        v.x = angles.x;
      angles.x = v.x;
  }
};
template ANGLE_JOINT < int >::~ANGLE_JOINT ();