Open
Description
For this 4-file setup, clang-tidy reports that bar.hpp
is unused in main.cpp
. But this is incorrect, it is necessary for the example to compile.
// main.cpp
#include "call_bar.hpp"
#include "bar.hpp"
#include "base.hpp"
int main() {
return call_bar(Base());
}
// call_bar.hpp
#ifndef CALL_BAR_HPP
#define CALL_BAR_HPP
template <typename T>
int call_bar(T t) {
return bar(t);
}
#endif
// bar.hpp
#ifndef BAR_HPP
#define BAR_HPP
#include "base.hpp"
int bar(Base) {
return 0;
}
#endif
// base.hpp
#ifndef BASE_HPP
#define BASE_HPP
struct Base {};
#endif