PR c/81231
* c-common.c (sync_resolve_size): Give error for pointers to incomplete
types.
* gcc.dg/atomic-pr81231.c: New test.
From-SVN: r249963
+2017-07-04 Marek Polacek <polacek@redhat.com>
+
+ PR c/81231
+ * c-common.c (sync_resolve_size): Give error for pointers to incomplete
+ types.
+
2017-07-04 Marek Polacek <polacek@redhat.com>
* c-warn.c (warn_if_unused_value): Remove WITH_CLEANUP_EXPR handling.
if (!INTEGRAL_TYPE_P (type) && !POINTER_TYPE_P (type))
goto incompatible;
+ if (!COMPLETE_TYPE_P (type))
+ goto incompatible;
+
if (fetch && TREE_CODE (type) == BOOLEAN_TYPE)
goto incompatible;
+2017-07-04 Marek Polacek <polacek@redhat.com>
+
+ PR c/81231
+ * gcc.dg/atomic-pr81231.c: New test.
+
2017-07-04 Richard Sandiford <richard.sandiford@linaro.org>
PR tree-optimization/81292
--- /dev/null
+/* PR c/81231 */
+/* { dg-do compile } */
+/* { dg-options "" } */
+
+enum E;
+
+void
+foo (void)
+{
+ __atomic_load_n ((enum E *) 0, 0); /* { dg-error "incompatible" } */
+ __atomic_load_n ((enum X *) 0, 0); /* { dg-error "incompatible" } */
+}