rttrorg / rttr

C++ Reflection Library
https://www.rttr.org
MIT License
3.17k stars 439 forks source link

rttr 0.9.6 unittests not working with clang/libc++ #282

Open marcespie opened 4 years ago

marcespie commented 4 years ago

Specifically, the way test classes are built does not work with the way libc++ creates shared ptrs.

/usr/include/c++/v1/memory:3710:5: error: destructor called on non-final 'ClassSingle6A' that has virtual functions but non-virtual destructor [-Werror,-Wdelete-non-abstract-non-virtual-dtor] data_.second().~_Tp(); ^ /usr/include/c++/v1/memory:3666:5: note: in instantiation of member function 'std::1::shared_ptr_emplace<ClassSingle6A, std::1::allocator >::on_zero_shared' requested here shared_ptr_emplace(_Alloc a) ^ /usr/include/c++/v1/memory:4331:26: note: in instantiation of member function 'std::1::shared_ptr_emplace<ClassSingle6A, std::1::allocator >::shared_ptr_emplace' requested here ::new(hold2.get()) _CntrlBlk(a2, _VSTD::forward<_Args>(args)...); ^ /usr/include/c++/v1/memory:4710:29: note: in instantiation of function template specialization 'std::__1::shared_ptr::make_shared<>' requested here return shared_ptr<_Tp>::make_shared(_VSTD::forward<_Args>(args)...); ^ /build/pobj/rttr-0.9.6/rttr-0.9.6/src/unit_tests/type/test_type.cpp:473:53: note: in instantiation of function template specialization 'std::1::make_shared' requested here std::shared_ptr sharedPtr = std::make_shared();