最低代码:
// foo.h
typedef struct foo_s foo_t;
struct foo_s {
foo_t* next;
};
iwyu坚持我struct foo_s在我之前typedef转发声明foo_t。
输出:
$ 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;
---
这适用于不同版本iwyu的-Xiwyu --no_fwd_decls.
这是一个错误iwyu还是C标准希望我在 ? 之前定义类型typedef?