Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

strange compile error: clang7.0 #110

Closed
gabyx opened this issue Jan 31, 2018 · 13 comments
Closed

strange compile error: clang7.0 #110

gabyx opened this issue Jan 31, 2018 · 13 comments

Comments

@gabyx
Copy link
Contributor

gabyx commented Jan 31, 2018

I have a simple use case which compiles fine:
https://github.com/gabyx/ExecutionGraph/blob/c4b1cccfd855d418dfb3fe53b2cc257aaabcbf14/tests/src/main_Factory.cpp#L36

In another target, I am not even using registration, only RTTR_ENABLE(...).
I get some strange errors:
Backend.hpp

In file included from /Users/gabrielnuetzi/Desktop/ExecutionGraph/gui/executionGraphGui/cefapp/mac/AppMac.mm:18:
In file included from /Users/gabrielnuetzi/Desktop/ExecutionGraph/gui/executionGraphGui/cefapp/AppHandler.hpp:21:
In file included from /Users/gabrielnuetzi/Desktop/ExecutionGraph/gui/executionGraphGui/backend/Backend.hpp:17:
In file included from /usr/local/opt/rttr/include/rttr/type:31:
In file included from /usr/local/opt/rttr/include/rttr/type.h:32:
In file included from /usr/local/opt/rttr/include/rttr/string_view.h:498:
In file included from /usr/local/opt/rttr/include/rttr/detail/impl/string_view_impl.h:32:
In file included from /usr/local/opt/rttr/include/rttr/detail/misc/utility.h:34:
/usr/local/opt/rttr/include/rttr/detail/misc/misc_type_traits.h:464:79: error: expected member name or ';' after declaration specifiers
        template <typename U> static NoType& check(typename U::no_array_type*);
                              ~~~~~~~~~~~~~                                   ^
/usr/local/opt/rttr/include/rttr/detail/misc/misc_type_traits.h:465:57: error: expected member name or ';' after declaration specifiers
        template <typename U> static YesType& check(...);
                              ~~~~~~~~~~~~~~            ^
/usr/local/opt/rttr/include/rttr/detail/misc/misc_type_traits.h:468:61: error: use of undeclared identifier 'check'
        static RTTR_CONSTEXPR_OR_CONST bool value = (sizeof(check<array_mapper<T> >(0)) == sizeof(YesType));
                                                            ^
/usr/local/opt/rttr/include/rttr/detail/misc/misc_type_traits.h:468:83: error: expected '(' for function-style cast or type construction
        static RTTR_CONSTEXPR_OR_CONST bool value = (sizeof(check<array_mapper<T> >(0)) == sizeof(YesType));
                                                                  ~~~~~~~~~~~~~~~ ^
/usr/local/opt/rttr/include/rttr/detail/misc/misc_type_traits.h:483:75: error: expected member name or ';' after declaration specifiers
        template <typename U> static YesType& check(typename U::is_valid*);
                              ~~~~~~~~~~~~~~                              ^
/usr/local/opt/rttr/include/rttr/detail/misc/misc_type_traits.h:484:56: error: expected member name or ';' after declaration specifiers
        template <typename U> static NoType& check(...);
                              ~~~~~~~~~~~~~            ^
/usr/local/opt/rttr/include/rttr/detail/misc/misc_type_traits.h:487:61: error: use of undeclared identifier 'check'
        static RTTR_CONSTEXPR_OR_CONST bool value = (sizeof(check<T>(0)) == sizeof(YesType));
                                                            ^
/usr/local/opt/rttr/include/rttr/detail/misc/misc_type_traits.h:487:67: error: 'T' does not refer to a value
        static RTTR_CONSTEXPR_OR_CONST bool value = (sizeof(check<T>(0)) == sizeof(YesType));
                                                                  ^
/usr/local/opt/rttr/include/rttr/detail/misc/misc_type_traits.h:477:24: note: declared here
    template <typename T>
                       ^
/usr/local/opt/rttr/include/rttr/detail/misc/misc_type_traits.h:504:31: error: use of undeclared identifier 'check'
        using type = decltype(check<T>(nullptr));
                              ^
/usr/local/opt/rttr/include/rttr/detail/misc/misc_type_traits.h:504:37: error: 'T' does not refer to a value
        using type = decltype(check<T>(nullptr));
                                    ^
/usr/local/opt/rttr/include/rttr/detail/misc/misc_type_traits.h:498:24: note: declared here
    template <typename T>
                       ^
/usr/local/opt/rttr/include/rttr/detail/misc/misc_type_traits.h:472:51: error: non-type template argument is not a constant expression
    using is_array = std::integral_constant<bool, is_array_impl<remove_cv_t< remove_reference_t<T> > >::value>;
                                                  ^
/usr/local/opt/rttr/include/rttr/detail/variant_array_view/variant_array_view_traits.h:48:81: note: in instantiation of template type alias 'is_array' requested here
using can_create_array_container = std::integral_constant<bool, ::rttr::detail::is_array<T>::value || is_wrapper_array_type<T>::value || is_pointer_array_type<T>::value>;
                                                                                ^
/usr/local/opt/rttr/include/rttr/detail/variant/variant_data_policy.h:298:24: note: in instantiation of template type alias 'can_create_array_container' requested here
                return can_create_array_container<T>::value;
                       ^
/usr/local/opt/rttr/include/rttr/detail/variant/variant_impl.h:55:43: note: in instantiation of member function 'rttr::detail::variant_data_base_policy<bool, rttr::detail::variant_data_policy_arithmetic<bool>, rttr::detail::default_type_converter<bool, rttr::detail::convert_from<bool> > >::invoke' requested here
:   m_policy(&detail::variant_policy<Tp>::invoke)
                                          ^
/usr/local/opt/rttr/include/rttr/detail/variant/variant_data_converter.h:283:31: note: in instantiation of function template specialization 'rttr::variant::variant<const bool &, bool>' requested here
        return to_enumeration(from, to);
                              ^
In file included from /Users/gabrielnuetzi/Desktop/ExecutionGraph/gui/executionGraphGui/cefapp/mac/AppMac.mm:18:
In file included from /Users/gabrielnuetzi/Desktop/ExecutionGraph/gui/executionGraphGui/cefapp/AppHandler.hpp:21:
In file included from /Users/gabrielnuetzi/Desktop/ExecutionGraph/gui/executionGraphGui/backend/Backend.hpp:17:
In file included from /usr/local/opt/rttr/include/rttr/type:31:
In file included from /usr/local/opt/rttr/include/rttr/type.h:32:
In file included from /usr/local/opt/rttr/include/rttr/string_view.h:498:
In file included from /usr/local/opt/rttr/include/rttr/detail/impl/string_view_impl.h:32:
In file included from /usr/local/opt/rttr/include/rttr/detail/misc/utility.h:34:
/usr/local/opt/rttr/include/rttr/detail/misc/misc_type_traits.h:491:68: error: non-type template argument is not a constant expression
    using is_associative_container = std::integral_constant<bool, !has_is_valid_alias<associative_container_mapper<Tp> >::value>;
                                                                   ^
