summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/nested-func-3.c
blob: 19e8a6155b90f1439d405695eab697727235dfb8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
/* Undefined nested function should be a error, whether or not the
   function is called.  Bug 17807.  */
/* Origin: Joseph Myers <joseph@codesourcery.com> */
/* { dg-do compile } */
/* { dg-options "" } */

void
f (void)
{
  auto int fn (int); /* { dg-error "nested function 'fn' declared but never defined" } */
  auto int fn2 (int); /* { dg-error "nested function 'fn2' declared but never defined" } */
  sizeof(fn(1));
}

void
h (void)
{
  auto int hn (int); /* { dg-error "nested function 'hn' declared but never defined" } */
  hn (1);
}