rttrorg / rttr

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

FTBFS when using GCC 9 #238

Open lbeltrame opened 5 years ago

lbeltrame commented 5 years ago

Found in openSUSE Tumbleweed when rebuilding rttr against GCC 9.

[  170s] In file included from /home/abuild/rpmbuild/BUILD/rttr-0.9.6/src/rttr/../rttr/detail/registration/registration_impl.h:43,
[  170s]                  from /home/abuild/rpmbuild/BUILD/rttr-0.9.6/src/rttr/../rttr/registration.h:821,
[  170s]                  from /home/abuild/rpmbuild/BUILD/rttr-0.9.6/src/rttr/../rttr/registration:46,
[  170s]                  from /home/abuild/rpmbuild/BUILD/rttr-0.9.6/src/unit_tests/constructor/constructor_param_info_test.cpp:28:
[  170s] /home/abuild/rpmbuild/BUILD/rttr-0.9.6/src/rttr/../rttr/detail/registration/bind_impl.h: In instantiation of 'static std::unique_ptr<rttr::detail::constructor_wrapper_base> rttr::registration::bind<rttr::detail::ctor_func, Class_Type, F, acc_level>::create_custom_constructor(Acc_Func, Args&& ...) [with Acc_Func = ctor_param_info_test (*)(std::__cxx11::basic_string<char>, int, bool); Args = {rttr::detail::default_args<int, bool>}; Class_Type = ctor_param_info_test; F = ctor_param_info_test (*)(std::__cxx11::basic_string<char>, int, bool); acc_level = rttr::detail::public_access]':
[  170s] /home/abuild/rpmbuild/BUILD/rttr-0.9.6/src/rttr/../rttr/detail/registration/bind_impl.h:320:47:   required from 'rttr::registration::class_<Class_Type> rttr::registration::bind<rttr::detail::ctor_func, Class_Type, F, acc_level>::operator()(Args&& ...) [with Args = {rttr::detail::default_args<int, bool>}; Class_Type = ctor_param_info_test; F = ctor_param_info_test (*)(std::__cxx11::basic_string<char>, int, bool); acc_level = rttr::detail::public_access]'
[  170s] /home/abuild/rpmbuild/BUILD/rttr-0.9.6/src/unit_tests/constructor/constructor_param_info_test.cpp:76:9:   required from here
[  170s] /home/abuild/rpmbuild/BUILD/rttr-0.9.6/src/rttr/../rttr/detail/registration/bind_impl.h:292:34: error: moving a local object in a return statement prevents copy elision [-Werror=pessimizing-move]
[  170s]   292 |             return std::move(ctor);
[  170s]       |                                  ^
SnapperTT commented 4 years ago

Fix may be here: https://github.com/rttrorg/rttr/pull/243