Return early when comparing two structures for compatibility
and the type of a member is erroneous.
PR c/118061
gcc/c/ChangeLog:
* c-typeck.cc (tagged_types_tu_compatible_p): Handle
errors in types of struct members.
gcc/testsuite/ChangeLog:
* gcc.dg/pr118061.c: New test.
ft2 = DECL_BIT_FIELD_TYPE (s2);
}
+ if (TREE_CODE (ft1) == ERROR_MARK || TREE_CODE (ft2) == ERROR_MARK)
+ return false;
+
data->anon_field = !DECL_NAME (s1);
data->pointedto = false;
--- /dev/null
+/* { dg-do "compile" } */
+/* { dg-options "-std=gnu23" } */
+
+int main()
+{
+ struct { int x[1++]; } x; /* { dg-error "lvalue required as increment operand" } */
+ struct { int x[1++]; } y; /* { dg-error "lvalue required as increment operand" } */
+}