<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/76600>76600</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            Indirectly using a struct member through typedef cause erronously unused header warning
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            new issue
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          FluffyFoxUwU
      </td>
    </tr>
</table>

<pre>
    hello Foxie here, so i have a problem with clangd's include cleaner when isolating between private and public headers (the one which exported to system include dir for other program/library to use)

* expected is clangd would accept this as this is a valid way to seperate public and private implementation
* result is clangd complains that private header should be removed

and a quick Q&A:
Q: why can't i use "// IWYU pragma: keep"?
A: i expected include cleaner should be able to tell, as the impl.c would define for prototype in public.h should be in same form (no expanding typedefs into full length struct definition)

this is a small example codes reproduced it 

public.h (don't define what "struct array_list" for others to use).
```c
#ifndef HEADER_PUBLIC_H
#define HEADER_PUBLIC_H

typedef struct array_list array_list;
extern array_list* array_list_new();

#endif
```
private.h (define the struct type, obviously for internal use to implement the functionality)
```c
#ifndef HEADER_PRIVATE_H
#define HEADER_PRIVATE_H

#include <stddef.h>

struct array_list {
 void** array;
  size_t count;
};

#endif
```
impl.c (the code which implement the functions)
```c
#include <stdlib.h>

#include "private.h" // Included header private.h is not used directly (fix
 available) (clangd unused-includes)
#include "public.h"

extern array_list* array_list_new() {
  array_list* self = malloc(sizeof(array_list));
  *self = (array_list) {
    .array = NULL,
    .count = 0
  };
  return self;
}
```

system informaton:
Clangd: 17.0.5
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyUVluP4jgT_TXmpTQoOA1JHnigm0bTUuvTN6PtXe1Ty7ErxDuOnbUdAvvrV05MSF_2JiECqtupU8flMOfkUSNuyfqerPcL1vna2O1BdVV1OZjzS_-yKI24bGtUysDBnCVCjRYJfQBnQELNTggMWmtKhQ300tfAFd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