From 7a81d791a4f58afb29197c5bbe960163bf471c42 Mon Sep 17 00:00:00 2001 From: Alejandro Colomar Date: Sat, 12 Aug 2023 14:48:56 +0200 Subject: tests/: Fix includes Signed-off-by: Alejandro Colomar --- tests/cxx/badinc-inl.h | 2 +- tests/cxx/badinc.cc | 6 +++--- tests/cxx/badinc.h | 6 +++++- tests/cxx/std_size_t.cc | 2 +- 4 files changed, 10 insertions(+), 6 deletions(-) diff --git a/tests/cxx/badinc-inl.h b/tests/cxx/badinc-inl.h index 58c5147..4b261fd 100644 --- a/tests/cxx/badinc-inl.h +++ b/tests/cxx/badinc-inl.h @@ -10,7 +10,7 @@ #ifndef INCLUDE_WHAT_YOU_USE_TESTS_CXX_BADINC_INL_H_ #define INCLUDE_WHAT_YOU_USE_TESTS_CXX_BADINC_INL_H_ -#include // the way to get NULL without size_t +#include #include "tests/cxx/badinc-private.h" #include "tests/cxx/badinc-private2.h" diff --git a/tests/cxx/badinc.cc b/tests/cxx/badinc.cc index 2986798..0c42ea2 100644 --- a/tests/cxx/badinc.cc +++ b/tests/cxx/badinc.cc @@ -57,6 +57,8 @@ // Some of the #include lines are deliberately formatted wrong, in // order to test that IWYU handles them correctly. #include // not actually used +#include + #include // for typeid #include "tests/cxx/badinc-inl.h" #include "tests/cxx/badinc.h" @@ -1063,9 +1065,6 @@ int main() { // IWYU: I1_PtrDereferenceClass needs a declaration I1_PtrDereferenceClass* local_i1_ptrdereference_class = 0; int x; - // va_list is normally in , but we already have - // available, so mappings will source it from there. - // IWYU: va_list is...* va_list vl; D1_I1_Typedef d1_i1_typedef; // IWYU: i1_int is...*badinc-i1.h @@ -1837,6 +1836,7 @@ The full include-list for tests/cxx/badinc.cc: #include // for isascii #include #include // for offsetof +#include // for va_list #include // for find #include // for fstream #include // for list diff --git a/tests/cxx/badinc.h b/tests/cxx/badinc.h index 75cbf4d..fae667e 100644 --- a/tests/cxx/badinc.h +++ b/tests/cxx/badinc.h @@ -14,8 +14,11 @@ #include // used only in badinc.cc #include // used both here and in badinc.cc #include +#include + #include // used only in this .h file, not in any other file. #include + #include "tests/cxx/badinc-d2.h" #include "tests/cxx/badinc-d3.h" @@ -391,7 +394,8 @@ tests/cxx/badinc.h should remove these lines: The full include-list for tests/cxx/badinc.h: #include // for errno -#include // for NULL, printf +#include // for NULL +#include // for printf #include // for queue #include // for set #include // for string diff --git a/tests/cxx/std_size_t.cc b/tests/cxx/std_size_t.cc index 9f9824a..d5f45d2 100644 --- a/tests/cxx/std_size_t.cc +++ b/tests/cxx/std_size_t.cc @@ -21,7 +21,7 @@ #include std::size_t f() { - const size_t x = 100; + const std::size_t x = 100; printf("%zu\n", x); return sizeof(int); } -- cgit v1.2.3