Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions tests/test_class.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,10 @@ class Args : public py::args {};

} // namespace test_class

namespace {
class Foo {};
} // namespace

static_assert(py::detail::is_same_or_base_of<py::args, py::args>::value, "");
static_assert(
py::detail::is_same_or_base_of<py::args,
Expand Down Expand Up @@ -577,6 +581,9 @@ TEST_SUBMODULE(class_, m) {
});

test_class::pr4220_tripped_over_this::bind_empty0(m);

// test register different classes with same name (in anonymous namespace)
py::class_<Foo>(m, "Foo");
}

template <int N>
Expand Down
7 changes: 7 additions & 0 deletions tests/test_pytypes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,10 @@ struct type_caster<RealNumber> {
} // namespace detail
} // namespace pybind11

namespace {
class Foo {};
} // namespace

TEST_SUBMODULE(pytypes, m) {
m.def("obj_class_name", [](py::handle obj) { return py::detail::obj_class_name(obj.ptr()); });

Expand Down Expand Up @@ -1206,4 +1210,7 @@ TEST_SUBMODULE(pytypes, m) {
m.def("check_type_is", [](const py::object &x) -> py::typing::TypeIs<RealNumber> {
return py::isinstance<RealNumber>(x);
});

// test register different classes with same name (in anonymous namespace)
py::class_<Foo>(m, "Foo");
}
Loading