/usr/local/opt/rttr/include/rttr/detail/variant_associative_view/variant_associative_view_creator.h:46:66: note: in instantiation of template type alias 'is_associative_container' requested here
using can_create_associative_view = std::integral_constant<bool, is_associative_container<raw_type_t<wrapper_address_return_type_t<T>>>::value>;
                                                                 ^
/usr/local/opt/rttr/include/rttr/detail/variant/variant_data_policy.h:302:24: note: in instantiation of template type alias 'can_create_associative_view' requested here
                return can_create_associative_view<T>::value;
                       ^
/usr/local/opt/rttr/include/rttr/detail/variant/variant_impl.h:55:43: note: in instantiation of member function 'rttr::detail::variant_data_base_policy<bool, rttr::detail::variant_data_policy_arithmetic<bool>, rttr::detail::default_type_converter<bool, rttr::detail::convert_from<bool> > >::invoke' requested here
:   m_policy(&detail::variant_policy<Tp>::invoke)
                                          ^
/usr/local/opt/rttr/include/rttr/detail/variant/variant_data_converter.h:283:31: note: in instantiation of function template specialization 'rttr::variant::variant<const bool &, bool>' requested here
        return to_enumeration(from, to);
                              ^
In file included from /Users/gabrielnuetzi/Desktop/ExecutionGraph/gui/executionGraphGui/cefapp/mac/AppMac.mm:18:
In file included from /Users/gabrielnuetzi/Desktop/ExecutionGraph/gui/executionGraphGui/cefapp/AppHandler.hpp:21:
In file included from /Users/gabrielnuetzi/Desktop/ExecutionGraph/gui/executionGraphGui/backend/Backend.hpp:17:
In file included from /usr/local/opt/rttr/include/rttr/type:31:
In file included from /usr/local/opt/rttr/include/rttr/type.h:32:
In file included from /usr/local/opt/rttr/include/rttr/string_view.h:498:
In file included from /usr/local/opt/rttr/include/rttr/detail/impl/string_view_impl.h:32:
In file included from /usr/local/opt/rttr/include/rttr/detail/misc/utility.h:34:
/usr/local/opt/rttr/include/rttr/detail/misc/misc_type_traits.h:494:67: error: non-type template argument is not a constant expression
    using is_sequential_container = std::integral_constant<bool, !has_is_valid_alias<sequential_container_mapper<Tp > >::value>;
                                                                  ^
/usr/local/opt/rttr/include/rttr/detail/variant_sequential_view/variant_sequential_view_creator.h:46:65: note: in instantiation of template type alias 'is_sequential_container' requested here
using can_create_sequential_view = std::integral_constant<bool, is_sequential_container<raw_type_t<wrapper_address_return_type_t<T>>>::value>;
                                                                ^
/usr/local/opt/rttr/include/rttr/detail/variant/variant_data_policy.h:306:24: note: in instantiation of template type alias 'can_create_sequential_view' requested here
                return can_create_sequential_view<T>::value;
                       ^
/usr/local/opt/rttr/include/rttr/detail/variant/variant_impl.h:55:43: note: in instantiation of member function 'rttr::detail::variant_data_base_policy<bool, rttr::detail::variant_data_policy_arithmetic<bool>, rttr::detail::default_type_converter<bool, rttr::detail::convert_from<bool> > >::invoke' requested here
:   m_policy(&detail::variant_policy<Tp>::invoke)
                                          ^
/usr/local/opt/rttr/include/rttr/detail/variant/variant_data_converter.h:283:31: note: in instantiation of function template specialization 'rttr::variant::variant<const bool &, bool>' requested here
        return to_enumeration(from, to);
                              ^
In file included from /Users/gabrielnuetzi/Desktop/ExecutionGraph/gui/executionGraphGui/cefapp/mac/AppMac.mm:18:
In file included from /Users/gabrielnuetzi/Desktop/ExecutionGraph/gui/executionGraphGui/cefapp/AppHandler.hpp:21:
In file included from /Users/gabrielnuetzi/Desktop/ExecutionGraph/gui/executionGraphGui/backend/Backend.hpp:17:
In file included from /usr/local/opt/rttr/include/rttr/type:31:
In file included from /usr/local/opt/rttr/include/rttr/type.h:1189:
In file included from /usr/local/opt/rttr/include/rttr/detail/type/type_impl.h:36:
In file included from /usr/local/opt/rttr/include/rttr/detail/type/get_create_variant_func.h:32:
In file included from /usr/local/opt/rttr/include/rttr/variant.h:1079:
In file included from /usr/local/opt/rttr/include/rttr/detail/variant/variant_impl.h:36:
/usr/local/opt/rttr/include/rttr/detail/variant/variant_data_policy.h:310:73: error: no matching function for call to 'create_variant_array_view'
                arg.get_value<std::unique_ptr<array_wrapper_base>&>() = create_variant_array_view(const_cast<T&>(Tp::get_value(src_data)));
                                                                        ^~~~~~~~~~~~~~~~~~~~~~~~~
/usr/local/opt/rttr/include/rttr/detail/variant/variant_impl.h:55:43: note: in instantiation of member function 'rttr::detail::variant_data_base_policy<bool, rttr::detail::variant_data_policy_arithmetic<bool>, rttr::detail::default_type_converter<bool, rttr::detail::convert_from<bool> > >::invoke' requested here
:   m_policy(&detail::variant_policy<Tp>::invoke)
                                          ^
/usr/local/opt/rttr/include/rttr/detail/variant/variant_data_converter.h:283:31: note: in instantiation of function template specialization 'rttr::variant::variant<const bool &, bool>' requested here
        return to_enumeration(from, to);
                              ^
/usr/local/opt/rttr/include/rttr/detail/variant_array_view/variant_array_view_creator_impl.h:42:1: note: candidate template ignored: substitution failure [with T = bool &, Tp = bool]: non-type template argument is not a constant expression
create_variant_array_view(T&& value)
^
/usr/local/opt/rttr/include/rttr/detail/variant_array_view/variant_array_view_creator_impl.h:51:1: note: candidate template ignored: substitution failure [with T = bool &, Tp = bool]: non-type template argument is not a constant expression
create_variant_array_view(T&& value)
^
In file included from /Users/gabrielnuetzi/Desktop/ExecutionGraph/gui/executionGraphGui/cefapp/mac/AppMac.mm:18:
In file included from /Users/gabrielnuetzi/Desktop/ExecutionGraph/gui/executionGraphGui/cefapp/AppHandler.hpp:21:
In file included from /Users/gabrielnuetzi/Desktop/ExecutionGraph/gui/executionGraphGui/backend/Backend.hpp:17:
In file included from /usr/local/opt/rttr/include/rttr/type:31:
In file included from /usr/local/opt/rttr/include/rttr/type.h:1189:
In file included from /usr/local/opt/rttr/include/rttr/detail/type/type_impl.h:36:
In file included from /usr/local/opt/rttr/include/rttr/detail/type/get_create_variant_func.h:32:
In file included from /usr/local/opt/rttr/include/rttr/variant.h:1079:
In file included from /usr/local/opt/rttr/include/rttr/detail/variant/variant_impl.h:36:
/usr/local/opt/rttr/include/rttr/detail/variant/variant_data_policy.h:315:70: error: no matching function for call to 'create_variant_associative_view'
                arg.get_value<variant_associative_view_private&>() = create_variant_associative_view(const_cast<T&>(Tp::get_value(src_data)));
                                                                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/local/opt/rttr/include/rttr/detail/variant_associative_view/variant_associative_view_creator_impl.h:42:1: note: candidate template ignored: substitution failure [with T = bool &, Tp = bool]: non-type template argument is not a constant expression
create_variant_associative_view(T&& value)
^
/usr/local/opt/rttr/include/rttr/detail/variant_associative_view/variant_associative_view_creator_impl.h:51:1: note: candidate template ignored: substitution failure [with T = bool &, Tp = bool]: non-type template argument is not a constant expression
create_variant_associative_view(T&& value)
^
In file included from /Users/gabrielnuetzi/Desktop/ExecutionGraph/gui/executionGraphGui/cefapp/mac/AppMac.mm:18:
In file included from /Users/gabrielnuetzi/Desktop/ExecutionGraph/gui/executionGraphGui/cefapp/AppHandler.hpp:21:
In file included from /Users/gabrielnuetzi/Desktop/ExecutionGraph/gui/executionGraphGui/backend/Backend.hpp:17:
In file included from /usr/local/opt/rttr/include/rttr/type:31:
In file included from /usr/local/opt/rttr/include/rttr/type.h:1189:
In file included from /usr/local/opt/rttr/include/rttr/detail/type/type_impl.h:36:
In file included from /usr/local/opt/rttr/include/rttr/detail/type/get_create_variant_func.h:32:
In file included from /usr/local/opt/rttr/include/rttr/variant.h:1079:
In file included from /usr/local/opt/rttr/include/rttr/detail/variant/variant_impl.h:36:
/usr/local/opt/rttr/include/rttr/detail/variant/variant_data_policy.h:320:69: error: no matching function for call to 'create_variant_sequential_view'
                arg.get_value<variant_sequential_view_private&>() = create_variant_sequential_view(const_cast<T&>(Tp::get_value(src_data)));
                                                                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/local/opt/rttr/include/rttr/detail/variant_sequential_view/variant_sequential_view_creator_impl.h:42:1: note: candidate template ignored: substitution failure [with T = bool &, Tp = bool]: non-type template argument is not a constant expression
create_variant_sequential_view(T&& value)
^
/usr/local/opt/rttr/include/rttr/detail/variant_sequential_view/variant_sequential_view_creator_impl.h:51:1: note: candidate template ignored: substitution failure [with T = bool &, Tp = bool]: non-type template argument is not a constant expression
create_variant_sequential_view(T&& value)
^
In file included from /Users/gabrielnuetzi/Desktop/ExecutionGraph/gui/executionGraphGui/cefapp/mac/AppMac.mm:18:
In file included from /Users/gabrielnuetzi/Desktop/ExecutionGraph/gui/executionGraphGui/cefapp/AppHandler.hpp:21:
In file included from /Users/gabrielnuetzi/Desktop/ExecutionGraph/gui/executionGraphGui/backend/Backend.hpp:17:
In file included from /usr/local/opt/rttr/include/rttr/type:31:
In file included from /usr/local/opt/rttr/include/rttr/type.h:32:
In file included from /usr/local/opt/rttr/include/rttr/string_view.h:498:
In file included from /usr/local/opt/rttr/include/rttr/detail/impl/string_view_impl.h:32:
In file included from /usr/local/opt/rttr/include/rttr/detail/misc/utility.h:34:
/usr/local/opt/rttr/include/rttr/detail/misc/misc_type_traits.h:472:51: error: non-type template argument is not a constant expression
    using is_array = std::integral_constant<bool, is_array_impl<remove_cv_t< remove_reference_t<T> > >::value>;
                                                  ^
/usr/local/opt/rttr/include/rttr/detail/type/type_data.h:317:92: note: in instantiation of template type alias 'is_array' requested here
                                              TYPE_TRAIT_TO_BITSET_VALUE_2(::rttr::detail::is_array, is_array) |
                                                                                           ^
/usr/local/opt/rttr/include/rttr/detail/type/type_impl.h:302:74: note: in instantiation of function template specialization 'rttr::detail::make_type_data<bool>' requested here
        static const type val = get_registration_manager<int>().add_item(make_type_data<T>());
                                                                         ^
/usr/local/opt/rttr/include/rttr/detail/type/type_impl.h:390:105: note: in instantiation of member function 'rttr::detail::type_getter<bool, void>::get_type' requested here
    return detail::type_getter<typename std::remove_cv<typename std::remove_reference<T>::type>::type>::get_type();
                                                                                                        ^
/usr/local/opt/rttr/include/rttr/detail/variant/variant_data_policy.h:268:47: note: in instantiation of function template specialization 'rttr::type::get<bool>' requested here
                arg.get_value<type>() = type::get<T>();
                                              ^
/usr/local/opt/rttr/include/rttr/detail/variant/variant_impl.h:55:43: note: in instantiation of member function 'rttr::detail::variant_data_base_policy<bool, rttr::detail::variant_data_policy_arithmetic<bool>, rttr::detail::default_type_converter<bool, rttr::detail::convert_from<bool> > >::invoke' requested here
:   m_policy(&detail::variant_policy<Tp>::invoke)
                                          ^
/usr/local/opt/rttr/include/rttr/detail/variant/variant_data_converter.h:283:31: note: in instantiation of function template specialization 'rttr::variant::variant<const bool &, bool>' requested here
        return to_enumeration(from, to);
                              ^
In file included from /Users/gabrielnuetzi/Desktop/ExecutionGraph/gui/executionGraphGui/cefapp/mac/AppMac.mm:18:
In file included from /Users/gabrielnuetzi/Desktop/ExecutionGraph/gui/executionGraphGui/cefapp/AppHandler.hpp:21:
In file included from /Users/gabrielnuetzi/Desktop/ExecutionGraph/gui/executionGraphGui/backend/Backend.hpp:17:
In file included from /usr/local/opt/rttr/include/rttr/type:31:
In file included from /usr/local/opt/rttr/include/rttr/type.h:32:
In file included from /usr/local/opt/rttr/include/rttr/string_view.h:498:
In file included from /usr/local/opt/rttr/include/rttr/detail/impl/string_view_impl.h:32:
In file included from /usr/local/opt/rttr/include/rttr/detail/misc/utility.h:34:
/usr/local/opt/rttr/include/rttr/detail/misc/misc_type_traits.h:472:51: error: non-type template argument is not a constant expression
    using is_array = std::integral_constant<bool, is_array_impl<remove_cv_t< remove_reference_t<T> > >::value>;
                                                  ^
