Skip to content

Commit

Permalink
moar clang-tidy
Browse files Browse the repository at this point in the history
  • Loading branch information
EricCousineau-TRI committed Feb 15, 2021
1 parent 0b103da commit edc4865
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 16 deletions.
2 changes: 1 addition & 1 deletion include/pybind11/pybind11.h
Original file line number Diff line number Diff line change
Expand Up @@ -1328,7 +1328,7 @@ template <>
struct holder_check_impl<detail::HolderTypeId::SharedPtr> : public holder_check_impl<detail::HolderTypeId::Unknown> {
template <typename holder_type>
static bool check_destruct(detail::instance* inst, detail::holder_erased holder_raw) {
const holder_type& h = holder_raw.cast<holder_type>();
const auto& h = holder_raw.cast<holder_type>();
handle src((PyObject*)inst);
const detail::type_info *lowest_type = get_lowest_type(src, false);
if (!lowest_type)
Expand Down
2 changes: 1 addition & 1 deletion include/pybind11/pytypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -1638,7 +1638,7 @@ class wrapper : public Base {
public:
using Base::Base;

virtual ~wrapper() {
virtual ~wrapper() { // NOLINT(modernize-use-override)
delete_py_if_in_cpp();
}

Expand Down
28 changes: 14 additions & 14 deletions tests/test_ownership_transfer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -95,27 +95,27 @@ class DefinePyBaseWrapped : public py::wrapper<DefineBase<label>> {
};

// BaseBad - No wrapper alias.
typedef DefineBase<BaseBadLabel> BaseBad;
typedef DefineBaseContainer<BaseBadLabel> BaseBadContainer;
typedef Stats<ChildBadLabel> ChildBadStats;
using BaseBad = DefineBase<BaseBadLabel>;
using BaseBadContainer = DefineBaseContainer<BaseBadLabel>;
using ChildBadStats = Stats<ChildBadLabel>;

// Base - wrapper alias used in pybind definition.
typedef DefineBase<BaseLabel> Base;
typedef DefinePyBase<BaseLabel> PyBase;
typedef DefineBaseContainer<BaseLabel> BaseContainer;
typedef Stats<ChildLabel> ChildStats;
using Base = DefineBase<BaseLabel>;
using PyBase = DefinePyBase<BaseLabel>;
using BaseContainer = DefineBaseContainer<BaseLabel>;
using ChildStats = Stats<ChildLabel>;

// - Unique Ptr
// BaseBad - No wrapper alias.
typedef DefineBase<BaseBadUniqueLabel> BaseBadUnique;
typedef DefineBaseUniqueContainer<BaseBadUniqueLabel> BaseBadUniqueContainer;
typedef Stats<ChildBadUniqueLabel> ChildBadUniqueStats;
using BaseBadUnique = DefineBase<BaseBadUniqueLabel>;
using BaseBadUniqueContainer = DefineBaseUniqueContainer<BaseBadUniqueLabel>;
using ChildBadUniqueStats = Stats<ChildBadUniqueLabel>;

// Base - wrapper alias used directly.
typedef DefineBase<BaseUniqueLabel> BaseUnique;
typedef DefinePyBaseWrapped<BaseUniqueLabel> PyBaseUnique;
typedef DefineBaseUniqueContainer<BaseUniqueLabel> BaseUniqueContainer;
typedef Stats<ChildUniqueLabel> ChildUniqueStats;
using BaseUnique = DefineBase<BaseUniqueLabel>;
using PyBaseUnique = DefinePyBaseWrapped<BaseUniqueLabel>;
using BaseUniqueContainer = DefineBaseUniqueContainer<BaseUniqueLabel>;
using ChildUniqueStats = Stats<ChildUniqueLabel>;

class PyInstanceStats {
public:
Expand Down

0 comments on commit edc4865

Please sign in to comment.