Minimum code:
// foo.h
typedef struct foo_s foo_t;
struct foo_s {
foo_t* next;
};
iwyu insists I forward declare struct foo_s before I typedef it to foo_t.
Output:
$ iwyu -c foo.h
foo.h should add these lines:
struct foo_s;
foo.h should remove these lines:
The full include-list for foo.h:
struct foo_s;
---
This is true across different versions of iwyu, including newer versions with -Xiwyu --no_fwd_decls added.
Is this a mistake in iwyu or does the C standard want me to define the type before the typedef?