+2015-04-28 Marek Polacek <polacek@redhat.com>
+
+ PR c/65901
+ * c-typeck.c (c_build_va_arg): Require TYPE be a complete type.
+
2015-04-25 Marek Polacek <polacek@redhat.com>
PR c/52085
if (warn_cxx_compat && TREE_CODE (type) == ENUMERAL_TYPE)
warning_at (loc, OPT_Wc___compat,
"C++ requires promoted type, not enum type, in %<va_arg%>");
+ if (type == error_mark_node || !COMPLETE_TYPE_P (type))
+ {
+ c_incomplete_type_error (NULL_TREE, type);
+ return error_mark_node;
+ }
return build_va_arg (loc, expr, type);
}
+2015-04-28 Marek Polacek <polacek@redhat.com>
+
+ PR c/65901
+ * gcc.c-torture/compile/pr48767.c (foo): Add dg-error.
+ * gcc.dg/pr65901.c: New test.
+
2015-04-28 Richard Biener <rguenther@suse.de>
PR tree-optimization/62283
2015-04-27 Jeff Law <law@redhat.com>
- PR tree-optimization/65217
+ PR tree-optimization/65217
* gcc.target/i386/pr65217.c: Remove XFAIL.
2015-04-27 Andre Vehreschild <vehre@gmx.de>
void
foo (__builtin_va_list ap)
{
- __builtin_va_arg (ap, void);
+ __builtin_va_arg (ap, void); /* { dg-error "invalid use of void expression" } */
}
--- /dev/null
+/* PR c/65901 */
+/* { dg-do compile } */
+/* { dg-options "" } */
+
+struct S;
+enum E;
+union U;
+
+void
+foo (__builtin_va_list ap)
+{
+ __builtin_va_arg (ap, void); /* { dg-error "invalid use of void expression" } */
+ __builtin_va_arg (ap, struct S); /* { dg-error "invalid use of undefined type" } */
+ __builtin_va_arg (ap, enum E); /* { dg-error "invalid use of undefined type" } */
+ __builtin_va_arg (ap, union U); /* { dg-error "invalid use of undefined type" } */
+}