Skip to content

Commit 8e145c0

Browse files
committed
IWYU cleanup
``` iwyu version: include-what-you-use 0.17 based on Debian clang version 13.0.1-3+build2 ``` Command used: ``` iwyu -c -std=c++17 -DPYBIND11_TEST_BOOST -Iinclude/pybind11 -I/usr/include/python3.9 -I/usr/include/eigen3 include/pybind11/pytypes.cpp ``` pytypes.cpp is a temporary file: `#include "pytypes.h"` The raw output is very long and noisy. I decided to use `#include <cstddef>` instead of `#include <cstdio>` for `std::size_t` (iwyu sticks to the manual choice). I ignored all iwyu suggestions that are indirectly covered by `#include <Python.h>`. I manually verified that all added includes are actually needed.
1 parent 53e29f4 commit 8e145c0

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

include/pybind11/pytypes.h

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,15 @@
1212
#include "detail/common.h"
1313
#include "buffer_info.h"
1414

15-
#include <cstdio>
15+
#include <assert.h>
16+
#include <cstddef>
1617
#include <exception>
18+
#include <frameobject.h>
19+
#include <iterator>
20+
#include <memory>
1721
#include <string>
1822
#include <type_traits>
23+
#include <typeinfo>
1924
#include <utility>
2025

2126
#if defined(PYBIND11_HAS_OPTIONAL)

0 commit comments

Comments
 (0)