summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/warn/pr23075.C
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/g++.dg/warn/pr23075.C')
-rw-r--r--gcc/testsuite/g++.dg/warn/pr23075.C9
1 files changed, 9 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.dg/warn/pr23075.C b/gcc/testsuite/g++.dg/warn/pr23075.C
new file mode 100644
index 000000000..e5b1b483d
--- /dev/null
+++ b/gcc/testsuite/g++.dg/warn/pr23075.C
@@ -0,0 +1,9 @@
+// PR c/23075
+// { dg-do compile }
+// { dg-options "-O2 -Wreturn-type" }
+
+int
+foo (void)
+{
+ return; // { dg-error "with no value" }
+} // { dg-warning "no return statement" }