/usr/local/opt/rttr/include/rttr/detail/type/type_data.h:317:92: note: in instantiation of template type alias 'is_array' requested here
                                              TYPE_TRAIT_TO_BITSET_VALUE_2(::rttr::detail::is_array, is_array) |
                                                                                           ^
/usr/local/opt/rttr/include/rttr/detail/type/type_impl.h:302:74: note: in instantiation of function template specialization 'rttr::detail::make_type_data<bool *>' requested here
        static const type val = get_registration_manager<int>().add_item(make_type_data<T>());
                                                                         ^
/usr/local/opt/rttr/include/rttr/detail/type/type_impl.h:390:105: note: in instantiation of member function 'rttr::detail::type_getter<bool *, void>::get_type' requested here
    return detail::type_getter<typename std::remove_cv<typename std::remove_reference<T>::type>::type>::get_type();
                                                                                                        ^
/usr/local/opt/rttr/include/rttr/detail/variant/variant_data_policy.h:290:61: note: in instantiation of function template specialization 'rttr::type::get<bool *>' requested here
                data.m_type                         = type::get< raw_addressof_return_type_t<T> >();
                                                            ^
/usr/local/opt/rttr/include/rttr/detail/variant/variant_impl.h:55:43: note: in instantiation of member function 'rttr::detail::variant_data_base_policy<bool, rttr::detail::variant_data_policy_arithmetic<bool>, rttr::detail::default_type_converter<bool, rttr::detail::convert_from<bool> > >::invoke' requested here
:   m_policy(&detail::variant_policy<Tp>::invoke)
                                          ^
/usr/local/opt/rttr/include/rttr/detail/variant/variant_data_converter.h:283:31: note: in instantiation of function template specialization 'rttr::variant::variant<const bool &, bool>' requested here
        return to_enumeration(from, to);
                              ^
In file included from /Users/gabrielnuetzi/Desktop/ExecutionGraph/gui/executionGraphGui/cefapp/mac/AppMac.mm:18:
In file included from /Users/gabrielnuetzi/Desktop/ExecutionGraph/gui/executionGraphGui/cefapp/AppHandler.hpp:21:
In file included from /Users/gabrielnuetzi/Desktop/ExecutionGraph/gui/executionGraphGui/backend/Backend.hpp:17:
In file included from /usr/local/opt/rttr/include/rttr/type:31:
In file included from /usr/local/opt/rttr/include/rttr/type.h:32:
In file included from /usr/local/opt/rttr/include/rttr/string_view.h:498:
In file included from /usr/local/opt/rttr/include/rttr/detail/impl/string_view_impl.h:32:
In file included from /usr/local/opt/rttr/include/rttr/detail/misc/utility.h:34:
/usr/local/opt/rttr/include/rttr/detail/misc/misc_type_traits.h:472:51: error: non-type template argument is not a constant expression
    using is_array = std::integral_constant<bool, is_array_impl<remove_cv_t< remove_reference_t<T> > >::value>;
                                                  ^
/usr/local/opt/rttr/include/rttr/detail/variant_array_view/variant_array_view_traits.h:48:81: note: in instantiation of template type alias 'is_array' requested here
using can_create_array_container = std::integral_constant<bool, ::rttr::detail::is_array<T>::value || is_wrapper_array_type<T>::value || is_pointer_array_type<T>::value>;
                                                                                ^
/usr/local/opt/rttr/include/rttr/detail/variant/variant_data_policy.h:298:24: note: in instantiation of template type alias 'can_create_array_container' requested here
                return can_create_array_container<T>::value;
                       ^
/usr/local/opt/rttr/include/rttr/detail/variant/variant_impl.h:55:43: note: in instantiation of member function 'rttr::detail::variant_data_base_policy<bool *, rttr::detail::variant_data_policy_small<bool *, rttr::detail::empty_type_converter<bool *> >, rttr::detail::empty_type_converter<bool *> >::invoke' requested here
:   m_policy(&detail::variant_policy<Tp>::invoke)
                                          ^
/usr/local/opt/rttr/include/rttr/detail/type/get_create_variant_func.h:58:16: note: in instantiation of function template specialization 'rttr::variant::variant<bool *&, bool *>' requested here
        return data.get_value<T>();
               ^
/usr/local/opt/rttr/include/rttr/detail/type/type_data.h:307:54: note: in instantiation of member function 'rttr::detail::create_variant_policy<bool *>::create_variant' requested here
                            &create_variant_func<T>::create_variant,
                                                     ^
/usr/local/opt/rttr/include/rttr/detail/type/type_impl.h:302:74: note: in instantiation of function template specialization 'rttr::detail::make_type_data<bool *>' requested here
        static const type val = get_registration_manager<int>().add_item(make_type_data<T>());
                                                                         ^
/usr/local/opt/rttr/include/rttr/detail/type/type_impl.h:390:105: note: in instantiation of member function 'rttr::detail::type_getter<bool *, void>::get_type' requested here
    return detail::type_getter<typename std::remove_cv<typename std::remove_reference<T>::type>::type>::get_type();
                                                                                                        ^
/usr/local/opt/rttr/include/rttr/detail/variant/variant_data_policy.h:290:61: note: in instantiation of function template specialization 'rttr::type::get<bool *>' requested here
                data.m_type                         = type::get< raw_addressof_return_type_t<T> >();
                                                            ^
/usr/local/opt/rttr/include/rttr/detail/variant/variant_impl.h:55:43: note: in instantiation of member function 'rttr::detail::variant_data_base_policy<bool, rttr::detail::variant_data_policy_arithmetic<bool>, rttr::detail::default_type_converter<bool, rttr::detail::convert_from<bool> > >::invoke' requested here
:   m_policy(&detail::variant_policy<Tp>::invoke)
                                          ^
/usr/local/opt/rttr/include/rttr/detail/variant/variant_data_converter.h:283:31: note: in instantiation of function template specialization 'rttr::variant::variant<const bool &, bool>' requested here
        return to_enumeration(from, to);
                              ^
fatal error: too many errors emitted, stopping now [-ferror-limit=]

can you make up anything from this? Why does he need rttr::variant::variant<const bool &, bool>

I am nowhere using an rttr::variant

@acki-m
Copy link
Contributor

acki-m commented Jan 31, 2018

