view gcc/testsuite/gcc.dg/nested-func-3.c @ 158:494b0b89df80 default tip

...
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Mon, 25 May 2020 18:13:55 +0900 (2020-05-25)
parents 04ced10e8804
children
line wrap: on
line source
/* 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);
}