We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
clang-include-cleaner suggest to include header with forward declaration when headers with base/derived classes should be enough.
clang-include-cleaner
clang-tidy misc-include-cleaner output:
clang-tidy misc-include-cleaner
clang-tidy -checks="-*,misc-include-cleaner" Forward.cpp 4 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*/) | ^
I tried clang-include-cleaner from main (7d8b4eb).
main
Base class header file (Base.h):
Base.h
#pragma once namespace detail { class Forward; } class Base { public: virtual void do_something(const detail::Forward& forward); };
Header file (Forward.h):
Forward.h
#pragma once #include "Base.h" class Test : public Base { public: void do_something(const detail::Forward& forward) override; };
Source file (Forward.cpp):
Forward.cpp
#include "Forward.h" void Test::do_something(const detail::Forward& /*forward*/) { }
The text was updated successfully, but these errors were encountered:
@llvm/issue-subscribers-clang-include-cleaner
Author: None (EugeneZelenko)
clang-tidy -checks="-*,misc-include-cleaner" Forward.cpp 4 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*/) | ^
#pragma once namespace detail { class Forward; } class Base { public: virtual void do_something(const detail::Forward& forward); };
#pragma once #include "Base.h" class Test : public Base { public: void do_something(const detail::Forward& forward) override; };
#include "Forward.h" void Test::do_something(const detail::Forward& /*forward*/) { }
Sorry, something went wrong.
No branches or pull requests
clang-include-cleaner
suggest to include header with forward declaration when headers with base/derived classes 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: