diff options
Diffstat (limited to 'gcc/testsuite/gcc.dg/pr36774-2.c')
-rw-r--r-- | gcc/testsuite/gcc.dg/pr36774-2.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/pr36774-2.c b/gcc/testsuite/gcc.dg/pr36774-2.c new file mode 100644 index 000000000..bf394c9ca --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr36774-2.c @@ -0,0 +1,9 @@ +/* Nested functions shouldn't produce warnings if defined before first use. + Bug 36774. Test with -Wmissing-declarations. */ +/* { dg-do compile } */ +/* { dg-options "-Wmissing-declarations" } */ + +int foo(int a) { /* { dg-warning "no previous declaration" } */ + int bar(int b) { return b; } /* { dg-bogus "no previous declaration" } */ + return bar(a); +} |