summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/warn/Wunused-15.C
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/g++.dg/warn/Wunused-15.C')
-rw-r--r--gcc/testsuite/g++.dg/warn/Wunused-15.C11
1 files changed, 11 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.dg/warn/Wunused-15.C b/gcc/testsuite/g++.dg/warn/Wunused-15.C
new file mode 100644
index 000000000..efaebc006
--- /dev/null
+++ b/gcc/testsuite/g++.dg/warn/Wunused-15.C
@@ -0,0 +1,11 @@
+// PR c++/39875
+// { dg-do compile }
+// { dg-options "-Wunused-value" }
+
+int *i;
+void
+foo ()
+{
+ *i++; // { dg-warning "value computed is not used" }
+ (void) *i++; // { dg-bogus "value computed is not used" }
+}