1. 14 Apr, 2020 1 commit
    • Ralf W. Grosse-Kunstleve's avatar
      Adding a default virtual destructor to Animal type in test_tagbased_polymorphic.cpp. · f6e543b1
      Ralf W. Grosse-Kunstleve authored
      With this change, and cast.h as-is in master, test_tagbased_polymorphic.cpp fails to compile with the error message below.
      With the cast.h change in pull/2016, building and testing succeeds.
      
      cd pybind11/build/tests && /usr/bin/c++  -DPYBIND11_TEST_BOOST -DPYBIND11_TEST_EIGEN -Dpybind11_tests_EXPORTS -Ipybind11/include -I/usr/include/python3.7m -isystem /usr/include/eigen3  -Os -DNDEBUG -fPIC -fvisibility=hidden   -std=c++2a -flto -fno-fat-lto-objects -Wall -Wextra -Wconversion -Wcast-qual -Wdeprecated -o CMakeFiles/pybind11_tests.dir/test_tagbased_polymorphic.cpp.o -c pybind11/tests/test_tagbased_polymorphic.cpp
      In file included from pybind11/include/pybind11/attr.h:13,
                       from pybind11/include/pybind11/pybind11.h:44,
                       from pybind11/tests/pybind11_tests.h:2,
                       from pybind11/tests/test_tagbased_polymorphic.cpp:10:
      pybind11/include/pybind11/cast.h: In instantiation of ‘static std::pair<const void*, const pybind11::detail::type_info*> pybind11::detail::type_caster_base<type>::src_and_type(const itype*) [with type = Animal; pybind11::detail::type_caster_base<type>::itype = Animal]’:
      pybind11/include/pybind11/cast.h:906:31:   required from ‘static pybind11::handle pybind11::detail::type_caster_base<type>::cast_holder(const itype*, const void*) [with type = Animal; pybind11::detail::type_caster_base<type>::itype = Animal]’
      pybind11/include/pybind11/cast.h:1566:51:   required from ‘static pybind11::handle pybind11::detail::move_only_holder_caster<type, holder_type>::cast(holder_type&&, pybind11::return_value_policy, pybind11::handle) [with type = Animal; holder_type = std::unique_ptr<Animal>]’
      pybind11/include/pybind11/stl.h:175:69:   required from ‘static pybind11::handle pybind11::detail::list_caster<Type, Value>::cast(T&&, pybind11::return_value_policy, pybind11::handle) [with T = std::vector<std::unique_ptr<Animal> >; Type = std::vector<std::unique_ptr<Animal> >; Value = std::unique_ptr<Animal>]’
      pybind11/include/pybind11/pybind11.h:159:43:   required from ‘void pybind11::cpp_function::initialize(Func&&, Return (*)(Args ...), const Extra& ...) [with Func = std::vector<std::unique_ptr<Animal> > (*&)(); Return = std::vector<std::unique_ptr<Animal> >; Args = {}; Extra = {pybind11::name, pybind11::scope, pybind11::sibling}]’
      pybind11/include/pybind11/pybind11.h:64:9:   required from ‘pybind11::cpp_function::cpp_function(Return (*)(Args ...), const Extra& ...) [with Return = std::vector<std::unique_ptr<Animal> >; Args = {}; Extra = {pybind11::name, pybind11::scope, pybind11::sibling}]’
      pybind11/include/pybind11/pybind11.h:819:22:   required from ‘pybind11::module& pybind11::module::def(const char*, Func&&, const Extra& ...) [with Func = std::vector<std::unique_ptr<Animal> > (*)(); Extra = {}]’
      pybind11/tests/test_tagbased_polymorphic.cpp:141:36:   required from here
      pybind11/include/pybind11/cast.h:880:61: error: ambiguous template instantiation for ‘struct pybind11::polymorphic_type_hook<Animal, void>’
               const void *vsrc = polymorphic_type_hook<itype>::get(src, instance_type);
                                  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~
      pybind11/include/pybind11/cast.h:844:8: note: candidates are: ‘template<class itype> struct pybind11::polymorphic_type_hook<itype, typename std::enable_if<std::is_polymorphic<_Tp>::value, void>::type> [with itype = Animal]’
       struct polymorphic_type_hook<itype, detail::enable_if_t<std::is_polymorphic<itype>::value>>
              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      pybind11/tests/test_tagbased_polymorphic.cpp:115:12: note:                 ‘template<class itype> struct pybind11::polymorphic_type_hook<itype, typename std::enable_if<std::is_base_of<Animal, itype>::value, void>::type> [with itype = Animal]’
           struct polymorphic_type_hook<itype, detail::enable_if_t<std::is_base_of<Animal, itype>::value>>
                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      In file included from pybind11/include/pybind11/attr.h:13,
                       from pybind11/include/pybind11/pybind11.h:44,
                       from pybind11/tests/pybind11_tests.h:2,
                       from pybind11/tests/test_tagbased_polymorphic.cpp:10:
      pybind11/include/pybind11/cast.h:880:61: error: incomplete type ‘pybind11::polymorphic_type_hook<Animal, void>’ used in nested name specifier
               const void *vsrc = polymorphic_type_hook<itype>::get(src, instance_type);
                                  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~
      f6e543b1
  2. 17 Jan, 2020 1 commit
  3. 19 Dec, 2019 1 commit
  4. 24 Nov, 2019 1 commit
  5. 14 Nov, 2019 2 commits
  6. 31 Oct, 2019 1 commit
    • Sebastian Gsänger's avatar
      test pair-copyability on C++17 upwards (#1886) · a83d69e7
      Sebastian Gsänger authored
      * test pair-copyability on C++17 upwards
      
      The stdlib falsely detects containers like M=std::map<T, U>
      as copyable, even when one of T and U is not copyable.
      Therefore we cannot rely on the stdlib dismissing std::pair<T, M>
      by itself, even on C++17.
      
      * fix is_copy_assignable
      
      bind_map used std::is_copy_assignable which suffers from the same problems
      as std::is_copy_constructible, therefore the same fix has been applied.
      
      * created tests for copyability
      a83d69e7
  7. 23 Oct, 2019 1 commit
  8. 20 Sep, 2019 2 commits
  9. 19 Sep, 2019 1 commit
  10. 04 Sep, 2019 1 commit
  11. 27 Aug, 2019 1 commit
  12. 19 Aug, 2019 2 commits
  13. 16 Aug, 2019 1 commit
  14. 15 Aug, 2019 1 commit
  15. 27 Jul, 2019 1 commit
  16. 23 Jul, 2019 1 commit
  17. 19 Jul, 2019 1 commit
  18. 18 Jul, 2019 1 commit
  19. 15 Jul, 2019 2 commits
  20. 06 Jul, 2019 1 commit
  21. 22 Jun, 2019 1 commit
  22. 13 Jun, 2019 1 commit
  23. 11 Jun, 2019 6 commits
  24. 10 Jun, 2019 2 commits
  25. 12 May, 2019 1 commit
  26. 06 Apr, 2019 1 commit
    • Henry Schreiner's avatar
      CI fixes (#1744) · ae951ca0
      Henry Schreiner authored
      * Fix warning that not including a cmake source or build dir will be a fatal error (it is now on newest CMakes)
          * Fixes appveyor
      * Travis uses CMake 3.9 for more than a year now
      * Travis dropped sudo: false in December
      * Dropping Sphinx 2
      - clang7: Suppress self-assign warnings; fix missing virtual dtors
      - pypy:
        - Keep old version (newer stuff breaks)
        - Pin packages to extra index for speed
      - travis:
        - Make docker explicit; remove docker if not needed
        - Make commands more verbose (for debugging / repro)
        - Make Ubuntu dist explicit per job
      - Fix Windows
      - Add names to travis
      ae951ca0
  27. 04 Feb, 2019 3 commits
  28. 03 Jan, 2019 1 commit