summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/pr43082.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gcc.dg/pr43082.c')
-rw-r--r--gcc/testsuite/gcc.dg/pr43082.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/pr43082.c b/gcc/testsuite/gcc.dg/pr43082.c
new file mode 100644
index 000000000..a6e004616
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr43082.c
@@ -0,0 +1,10 @@
+/* Test that the compiler does not crash when void expressions are
+ found inside conditional expressions. PR c/43082. */
+/* { dg-do compile } */
+
+void
+foo (int x)
+{
+ if (x ? (void)(0) : (void)(1)) /* { dg-error "void value not ignored as it ought to be" } */
+ ;
+}