On Sun, Apr 14, 2024 at 02:30:27PM +0200, Martin Uecker wrote:
> 2024-04-12  Martin Uecker  <uec...@tugraz.at>
>           Jakub Jelinek  <ja...@redhat.com>
> 
>       PR lto/114574
>       PR c/114361
> gcc/
>       * ipa-free-lang-data.cc (fld_incomplete_type_of): Allow
>       either of the types in the assert to have TYPE_STRUCTURAL_EQUALITY_P.
> gcc/c/
>       * c-decl.cc (shadow_tag_warned): For flag_isoc23 and code not
>       ENUMERAL_TYPE use SET_TYPE_STRUCTURAL_EQUALITY.
>       (parser_xref_tag): Likewise.
>       (start_struct): For flag_isoc23 use SET_TYPE_STRUCTURAL_EQUALITY.
>       (c_update_type_canonical): New function.
>       (finish_struct): Put NULL as second == operand rather than first.
>       Assert TYPE_STRUCTURAL_EQUALITY_P.  Call c_update_type_canonical.
>       * c-typeck.cc (composite_type_internal): Use
>       SET_TYPE_STRUCTURAL_EQUALITY.  Formatting fix.
> gcc/testsuite/
>       * gcc.dg/pr114574-1.c: New test.
>       * gcc.dg/pr114574-2.c: New test.
>       * gcc.dg/pr114361.c: New test.
>       * gcc.dg/c23-tag-incomplete-1.c: New test.
>       * gcc.dg/c23-tag-incomplete-2.c: New test.

Just a nit I haven't seen before (not a review, can't do that when
I've participated on the patch):

> --- /dev/null
> +++ b/gcc/testsuite/gcc.dg/c23-tag-incomplete-1.c
> @@ -0,0 +1,14 @@
> +/* { dg-do compile }
> + * { dg-options "-std=c23 -g" } */
> +
> +struct a;
> +typedef struct a b;
> +
> +void g() {
> +    struct a { b* x; };
> +}
> +
> +struct a { b* x; };
> +
> +
> +

Please avoid the trailing whitespace in the testcases.  They should end with
a single newline, not 3-4 newlines.

        Jakub

Reply via email to