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