from every type you register (direct or indirect (e.g. as function return value, argument, etc..) a variant creation function will be created (but only for pointer types)
With that functionality it is possible to perform an rttr_cast in an variant.

Regarding your problem: can you please make a simple test case for me? This would help me a lot.

@gabyx
Copy link
Contributor Author

gabyx commented Jan 31, 2018

Jeah for sure!, I studied the problem, its kind of strange... (it seems correct..., maybe compiler bug...)
Can you specify the test problem

@gabyx
Copy link
Contributor Author

gabyx commented Jan 31, 2018

how do you register indirectly?
something along the line:

rttr::type foo( return rttr::type::get<T>(); )

?

@acki-m
Copy link
Contributor

acki-m commented Jan 31, 2018

struct point { int x; int y;}
struct foo { point get_point();}
rttr:.registration::class_<foo>("foo").method("bar", &foo::bar);

this will register also the type point (when the code works correct ^^)

Regarding the test case, remove to much code, so that it compiles again. Then copy the code that seem to instantiate the problematic code in a separate TU and compile it. When it fails again, upload it here.

@gabyx
Copy link
Contributor Author

gabyx commented Feb 1, 2018

Ok, made it compile removed everything (no rttr includes):
Look at the Standalone compilation below first, I think this described the problem best.

Standalone compilation: (Test.cpp)

#include <rttr/type>
#include <rttr/registration>
struct point { int x; int y;};
struct foo { point get_point();};
rttr::registration::class_<foo>("foo").method("bar", &foo::get_point);

Output:

[ 93%] Building CXX object gui/executionGraphGui/CMakeFiles/ExecutionGraph-GUI.dir/backend/Test.cpp.o
cd /Users/gabrielnuetzi/Desktop/ExecutionGraph/build/gui/executionGraphGui && ccache /usr/local/opt/llvm/bin/clang++  -DRTTR_DLL -I/Users/gabrielnuetzi/Desktop/ExecutionGraph/gui/executionGraphGui -isystem /Users/gabrielnuetzi/Desktop/ExecutionGraph/build/../buildExternal/cefbinaries/cefbinaries-src/include -isystem /Users/gabrielnuetzi/Desktop/ExecutionGraph/build/../buildExternal/cefbinaries/cefbinaries-src -isystem /usr/local/opt/rttr/include -I/Users/gabrielnuetzi/Desktop/ExecutionGraph/include -I/Users/gabrielnuetzi/Desktop/ExecutionGraph/build/include -isystem /usr/local/include/eigen3 -isystem /Users/gabrielnuetzi/Desktop/ExecutionGraph/buildExternal/meta/meta-src/include -isystem /Users/gabrielnuetzi/Desktop/ExecutionGraph/buildExternal/args/args-src -isystem /Users/gabrielnuetzi/Desktop/ExecutionGraph/buildExternal/crossguid/crossguid-src  -I/usr/local/opt/llvm/include -I/usr/local/opt/llvm/include/c++/v1/ -g -arch x86_64 -mmacosx-version-min=10.9   -fno-omit-frame-pointer -Wall -Wpedantic -Wno-documentation -fsanitize=leak -fsanitize=address -std=c++1z -o CMakeFiles/ExecutionGraph-GUI.dir/backend/Test.cpp.o -c /Users/gabrielnuetzi/Desktop/ExecutionGraph/gui/executionGraphGui/backend/Test.cpp
/Users/gabrielnuetzi/Desktop/ExecutionGraph/gui/executionGraphGui/backend/Test.cpp:5:33: error: expected unqualified-id
rttr::registration::class_<foo>("foo").method("bar", &foo::get_point);
                                ^
/Users/gabrielnuetzi/Desktop/ExecutionGraph/gui/executionGraphGui/backend/Test.cpp:5:33: error: expected ')'
/Users/gabrielnuetzi/Desktop/ExecutionGraph/gui/executionGraphGui/backend/Test.cpp:5:32: note: to match this '('
rttr::registration::class_<foo>("foo").method("bar", &foo::get_point);
                               ^
2 errors generated.
make[3]: *** [gui/executionGraphGui/CMakeFiles/ExecutionGraph-GUI.dir/backend/Test.cpp.o] Error 1

InApp Test:
added in a AppMac.mm the following:

#include <rttr/type>
#include <rttr/registration>
struct point { int x; int y;};
struct foo { point get_point();};
rttr::registration::class_<foo>("foo").method("bar", &foo::get_point);

Outputs:

[ 93%] Building CXX object gui/executionGraphGui/CMakeFiles/ExecutionGraph-GUI.dir/cefapp/mac/AppMac.mm.o
cd /Users/gabrielnuetzi/Desktop/ExecutionGraph/build/gui/executionGraphGui && ccache /usr/local/opt/llvm/bin/clang++  -DRTTR_DLL -I/Users/gabrielnuetzi/Desktop/ExecutionGraph/gui/executionGraphGui -isystem /Users/gabrielnuetzi/Desktop/ExecutionGraph/build/../buildExternal/cefbinaries/cefbinaries-src/include -isystem /Users/gabrielnuetzi/Desktop/ExecutionGraph/build/../buildExternal/cefbinaries/cefbinaries-src -isystem /usr/local/opt/rttr/include -I/Users/gabrielnuetzi/Desktop/ExecutionGraph/include -I/Users/gabrielnuetzi/Desktop/ExecutionGraph/build/include -isystem /usr/local/include/eigen3 -isystem /Users/gabrielnuetzi/Desktop/ExecutionGraph/buildExternal/meta/meta-src/include -isystem /Users/gabrielnuetzi/Desktop/ExecutionGraph/buildExternal/args/args-src -isystem /Users/gabrielnuetzi/Desktop/ExecutionGraph/buildExternal/crossguid/crossguid-src  -I/usr/local/opt/llvm/include -I/usr/local/opt/llvm/include/c++/v1/ -g -arch x86_64 -mmacosx-version-min=10.9   -fno-omit-frame-pointer -Wall -Wpedantic -Wno-documentation -fsanitize=leak -fsanitize=address -std=c++1z -o CMakeFiles/ExecutionGraph-GUI.dir/cefapp/mac/AppMac.mm.o -c /Users/gabrielnuetzi/Desktop/ExecutionGraph/gui/executionGraphGui/cefapp/mac/AppMac.mm
In file included from /Users/gabrielnuetzi/Desktop/ExecutionGraph/gui/executionGraphGui/cefapp/mac/AppMac.mm:20:
In file included from /usr/local/opt/rttr/include/rttr/type:31:
In file included from /usr/local/opt/rttr/include/rttr/type.h:32:
In file included from /usr/local/opt/rttr/include/rttr/string_view.h:498:
In file included from /usr/local/opt/rttr/include/rttr/detail/impl/string_view_impl.h:32:
In file included from /usr/local/opt/rttr/include/rttr/detail/misc/utility.h:34:
/usr/local/opt/rttr/include/rttr/detail/misc/misc_type_traits.h:464:79: error: expected member name or ';' after declaration specifiers
        template <typename U> static NoType& check(typename U::no_array_type*);
                              ~~~~~~~~~~~~~                                   ^
/usr/local/opt/rttr/include/rttr/detail/misc/misc_type_traits.h:465:57: error: expected member name or ';' after declaration specifiers
        template <typename U> static YesType& check(...);
                              ~~~~~~~~~~~~~~            ^
/usr/local/opt/rttr/include/rttr/detail/misc/misc_type_traits.h:468:85: error: 'check' following the 'template' keyword does not refer to a template
        static RTTR_CONSTEXPR_OR_CONST bool value = (sizeof(is_array_impl::template check<array_mapper<T>>(0)) == sizeof(YesType));
                                                                           ~~~~~~~~ ^~~~~
/usr/local/opt/rttr/include/rttr/detail/misc/misc_type_traits.h:468:103: error: expected '>'
        static RTTR_CONSTEXPR_OR_CONST bool value = (sizeof(is_array_impl::template check<array_mapper<T>>(0)) == sizeof(YesType));
                                                                                                      ^
/usr/local/opt/rttr/include/rttr/detail/misc/misc_type_traits.h:468:103: error: expected ')'
/usr/local/opt/rttr/include/rttr/detail/misc/misc_type_traits.h:468:60: note: to match this '('
        static RTTR_CONSTEXPR_OR_CONST bool value = (sizeof(is_array_impl::template check<array_mapper<T>>(0)) == sizeof(YesType));
                                                           ^
/usr/local/opt/rttr/include/rttr/detail/misc/misc_type_traits.h:482:75: error: expected member name or ';' after declaration specifiers
        template <typename U> static YesType& check(typename U::is_valid*);
                              ~~~~~~~~~~~~~~                              ^
/usr/local/opt/rttr/include/rttr/detail/misc/misc_type_traits.h:483:56: error: expected member name or ';' after declaration specifiers
        template <typename U> static NoType& check(...);
                              ~~~~~~~~~~~~~            ^
/usr/local/opt/rttr/include/rttr/detail/misc/misc_type_traits.h:486:61: error: use of undeclared identifier 'check'
        static RTTR_CONSTEXPR_OR_CONST bool value = (sizeof(check<T>(nullptr)) == sizeof(YesType));
                                                            ^
/usr/local/opt/rttr/include/rttr/detail/misc/misc_type_traits.h:486:67: error: 'T' does not refer to a value
        static RTTR_CONSTEXPR_OR_CONST bool value = (sizeof(check<T>(nullptr)) == sizeof(YesType));
                                                                  ^
/usr/local/opt/rttr/include/rttr/detail/misc/misc_type_traits.h:476:24: note: declared here
    template <typename T>
                       ^
/usr/local/opt/rttr/include/rttr/detail/misc/misc_type_traits.h:503:31: error: use of undeclared identifier 'check'
        using type = decltype(check<T>(nullptr));
                              ^
/usr/local/opt/rttr/include/rttr/detail/misc/misc_type_traits.h:503:37: error: 'T' does not refer to a value
        using type = decltype(check<T>(nullptr));
                                    ^
/usr/local/opt/rttr/include/rttr/detail/misc/misc_type_traits.h:497:24: note: declared here
    template <typename T>
                       ^
/Users/gabrielnuetzi/Desktop/ExecutionGraph/gui/executionGraphGui/cefapp/mac/AppMac.mm:24:33: error: expected unqualified-id
rttr::registration::class_<foo>("foo").method("bar", &foo::get_point);
                                ^
/Users/gabrielnuetzi/Desktop/ExecutionGraph/gui/executionGraphGui/cefapp/mac/AppMac.mm:24:33: error: expected ')'
/Users/gabrielnuetzi/Desktop/ExecutionGraph/gui/executionGraphGui/cefapp/mac/AppMac.mm:24:32: note: to match this '('
rttr::registration::class_<foo>("foo").method("bar", &foo::get_point);
                               ^
In file included from /Users/gabrielnuetzi/Desktop/ExecutionGraph/gui/executionGraphGui/cefapp/mac/AppMac.mm:20:
In file included from /usr/local/opt/rttr/include/rttr/type:31:
In file included from /usr/local/opt/rttr/include/rttr/type.h:32:
In file included from /usr/local/opt/rttr/include/rttr/string_view.h:498:
In file included from /usr/local/opt/rttr/include/rttr/detail/impl/string_view_impl.h:32:
In file included from /usr/local/opt/rttr/include/rttr/detail/misc/utility.h:34:
/usr/local/opt/rttr/include/rttr/detail/misc/misc_type_traits.h:490:68: error: non-type template argument is not a constant expression
    using is_associative_container = std::integral_constant<bool, !has_is_valid_alias<associative_container_mapper<Tp> >::value>;
                                                                   ^
/usr/local/opt/rttr/include/rttr/detail/variant_associative_view/variant_associative_view_creator.h:46:66: note: in instantiation of template type alias 'is_associative_container' requested here
using can_create_associative_view = std::integral_constant<bool, is_associative_container<raw_type_t<wrapper_address_return_type_t<T>>>::value>;
                                                                 ^
/usr/local/opt/rttr/include/rttr/detail/variant/variant_data_policy.h:302:24: note: in instantiation of template type alias 'can_create_associative_view' requested here
                return can_create_associative_view<T>::value;
                       ^
/usr/local/opt/rttr/include/rttr/detail/variant/variant_impl.h:55:43: note: in instantiation of member function 'rttr::detail::variant_data_base_policy<bool, rttr::detail::variant_data_policy_arithmetic<bool>, rttr::detail::default_type_converter<bool, rttr::detail::convert_from<bool> > >::invoke' requested here
:   m_policy(&detail::variant_policy<Tp>::invoke)
                                          ^
/usr/local/opt/rttr/include/rttr/detail/variant/variant_data_converter.h:283:31: note: in instantiation of function template specialization 'rttr::variant::variant<const bool &, bool>' requested here
        return to_enumeration(from, to);
                              ^
In file included from /Users/gabrielnuetzi/Desktop/ExecutionGraph/gui/executionGraphGui/cefapp/mac/AppMac.mm:20:
In file included from /usr/local/opt/rttr/include/rttr/type:31:
In file included from /usr/local/opt/rttr/include/rttr/type.h:32:
In file included from /usr/local/opt/rttr/include/rttr/string_view.h:498:
In file included from /usr/local/opt/rttr/include/rttr/detail/impl/string_view_impl.h:32:
In file included from /usr/local/opt/rttr/include/rttr/detail/misc/utility.h:34:
/usr/local/opt/rttr/include/rttr/detail/misc/misc_type_traits.h:493:67: error: non-type template argument is not a constant expression
    using is_sequential_container = std::integral_constant<bool, !has_is_valid_alias<sequential_container_mapper<Tp > >::value>;
                                                                  ^
/usr/local/opt/rttr/include/rttr/detail/variant_sequential_view/variant_sequential_view_creator.h:46:65: note: in instantiation of template type alias 'is_sequential_container' requested here
using can_create_sequential_view = std::integral_constant<bool, is_sequential_container<raw_type_t<wrapper_address_return_type_t<T>>>::value>;
                                                                ^
/usr/local/opt/rttr/include/rttr/detail/variant/variant_data_policy.h:306:24: note: in instantiation of template type alias 'can_create_sequential_view' requested here
                return can_create_sequential_view<T>::value;
                       ^
/usr/local/opt/rttr/include/rttr/detail/variant/variant_impl.h:55:43: note: in instantiation of member function 'rttr::detail::variant_data_base_policy<bool, rttr::detail::variant_data_policy_arithmetic<bool>, rttr::detail::default_type_converter<bool, rttr::detail::convert_from<bool> > >::invoke' requested here
:   m_policy(&detail::variant_policy<Tp>::invoke)
                                          ^
/usr/local/opt/rttr/include/rttr/detail/variant/variant_data_converter.h:283:31: note: in instantiation of function template specialization 'rttr::variant::variant<const bool &, bool>' requested here
        return to_enumeration(from, to);
                              ^
In file included from /Users/gabrielnuetzi/Desktop/ExecutionGraph/gui/executionGraphGui/cefapp/mac/AppMac.mm:20:
In file included from /usr/local/opt/rttr/include/rttr/type:31:
In file included from /usr/local/opt/rttr/include/rttr/type.h:1189:
In file included from /usr/local/opt/rttr/include/rttr/detail/type/type_impl.h:36:
In file included from /usr/local/opt/rttr/include/rttr/detail/type/get_create_variant_func.h:32:
In file included from /usr/local/opt/rttr/include/rttr/variant.h:1079:
In file included from /usr/local/opt/rttr/include/rttr/detail/variant/variant_impl.h:36:
/usr/local/opt/rttr/include/rttr/detail/variant/variant_data_policy.h:315:70: error: no matching function for call to 'create_variant_associative_view'
                arg.get_value<variant_associative_view_private&>() = create_variant_associative_view(const_cast<T&>(Tp::get_value(src_data)));
                                                                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/local/opt/rttr/include/rttr/detail/variant/variant_impl.h:55:43: note: in instantiation of member function 'rttr::detail::variant_data_base_policy<bool, rttr::detail::variant_data_policy_arithmetic<bool>, rttr::detail::default_type_converter<bool, rttr::detail::convert_from<bool> > >::invoke' requested here
:   m_policy(&detail::variant_policy<Tp>::invoke)
                                          ^
/usr/local/opt/rttr/include/rttr/detail/variant/variant_data_converter.h:283:31: note: in instantiation of function template specialization 'rttr::variant::variant<const bool &, bool>' requested here
        return to_enumeration(from, to);
                              ^
/usr/local/opt/rttr/include/rttr/detail/variant_associative_view/variant_associative_view_creator_impl.h:42:1: note: candidate template ignored: substitution failure [with T = bool &, Tp = bool]: non-type template argument is not a constant expression
create_variant_associative_view(T&& value)
^
/usr/local/opt/rttr/include/rttr/detail/variant_associative_view/variant_associative_view_creator_impl.h:51:1: note: candidate template ignored: substitution failure [with T = bool &, Tp = bool]: non-type template argument is not a constant expression
create_variant_associative_view(T&& value)
^
In file included from /Users/gabrielnuetzi/Desktop/ExecutionGraph/gui/executionGraphGui/cefapp/mac/AppMac.mm:20:
In file included from /usr/local/opt/rttr/include/rttr/type:31:
In file included from /usr/local/opt/rttr/include/rttr/type.h:1189:
In file included from /usr/local/opt/rttr/include/rttr/detail/type/type_impl.h:36:
In file included from /usr/local/opt/rttr/include/rttr/detail/type/get_create_variant_func.h:32:
In file included from /usr/local/opt/rttr/include/rttr/variant.h:1079:
In file included from /usr/local/opt/rttr/include/rttr/detail/variant/variant_impl.h:36:
/usr/local/opt/rttr/include/rttr/detail/variant/variant_data_policy.h:320:69: error: no matching function for call to 'create_variant_sequential_view'
                arg.get_value<variant_sequential_view_private&>() = create_variant_sequential_view(const_cast<T&>(Tp::get_value(src_data)));
                                                                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/local/opt/rttr/include/rttr/detail/variant_sequential_view/variant_sequential_view_creator_impl.h:42:1: note: candidate template ignored: substitution failure [with T = bool &, Tp = bool]: non-type template argument is not a constant expression
create_variant_sequential_view(T&& value)
^
/usr/local/opt/rttr/include/rttr/detail/variant_sequential_view/variant_sequential_view_creator_impl.h:51:1: note: candidate template ignored: substitution failure [with T = bool &, Tp = bool]: non-type template argument is not a constant expression
create_variant_sequential_view(T&& value)
^
In file included from /Users/gabrielnuetzi/Desktop/ExecutionGraph/gui/executionGraphGui/cefapp/mac/AppMac.mm:20:
In file included from /usr/local/opt/rttr/include/rttr/type:31:
In file included from /usr/local/opt/rttr/include/rttr/type.h:32:
In file included from /usr/local/opt/rttr/include/rttr/string_view.h:498:
In file included from /usr/local/opt/rttr/include/rttr/detail/impl/string_view_impl.h:32:
In file included from /usr/local/opt/rttr/include/rttr/detail/misc/utility.h:34:
/usr/local/opt/rttr/include/rttr/detail/misc/misc_type_traits.h:490:68: error: non-type template argument is not a constant expression
    using is_associative_container = std::integral_constant<bool, !has_is_valid_alias<associative_container_mapper<Tp> >::value>;
                                                                   ^
/usr/local/opt/rttr/include/rttr/detail/type/type_data.h:323:92: note: in instantiation of template type alias 'is_associative_container' requested here
                                              TYPE_TRAIT_TO_BITSET_VALUE_2(::rttr::detail::is_associative_container, is_associative_container) |
                                                                                           ^
/usr/local/opt/rttr/include/rttr/detail/type/type_impl.h:302:74: note: in instantiation of function template specialization 'rttr::detail::make_type_data<bool>' requested here
        static const type val = get_registration_manager<int>().add_item(make_type_data<T>());
                                                                         ^
/usr/local/opt/rttr/include/rttr/detail/type/type_impl.h:390:105: note: in instantiation of member function 'rttr::detail::type_getter<bool, void>::get_type' requested here
    return detail::type_getter<typename std::remove_cv<typename std::remove_reference<T>::type>::type>::get_type();
                                                                                                        ^
/usr/local/opt/rttr/include/rttr/detail/variant/variant_data_policy.h:268:47: note: in instantiation of function template specialization 'rttr::type::get<bool>' requested here
                arg.get_value<type>() = type::get<T>();
                                              ^
/usr/local/opt/rttr/include/rttr/detail/variant/variant_impl.h:55:43: note: in instantiation of member function 'rttr::detail::variant_data_base_policy<bool, rttr::detail::variant_data_policy_arithmetic<bool>, rttr::detail::default_type_converter<bool, rttr::detail::convert_from<bool> > >::invoke' requested here
:   m_policy(&detail::variant_policy<Tp>::invoke)
                                          ^
/usr/local/opt/rttr/include/rttr/detail/variant/variant_data_converter.h:283:31: note: in instantiation of function template specialization 'rttr::variant::variant<const bool &, bool>' requested here
        return to_enumeration(from, to);
                              ^
In file included from /Users/gabrielnuetzi/Desktop/ExecutionGraph/gui/executionGraphGui/cefapp/mac/AppMac.mm:20:
In file included from /usr/local/opt/rttr/include/rttr/type:31:
In file included from /usr/local/opt/rttr/include/rttr/type.h:32:
In file included from /usr/local/opt/rttr/include/rttr/string_view.h:498:
In file included from /usr/local/opt/rttr/include/rttr/detail/impl/string_view_impl.h:32:
In file included from /usr/local/opt/rttr/include/rttr/detail/misc/utility.h:34:
/usr/local/opt/rttr/include/rttr/detail/misc/misc_type_traits.h:490:68: error: non-type template argument is not a constant expression
    using is_associative_container = std::integral_constant<bool, !has_is_valid_alias<associative_container_mapper<Tp> >::value>;
                                                                   ^
/usr/local/opt/rttr/include/rttr/detail/type/type_data.h:323:92: note: in instantiation of template type alias 'is_associative_container' requested here
                                              TYPE_TRAIT_TO_BITSET_VALUE_2(::rttr::detail::is_associative_container, is_associative_container) |
                                                                                           ^
/usr/local/opt/rttr/include/rttr/detail/type/type_impl.h:302:74: note: in instantiation of function template specialization 'rttr::detail::make_type_data<bool *>' requested here
        static const type val = get_registration_manager<int>().add_item(make_type_data<T>());
                                                                         ^
/usr/local/opt/rttr/include/rttr/detail/type/type_impl.h:390:105: note: in instantiation of member function 'rttr::detail::type_getter<bool *, void>::get_type' requested here
    return detail::type_getter<typename std::remove_cv<typename std::remove_reference<T>::type>::type>::get_type();
                                                                                                        ^
/usr/local/opt/rttr/include/rttr/detail/variant/variant_data_policy.h:290:61: note: in instantiation of function template specialization 'rttr::type::get<bool *>' requested here
                data.m_type                         = type::get< raw_addressof_return_type_t<T> >();
                                                            ^
/usr/local/opt/rttr/include/rttr/detail/variant/variant_impl.h:55:43: note: in instantiation of member function 'rttr::detail::variant_data_base_policy<bool, rttr::detail::variant_data_policy_arithmetic<bool>, rttr::detail::default_type_converter<bool, rttr::detail::convert_from<bool> > >::invoke' requested here
:   m_policy(&detail::variant_policy<Tp>::invoke)
                                          ^
/usr/local/opt/rttr/include/rttr/detail/variant/variant_data_converter.h:283:31: note: in instantiation of function template specialization 'rttr::variant::variant<const bool &, bool>' requested here
        return to_enumeration(from, to);
                              ^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
make[3]: *** [gui/executionGraphGui/CMakeFiles/ExecutionGraph-GUI.dir/cefapp/mac/AppMac.mm.o] Error 1

@gabyx
Copy link
Contributor Author

gabyx commented Feb 1, 2018

Thx for the help!

@gabyx
Copy link
Contributor Author

gabyx commented Feb 1, 2018

Could it be that class_ results in some stupid macro expansion?, I will try to output the preprocessor... something is fishy here! -> nope its not the problem used #undef class_

@gabyx
Copy link
Contributor Author

gabyx commented Feb 1, 2018

I really dont get the error:
A MWE: (here with gcc, same with clang)
Test.cpp:

#include <rttr/registration>
#include <string>
struct point { int x; int y;};
struct foo { point get_point();};
#undef class_
rttr::registration::class_<foo>("foo").method("bar", &foo::get_point);

Test.sh

#!/bin/bash
comp="gcc"
export PATH="/usr/local/opt/$comp/bin:$PATH"
export CC="/usr/local/opt/$comp/bin/gcc-7"
export CXX="/usr/local/opt/$comp/bin/g++-7"
export LDFLAGS="-L/usr/local/opt/$comp/lib/gcc/7 -Wl,-rpath,/usr/local/opt/$comp/lib/gcc/7"
export CPPFLAGS="-I/usr/local/opt/$comp/include -I/usr/local/opt/$comp/include/c++/7.2.0"
export CXXFLAGS="$CPPFLAGS"

${CXX}  -DRTTR_DLL -isystem /usr/local/opt/rttr/include $CPPFLAGS -g -std=c++17 -o Test.cpp.o -c Test.cpp

gives:

Test.cpp:6:33: error: expected unqualified-id before string constant
 rttr::registration::class_<foo>("foo").method("bar", &foo::get_point);
                                 ^~~~~
Test.cpp:6:33: error: expected ')' before string constant

Thas all?? Any clue???

@gabyx
Copy link
Contributor Author

gabyx commented Feb 1, 2018

@acki-m : Got it: with the the macro sourounding it works

RTTR_REGISTRATION
{
rttr::registration::class_<foo>("foo").method("bar", &foo::get_point);
}

Makes sense, we need this rttr_auto_register_reflection_function_ defined

@acki-m
Copy link
Contributor

acki-m commented Feb 1, 2018

ahhh, I just thought you just simplified the test case and has leave out the macro.
It hast nothing to do with the macro itself

You can also not compile this:

std::string("hello");  // error C2059: syntax error: 'string'

without putting it in a function or assigning a value

auto s = std::string("hello"); // Ok

The same like the registration call.
However, registration object is not copy-able, that's why this doesn't work either:

auto foo = rttr::registration::class_<foo>("foo").method("bar", &foo::get_point); // attempting to reference a deleted function

@gabyx
Copy link
Contributor Author

gabyx commented Feb 1, 2018

thanks (that was a bit stupid from my side, I though it also works, because you wrote it like so :-))
the initial compilation problem still existed, up to now. The problem is strange, but I refactored my code such that no .mm ObjectiveC codefile (mixing C++) includes <rttr/type>. I could not get away with it. Somehow clang/gcc does not like it. I am wondering if he ObjectiveC stuff dispatches to XCode??? Now, where I am left with only .h/cpp files which have <rttr/type> includes, it works. jeaii 👍
A single include in a .mm file resulted in the above long output of AppMac.mm

@acki-m
Copy link
Contributor

acki-m commented Feb 4, 2018

Is this now solved for you?

@gabyx
Copy link
Contributor Author

gabyx commented Feb 6, 2018

jeah, I think its just when I try to compile .mm files meaning objectiv-c and c++ mixed, we have problems, why I have no clue!

@gabyx gabyx closed this as completed Feb 6, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants