+2011-01-26 Nicola Pero <nicola.pero@meta-innovation.com>
+
+ PR c/43082
+ * c-typeck.c (c_objc_common_truthvalue_conversion): If we are
+ passed a VOID_TYPE expression, immediately emit an error and
+ return error_mark_node.
+
2011-01-26 Jeff Law <law@redhat.com>
PR rtl-optimization/47464
error_at (location, "used union type value where scalar is required");
return error_mark_node;
+ case VOID_TYPE:
+ error_at (location, "void value not ignored as it ought to be");
+ return error_mark_node;
+
case FUNCTION_TYPE:
gcc_unreachable ();
if (int_operands)
expr = remove_c_maybe_const_expr (expr);
- /* ??? Should we also give an error for void and vectors rather than
- leaving those to give errors later? */
+ /* ??? Should we also give an error for vectors rather than leaving
+ those to give errors later? */
expr = c_common_truthvalue_conversion (location, expr);
if (TREE_CODE (expr) == INTEGER_CST && int_operands && !int_const)
+2011-01-26 Nicola Pero <nicola.pero@meta-innovation.com>
+ Andrew Pinski <pinskia@gmail.com>
+
+ PR c/43082
+ * gcc.dg/pr43082.c: New.
+
2011-01-26 DJ Delorie <dj@redhat.com>
PR rtl-optimization/46878
--- /dev/null
+/* 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" } */
+ ;
+}