Commit Graph

3 Commits

Author SHA1 Message Date
Ralf W. Grosse-Kunstleve
1c0b700fdc Add SpOwner, test_with_sp_owner, test_with_sp_and_wp_owners 2025-04-20 10:54:36 -07:00
Ralf W. Grosse-Kunstleve
a4816471e1 Resolve clang-tidy errors
```
/__w/pybind11/pybind11/tests/test_class_sh_trampoline_weak_ptr.cpp:23:43: error: the parameter 'sp' is copied for each invocation but only used as a const reference; consider making it a const reference [performance-unnecessary-value-param,-warnings-as-errors]
   23 |     void set_wp(std::shared_ptr<VirtBase> sp) { wp = sp; }
      |                                           ^
      |                 const                    &
4443 warnings generated.
```

```
/__w/pybind11/pybind11/tests/test_class_sp_trampoline_weak_ptr.cpp:23:43: error: the parameter 'sp' is copied for each invocation but only used as a const reference; consider making it a const reference [performance-unnecessary-value-param,-warnings-as-errors]
   23 |     void set_wp(std::shared_ptr<VirtBase> sp) { wp = sp; }
      |                                           ^
      |                 const                    &
4430 warnings generated.
```
2025-04-19 13:39:01 -07:00
Ralf W. Grosse-Kunstleve
ff7065723f Add test_class_sp_trampoline_weak_ptr.cpp,py (using std::shared_ptr as holder). Tweak test_class_sh_trampoline_weak_ptr.py to pass, with # THIS NEEDS FIXING comment. 2025-04-19 12:35:50 -07:00