c: Allow comparison of pointers to complete and incomplete types for C11 [PR95630]
As noted in bug 95630, C11 removed a restriction in C99 on comparing
pointers to compatible complete and incomplete types (this was one of
the changes in N1439, which was largely a terminological change to
make incomplete types a subset of object types rather than a different
kind of type). Implement that change by using pedwarn_c99 with
OPT_Wpedantic for this diagnostic.
Bootstrapped with no regressions for x86_64-pc-linux-gnu.
gcc/c/
2020-11-23 Joseph Myers <joseph@codesourcery.com>
PR c/95630
* c-typeck.c (build_binary_op): Use pedwarn_c99 with OPT_Wpedantic
for comparisons of complete and incomplete pointers.
gcc/testsuite/
2020-11-23 Joseph Myers <joseph@codesourcery.com>
PR c/95630
* gcc.dg/c11-compare-incomplete-1.c,
gcc.dg/c11-compare-incomplete-2.c,
gcc.dg/c99-compare-incomplete-1.c,
gcc.dg/c99-compare-incomplete-2.c: New tests.