summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.old-deja/g++.other/inline11.C
blob: 56d803b64ca1a1d32fef98aa9c77844e5892cd06 (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 assemble  }
// { dg-options "-O2" }
// Origin: Jakub Jelinek <jakub@redhat.com>

class baz
{
public:
  baz& operator += (const baz&);
};
 
inline baz& baz::operator += (const baz& r)
{
  return *this;
}

inline baz operator + (int x, const baz& y)
{
  return y;
}

static inline baz bar (int alpha);
static inline baz foo (int alpha)
{
  baz tmp = alpha + foo (alpha);
  tmp += alpha + bar (alpha);
  return tmp;
}

static inline baz bar (int alpha)
{
  baz tmp = alpha + bar (alpha);
  tmp += alpha + foo (alpha);
  return tmp;
}