You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
clang-include-cleaner suggest to include header where base class is defined as well as forward declaration when base/derived class headers should be enough.
clang-tidy misc-include-cleaner output:
clang-tidy -checks="-*,misc-include-cleaner" Forward.cpp
5 warnings generated.
Forward.cpp:3:39: warning: no header providing "detail::Forward" is directly included [misc-include-cleaner]
2 |
3 | void Test::do_something(const detail::Forward& forward)
| ^
Forward.cpp:5:5: warning: no header providing "Base" is directly included [misc-include-cleaner]
5 | Base::do_something(forward);
| ^
I tried clang-include-cleaner from main (7d8b4eb).
Base class header file (Base.h):
#pragma once
namespace detail
{
class Forward;
}
class Base
{
public:
virtual void do_something(const detail::Forward& forward);
};
Header file (Forward.h):
#pragma once
#include "Base.h"
class Test : public Base
{
public:
void do_something(const detail::Forward& forward) override;
};
`clang-include-cleaner` suggest to include header where base class is defined as well as forward declaration when base/derived class headers should be enough.
clang-tidy misc-include-cleaner output:
clang-tidy -checks="-*,misc-include-cleaner" Forward.cpp
5 warnings generated.
Forward.cpp:3:39: warning: no header providing "detail::Forward" is directly included [misc-include-cleaner]
2 |
3 | void Test::do_something(const detail::Forward& forward)
| ^
Forward.cpp:5:5: warning: no header providing "Base" is directly included [misc-include-cleaner]
5 | Base::do_something(forward);
| ^
I tried clang-include-cleaner from main (7d8b4eb).
Base class header file (Base.h):
#pragma once
namespace detail
{
class Forward;
}
class Base
{
public:
virtual void do_something(const detail::Forward& forward);
};
Header file (Forward.h):
#pragma once
#include "Base.h"
class Test : public Base
{
public:
void do_something(const detail::Forward& forward) override;
};
clang-include-cleaner
suggest to include header where base class is defined as well as forward declaration when base/derived class headers should be enough.clang-tidy misc-include-cleaner
output:I tried
clang-include-cleaner
frommain
(7d8b4eb).Base class header file (
Base.h
):Header file (
Forward.h
):Source file (
Forward.cpp
):The text was updated successfully, but these errors were encountered: