aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.old-deja/g++.other/defarg1.C
blob: 68b07a510cc45f7494cf247db060073b03ff786c (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
// Build don't link:

int f (int x)
{
  extern void g (int i = f (x)); // ERROR - default argument uses local
  
  g();

  return 0;
}

int f (void);

int h1 (int (*)(int) = f);
int h2 (int (*)(double) = f); // ERROR - no matching f

template <class T>
int j (T t)
{
  extern void k (int i = j (t)); // ERROR - default argument uses local

  k ();

  return 0;
}

template int j (double); // ERROR - instantiated from here