llvm-project
llvm-project copied to clipboard
Traverse friend declarations.
foo.h
namespace internal {
void Factory();
}
main.cc
#include foo.h
class Example {
friend void internal::Factory();
};
The foo.h header is marked unused. This is probably due to the include-cleaner library not traversing friend declarations.
@llvm/issue-subscribers-clang-include-cleaner
Another similar problem:
// fwd.h
namespace ns {
struct X;
}
// use.cpp
#include "fwd.h" // <-- unused
struct ns::X { };