summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/qual-return-2.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gcc.dg/qual-return-2.c')
-rw-r--r--gcc/testsuite/gcc.dg/qual-return-2.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/qual-return-2.c b/gcc/testsuite/gcc.dg/qual-return-2.c
new file mode 100644
index 000000000..22a1946b0
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/qual-return-2.c
@@ -0,0 +1,13 @@
+/* Test for warnings for qualified function return types. -pedantic test. */
+/* Origin: Joseph Myers <jsm28@cam.ac.uk> */
+/* { dg-do compile } */
+/* { dg-options "-pedantic" } */
+
+/* Qualifying a function return type makes no sense. */
+
+/* The first two of these shouldn't warn (with just -pedantic) as long
+ as the function is not defined. */
+
+volatile void vvoid_fn (void);
+volatile void (*vvoid_ptr) (void);
+volatile void vvoid_fn2 (void) { } /* { dg-warning "qualified" "volatile defn" } */