#1112349 iwyu: Asks to remove anonymous structs

Package:
src:iwyu
Source:
src:iwyu
Submitter:
Charlemagne Lasse
Date:
2025-09-04 18:25:09 UTC
Severity:
normal
Tags:
#1112349#5
Date:
2025-08-28 19:55:56 UTC
From:
To:
Patch can be found at
https://github.com/include-what-you-use/include-what-you-use/commit/164937a8c307b7d072754e75ffc9787c3de134d8

Problem is that iwyu asks to remove "struct {" and fix_includes simply
does this - basically destroying the source code in the process.

Test case is:

```
#include <stdlib.h>

void *foo(size_t t, void *c);

int bar(void)
{
        struct {
                unsigned char t;
        } *pb, b;

        pb = foo(sizeof(b), &b);

        return pb->t;
}

```

Which creates the diff:

```
--- a/test.c
+++ b/test.c
@@ -4,7 +4,6 @@

 int bar(void)
 {
-        struct {
                 unsigned char t;
         } *pb, b;


```