最低代码:
// 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
?