Skip to content

Commit 657d914

Browse files
authored
cleaned up includes based on include-what-you-use (danmar#4502)
* iwyu.yml: include internal check sources * cleaned up includes based on include-what-you-use
1 parent b973a86 commit 657d914

File tree

7 files changed

+14
-4
lines changed

7 files changed

+14
-4
lines changed

.github/workflows/iwyu.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828
2929
- name: Prepare CMake
3030
run: |
31-
cmake -S . -B cmake.output -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release -DHAVE_RULES=On -DBUILD_TESTS=On -DBUILD_GUI=On -DBUILD_TESTS=On -DBUILD_GUI=On -DWITH_QCHART=On -DCMAKE_GLOBAL_AUTOGEN_TARGET=On -DCMAKE_DISABLE_PRECOMPILE_HEADERS=On -DCPPCHK_GLIBCXX_DEBUG=Off -DUSE_MATCHCOMPILER=Off
31+
cmake -S . -B cmake.output -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release -DHAVE_RULES=On -DBUILD_TESTS=On -DBUILD_GUI=On -DBUILD_TESTS=On -DBUILD_GUI=On -DWITH_QCHART=On -DENABLE_CHECK_INTERNAL=On -DCMAKE_GLOBAL_AUTOGEN_TARGET=On -DCMAKE_DISABLE_PRECOMPILE_HEADERS=On -DCPPCHK_GLIBCXX_DEBUG=Off -DUSE_MATCHCOMPILER=Off
3232
3333
- name: Prepare CMake dependencies
3434
run: |

lib/checkinternal.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,15 @@
2424

2525
#include "check.h"
2626
#include "config.h"
27+
#include "errortypes.h"
2728
#include "settings.h"
2829

2930
#include <string>
3031

32+
class ErrorLogger;
33+
class Token;
34+
class Tokenizer;
35+
3136
/// @addtogroup Checks
3237
/// @{
3338

lib/cppcheck.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
#include <cstddef>
3333
#include <fstream> // IWYU pragma: keep
3434
#include <functional>
35-
#include <istream>
35+
#include <iosfwd>
3636
#include <list>
3737
#include <map>
3838
#include <string>

lib/smallvector.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ static constexpr std::size_t DefaultSmallVectorSize = 0;
2929
template<typename T, std::size_t N = DefaultSmallVectorSize>
3030
using SmallVector = boost::container::small_vector<T, N>;
3131
#else
32+
#include <utility>
3233
#include <vector>
3334

3435
template<class T, std::size_t N>

lib/tokenrange.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,12 @@
2323

2424
#include "config.h"
2525

26+
#include <cstddef>
27+
#include <iterator>
28+
#include <type_traits>
29+
30+
class Token;
31+
2632
template<typename T, REQUIRES("T must be a Token class", std::is_convertible<T*, const Token*> )>
2733
class TokenRangeBase {
2834
T* mFront;

lib/valueflow.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
#include "config.h"
2525
#include "mathlib.h"
2626

27-
#include <algorithm>
2827
#include <cassert>
2928
#include <cstdlib>
3029
#include <functional>

lib/valueptr.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
//---------------------------------------------------------------------------
2323

2424
#include "config.h"
25-
#include <functional>
2625
#include <memory>
2726

2827
template<class T>

0 commit comments

Comments
 (0)