aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/g++.dg/vect/pr60836.cc
blob: 83bb1837531f280e22ccf38d59b1219c49e00387 (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
35
36
37
38
39
// { dg-do compile }

int a, b;
typedef double (*NormFunc) (const int &);
int &
max (int &p1, int &p2)
{
  if (p1 < p2)
    return p2;
  return p1;
}

struct A
{
  int operator      () (int p1, int p2)
    {
      return max (p1, p2);
    }
};
template < class, class > double
norm_ (const int &)
{
  char c, d;
  A e;
  for (; a; a++)
    {
      b = e (b, d);
      b = e (b, c);
    }
}

void
norm ()
{
  static NormFunc f = norm_ < int, A >;
  f = 0;
}

// { dg-final { cleanup-tree-dump "vect" } }