summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.old-deja/g++.ext/namedret3.C
blob: 7a0e0d5943f66e6f8c296771c4e98fe2dd5ebdbe (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
// { dg-do assemble  }
// { dg-options "-Wno-deprecated" }

extern "C" void abort();

int f2(int *x)
{
  *x = 1;
  return 2;
}

int f1() return x // { dg-error "" } 
{
  f2(&x); // { dg-error "" } 
}

void g()
{
  int scratch[100];
  int i;
  for (i = 0; i < 100; ++i)
    scratch[i] = 0;
}

int main()
{
  g();
  if (f1() != 1)
    abort ();
  return 0;
}