aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/c2x-old-style-definition-6.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gcc.dg/c2x-old-style-definition-6.c')
-rw-r--r--gcc/testsuite/gcc.dg/c2x-old-style-definition-6.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/c2x-old-style-definition-6.c b/gcc/testsuite/gcc.dg/c2x-old-style-definition-6.c
new file mode 100644
index 0000000..fc0e778
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/c2x-old-style-definition-6.c
@@ -0,0 +1,16 @@
+/* Test old-style function definitions not in C2x: () does not give
+ type with a prototype except for function definitions. */
+/* { dg-do compile } */
+/* { dg-options "-std=c2x" } */
+
+void f1 ();
+
+/* Prototyped function returning a pointer to unprototyped function. */
+void (*f2 (void))() { return f1; }
+
+void
+g (void)
+{
+ f1 (1);
+ f2 () (1);
+}