From 137dd4864d07e6c3398f049377bdeb140063d631 Mon Sep 17 00:00:00 2001 From: Felipe Magno de Almeida Date: Thu, 3 Nov 2016 17:59:20 -0200 Subject: [PATCH] eina-cxx: eolian-cxx: Fix correct usage of is_eolian_object traits --- src/bindings/cxx/eina_cxx/eina_accessor.hh | 8 +- src/bindings/cxx/eina_cxx/eina_array.hh | 4 +- src/bindings/cxx/eina_cxx/eina_deleter.hh | 6 ++ .../cxx/eina_cxx/eina_eo_concrete_fwd.hh | 22 +--- src/bindings/cxx/eina_cxx/eina_iterator.hh | 6 +- src/bindings/cxx/eina_cxx/eina_list.hh | 4 +- src/bindings/cxx/eina_cxx/eina_ptrlist.hh | 9 +- src/bindings/cxx/eina_cxx/eina_type_traits.hh | 4 +- src/bindings/cxx/eina_cxx/eina_workarounds.hh | 100 +++++++++--------- src/bindings/cxx/eo_cxx/eo_cxx_interop.hh | 7 +- src/lib/eolian_cxx/grammar/klass_def.hpp | 4 + src/lib/eolian_cxx/grammar/type_impl.hpp | 72 ++++++++----- src/tests/eina_cxx/eina_cxx_test_accessor.cc | 7 ++ src/tests/eina_cxx/eina_cxx_test_ptrarray.cc | 7 ++ src/tests/eina_cxx/eina_cxx_test_ptrlist.cc | 7 ++ 15 files changed, 154 insertions(+), 113 deletions(-) diff --git a/src/bindings/cxx/eina_cxx/eina_accessor.hh b/src/bindings/cxx/eina_cxx/eina_accessor.hh index 58c0b98adc..4aefc5100b 100644 --- a/src/bindings/cxx/eina_cxx/eina_accessor.hh +++ b/src/bindings/cxx/eina_cxx/eina_accessor.hh @@ -165,7 +165,7 @@ template struct accessor; template -struct accessor::value, T>::type> +struct accessor::value, T>::type> : accessor_common_base { typedef accessor_common_base _base_type; @@ -277,7 +277,7 @@ struct accessor -struct accessor::value, T>::type> +struct accessor::value, T>::type> : accessor_common_base { typedef accessor_common_base _base_type; @@ -419,7 +419,7 @@ struct accessor_iterator; * Random access iterator for eina::accessor. */ template -struct accessor_iterator::value, T>::type> +struct accessor_iterator::value, T>::type> { typedef T value_type; /**< Type of the elements. */ typedef value_type* pointer; /**< Pointer to element type. */ @@ -571,7 +571,7 @@ struct accessor_iterator -struct accessor_iterator::value, T>::type> +struct accessor_iterator::value, T>::type> { typedef T value_type; /**< Type of the elements. */ typedef value_type* pointer; /**< Pointer to element type. */ diff --git a/src/bindings/cxx/eina_cxx/eina_array.hh b/src/bindings/cxx/eina_cxx/eina_array.hh index f9677a2d45..0c9bd59529 100644 --- a/src/bindings/cxx/eina_cxx/eina_array.hh +++ b/src/bindings/cxx/eina_cxx/eina_array.hh @@ -230,7 +230,7 @@ struct _eo_array_access_traits : _ptr_array_access_traits }; template -class array::value>::type> +class array::value>::type> : ptr_array::value , eo_clone_allocator, CloneAllocator>::type> @@ -497,7 +497,7 @@ public: }; template -class range_array::value>::type> +class range_array::value>::type> : range_ptr_array { typedef range_ptr_array _base_type; diff --git a/src/bindings/cxx/eina_cxx/eina_deleter.hh b/src/bindings/cxx/eina_cxx/eina_deleter.hh index 65f8da0b40..2520f5d078 100644 --- a/src/bindings/cxx/eina_cxx/eina_deleter.hh +++ b/src/bindings/cxx/eina_cxx/eina_deleter.hh @@ -3,6 +3,8 @@ #include +#include + namespace efl { namespace eina { struct malloc_deleter @@ -13,6 +15,10 @@ struct malloc_deleter object->~T(); free(object); } + void operator()(Eina_Binbuf* /*object*/) const + { + // how to free binbuf? + } }; template diff --git a/src/bindings/cxx/eina_cxx/eina_eo_concrete_fwd.hh b/src/bindings/cxx/eina_cxx/eina_eo_concrete_fwd.hh index 3e96e8fe30..13efd4259d 100644 --- a/src/bindings/cxx/eina_cxx/eina_eo_concrete_fwd.hh +++ b/src/bindings/cxx/eina_cxx/eina_eo_concrete_fwd.hh @@ -7,27 +7,11 @@ namespace efl { namespace eo { struct concrete; + +template +struct is_eolian_object; } } -namespace std { -template <> -struct is_base_of< ::efl::eo::concrete, ::Eo > : std::false_type {}; -template <> -struct is_base_of< ::efl::eo::concrete, const ::Eo > : std::false_type {}; -template <> -struct is_base_of< ::efl::eo::concrete, volatile ::Eo > : std::false_type {}; -template <> -struct is_base_of< ::efl::eo::concrete, const volatile ::Eo > : std::false_type {}; - -template <> -struct is_base_of< const ::efl::eo::concrete, ::Eo > : std::false_type {}; -template <> -struct is_base_of< const ::efl::eo::concrete, const ::Eo > : std::false_type {}; -template <> -struct is_base_of< const ::efl::eo::concrete, volatile ::Eo > : std::false_type {}; -template <> -struct is_base_of< const ::efl::eo::concrete, const volatile ::Eo > : std::false_type {}; -} #endif diff --git a/src/bindings/cxx/eina_cxx/eina_iterator.hh b/src/bindings/cxx/eina_cxx/eina_iterator.hh index 71f17ffddd..6fd90958f2 100644 --- a/src/bindings/cxx/eina_cxx/eina_iterator.hh +++ b/src/bindings/cxx/eina_cxx/eina_iterator.hh @@ -32,7 +32,7 @@ struct _common_iterator_base private: typedef _common_iterator_base self_type; /**< Type for the iterator instantiation itself. */ public: - typedef T const value_type; /**< Type for elements returned by the iterator. */ + typedef typename std::remove_reference::type const value_type; /**< Type for elements returned by the iterator. */ typedef value_type* pointer; /**< Type for a pointer to an element. */ typedef value_type& reference; /**< Type for a reference to an element. */ typedef std::ptrdiff_t difference_type; /**< Type to represent the distance between two iterators. */ @@ -148,7 +148,7 @@ protected: */ template struct iterator - : _common_iterator_base::value, T const>::type> + : _common_iterator_base::value, T const>::type> { private: typedef _common_iterator_base base_type; /**< Type for the base class. */ @@ -225,7 +225,7 @@ public: }; template -struct iterator::value, void>::type> +struct iterator::value, void>::type> : _common_iterator_base { private: diff --git a/src/bindings/cxx/eina_cxx/eina_list.hh b/src/bindings/cxx/eina_cxx/eina_list.hh index a47a7d7206..d5b62877cb 100644 --- a/src/bindings/cxx/eina_cxx/eina_list.hh +++ b/src/bindings/cxx/eina_cxx/eina_list.hh @@ -230,7 +230,7 @@ public: }; template -class list::value>::type> +class list::value>::type> : ptr_list::value , eo_clone_allocator, CloneAllocator>::type> @@ -515,7 +515,7 @@ public: }; template -class range_list::value>::type> +class range_list::value>::type> : range_ptr_list::value, Eo const, Eo>::type> { typedef range_ptr_list::value, Eo const, Eo>::type> _base_type; diff --git a/src/bindings/cxx/eina_cxx/eina_ptrlist.hh b/src/bindings/cxx/eina_cxx/eina_ptrlist.hh index f7254b1ef2..03b836ab6f 100644 --- a/src/bindings/cxx/eina_cxx/eina_ptrlist.hh +++ b/src/bindings/cxx/eina_cxx/eina_ptrlist.hh @@ -311,6 +311,7 @@ struct range_ptr_list : _range_template template struct _ptr_list_common_base { + typedef typename remove_cv::type>::type value_type; typedef CloneAllocator clone_allocator_type; /**< Type for the clone allocator. */ /** @@ -363,7 +364,7 @@ struct _ptr_list_common_base /** * @internal */ - void _delete_clone(T const* p) + void _delete_clone(value_type const* p) { _get_clone_allocator().deallocate_clone(p); } @@ -371,7 +372,7 @@ struct _ptr_list_common_base /** * @internal */ - T* _new_clone(typename container_value_type::type const& a) + value_type* _new_clone(typename container_value_type::type const& a) { return _get_clone_allocator().allocate_clone(a); } @@ -420,8 +421,8 @@ public: typedef value_type const& const_reference; /**< Type for a constant reference to an element. */ typedef _ptr_list_iterator const_iterator; /**< Type for a iterator for this container. */ typedef _ptr_list_iterator iterator; /**< Type for a constant iterator for this container. */ - typedef T* pointer; /**< Type for a pointer to an element. */ - typedef T const* const_pointer; /**< Type for a constant pointer for an element. */ + typedef value_type* pointer; /**< Type for a pointer to an element. */ + typedef value_type const* const_pointer; /**< Type for a constant pointer for an element. */ typedef std::size_t size_type; /**< Type for size information. */ typedef std::ptrdiff_t difference_type; /**< Type to represent the distance between two iterators. */ typedef CloneAllocator clone_allocator_type; /** Type for the clone allocator. */ diff --git a/src/bindings/cxx/eina_cxx/eina_type_traits.hh b/src/bindings/cxx/eina_cxx/eina_type_traits.hh index ff8bfbbff9..3ca979f1cc 100644 --- a/src/bindings/cxx/eina_cxx/eina_type_traits.hh +++ b/src/bindings/cxx/eina_cxx/eina_type_traits.hh @@ -69,7 +69,7 @@ struct container_value_type { typedef typename std::conditional< std::is_void::value - , T*, T>::type type; + , std::add_pointer, std::remove_reference>::type::type type; }; template @@ -77,7 +77,7 @@ struct nonconst_container_value_type { typedef typename std::conditional< std::is_void::value - , T*, typename std::remove_const::type>::type type; + , std::add_pointer, std::remove_cv::type>>::type::type type; }; /** diff --git a/src/bindings/cxx/eina_cxx/eina_workarounds.hh b/src/bindings/cxx/eina_cxx/eina_workarounds.hh index 635bf235ff..0ba586972d 100644 --- a/src/bindings/cxx/eina_cxx/eina_workarounds.hh +++ b/src/bindings/cxx/eina_cxx/eina_workarounds.hh @@ -10,62 +10,62 @@ struct _Elm_Calendar_Mark; struct Elm_Gen_Item; struct _Elm_Map_Overlay; -namespace std { +// namespace std { -template <> -struct is_base_of< ::efl::eo::concrete, _Elm_Calendar_Mark > : std::false_type {}; -template <> -struct is_base_of< ::efl::eo::concrete, _Elm_Calendar_Mark const > : std::false_type {}; -template <> -struct is_base_of< ::efl::eo::concrete, _Elm_Calendar_Mark volatile > : std::false_type {}; -template <> -struct is_base_of< ::efl::eo::concrete, _Elm_Calendar_Mark const volatile > : std::false_type {}; +// template <> +// struct is_base_of< ::efl::eo::concrete, _Elm_Calendar_Mark > : std::false_type {}; +// template <> +// struct is_base_of< ::efl::eo::concrete, _Elm_Calendar_Mark const > : std::false_type {}; +// template <> +// struct is_base_of< ::efl::eo::concrete, _Elm_Calendar_Mark volatile > : std::false_type {}; +// template <> +// struct is_base_of< ::efl::eo::concrete, _Elm_Calendar_Mark const volatile > : std::false_type {}; -template <> -struct is_base_of< const ::efl::eo::concrete, _Elm_Calendar_Mark > : std::false_type {}; -template <> -struct is_base_of< const ::efl::eo::concrete, _Elm_Calendar_Mark const > : std::false_type {}; -template <> -struct is_base_of< const ::efl::eo::concrete, _Elm_Calendar_Mark volatile > : std::false_type {}; -template <> -struct is_base_of< const ::efl::eo::concrete, _Elm_Calendar_Mark const volatile > : std::false_type {}; +// template <> +// struct is_base_of< const ::efl::eo::concrete, _Elm_Calendar_Mark > : std::false_type {}; +// template <> +// struct is_base_of< const ::efl::eo::concrete, _Elm_Calendar_Mark const > : std::false_type {}; +// template <> +// struct is_base_of< const ::efl::eo::concrete, _Elm_Calendar_Mark volatile > : std::false_type {}; +// template <> +// struct is_base_of< const ::efl::eo::concrete, _Elm_Calendar_Mark const volatile > : std::false_type {}; -template <> -struct is_base_of< ::efl::eo::concrete, Elm_Gen_Item > : std::false_type {}; -template <> -struct is_base_of< ::efl::eo::concrete, Elm_Gen_Item const > : std::false_type {}; -template <> -struct is_base_of< ::efl::eo::concrete, Elm_Gen_Item volatile > : std::false_type {}; -template <> -struct is_base_of< ::efl::eo::concrete, Elm_Gen_Item const volatile > : std::false_type {}; +// template <> +// struct is_base_of< ::efl::eo::concrete, Elm_Gen_Item > : std::false_type {}; +// template <> +// struct is_base_of< ::efl::eo::concrete, Elm_Gen_Item const > : std::false_type {}; +// template <> +// struct is_base_of< ::efl::eo::concrete, Elm_Gen_Item volatile > : std::false_type {}; +// template <> +// struct is_base_of< ::efl::eo::concrete, Elm_Gen_Item const volatile > : std::false_type {}; -template <> -struct is_base_of< const ::efl::eo::concrete, Elm_Gen_Item > : std::false_type {}; -template <> -struct is_base_of< const ::efl::eo::concrete, Elm_Gen_Item const > : std::false_type {}; -template <> -struct is_base_of< const ::efl::eo::concrete, Elm_Gen_Item volatile > : std::false_type {}; -template <> -struct is_base_of< const ::efl::eo::concrete, Elm_Gen_Item const volatile > : std::false_type {}; +// template <> +// struct is_base_of< const ::efl::eo::concrete, Elm_Gen_Item > : std::false_type {}; +// template <> +// struct is_base_of< const ::efl::eo::concrete, Elm_Gen_Item const > : std::false_type {}; +// template <> +// struct is_base_of< const ::efl::eo::concrete, Elm_Gen_Item volatile > : std::false_type {}; +// template <> +// struct is_base_of< const ::efl::eo::concrete, Elm_Gen_Item const volatile > : std::false_type {}; -template <> -struct is_base_of< ::efl::eo::concrete, _Elm_Map_Overlay > : std::false_type {}; -template <> -struct is_base_of< ::efl::eo::concrete, _Elm_Map_Overlay const > : std::false_type {}; -template <> -struct is_base_of< ::efl::eo::concrete, _Elm_Map_Overlay volatile > : std::false_type {}; -template <> -struct is_base_of< ::efl::eo::concrete, _Elm_Map_Overlay const volatile > : std::false_type {}; +// template <> +// struct is_base_of< ::efl::eo::concrete, _Elm_Map_Overlay > : std::false_type {}; +// template <> +// struct is_base_of< ::efl::eo::concrete, _Elm_Map_Overlay const > : std::false_type {}; +// template <> +// struct is_base_of< ::efl::eo::concrete, _Elm_Map_Overlay volatile > : std::false_type {}; +// template <> +// struct is_base_of< ::efl::eo::concrete, _Elm_Map_Overlay const volatile > : std::false_type {}; -template <> -struct is_base_of< const ::efl::eo::concrete, _Elm_Map_Overlay > : std::false_type {}; -template <> -struct is_base_of< const ::efl::eo::concrete, _Elm_Map_Overlay const > : std::false_type {}; -template <> -struct is_base_of< const ::efl::eo::concrete, _Elm_Map_Overlay volatile > : std::false_type {}; -template <> -struct is_base_of< const ::efl::eo::concrete, _Elm_Map_Overlay const volatile > : std::false_type {}; +// template <> +// struct is_base_of< const ::efl::eo::concrete, _Elm_Map_Overlay > : std::false_type {}; +// template <> +// struct is_base_of< const ::efl::eo::concrete, _Elm_Map_Overlay const > : std::false_type {}; +// template <> +// struct is_base_of< const ::efl::eo::concrete, _Elm_Map_Overlay volatile > : std::false_type {}; +// template <> +// struct is_base_of< const ::efl::eo::concrete, _Elm_Map_Overlay const volatile > : std::false_type {}; -} +// } #endif diff --git a/src/bindings/cxx/eo_cxx/eo_cxx_interop.hh b/src/bindings/cxx/eo_cxx/eo_cxx_interop.hh index 0545f255ff..9005459fa3 100644 --- a/src/bindings/cxx/eo_cxx/eo_cxx_interop.hh +++ b/src/bindings/cxx/eo_cxx/eo_cxx_interop.hh @@ -85,10 +85,15 @@ struct tag }; template -void assign_out_impl(T& lhs, T*& rhs, tag) +void assign_out_impl(T& lhs, T*& rhs, tag, typename std::enable_if::value>::type* = 0) { lhs = *rhs; } +template +void assign_out_impl(T const& lhs, T const*& rhs, tag) +{ + const_cast(lhs) = *rhs; +} inline void assign_out_impl(void*&, void*&, tag) { std::abort(); // out parameter of void type? diff --git a/src/lib/eolian_cxx/grammar/klass_def.hpp b/src/lib/eolian_cxx/grammar/klass_def.hpp index d2f39d3542..b2125e4cf6 100644 --- a/src/lib/eolian_cxx/grammar/klass_def.hpp +++ b/src/lib/eolian_cxx/grammar/klass_def.hpp @@ -13,6 +13,8 @@ #include +#include "eo_concrete.hh" + #include #include #include @@ -251,6 +253,8 @@ inline void type_def::set(Eolian_Type const* eolian_type) break; case EOLIAN_TYPE_REGULAR: { + if(c_type == "va_list *") + throw std::runtime_error(""); std::vector namespaces; for(efl::eina::iterator namespace_iterator( ::eolian_type_namespaces_get(eolian_type)) , namespace_last; namespace_iterator != namespace_last; ++namespace_iterator) diff --git a/src/lib/eolian_cxx/grammar/type_impl.hpp b/src/lib/eolian_cxx/grammar/type_impl.hpp index 5a5049c68c..a6bd0a9158 100644 --- a/src/lib/eolian_cxx/grammar/type_impl.hpp +++ b/src/lib/eolian_cxx/grammar/type_impl.hpp @@ -56,33 +56,47 @@ struct visitor_generate { eina::optional name; eina::optional has_own; + eina::optional is_ref; + eina::optional> namespaces; std::function function; } const match_table[] = { // signed primitives - {"byte", nullptr, [&] { return replace_base_type(regular, " char"); }} - , {"llong", nullptr, [&] { return replace_base_type(regular, " long long"); }} - , {"int8", nullptr, [&] { return replace_base_type(regular, " int8_t"); }} - , {"int16", nullptr, [&] { return replace_base_type(regular, " int16_t"); }} - , {"int32", nullptr, [&] { return replace_base_type(regular, " int32_t"); }} - , {"int64", nullptr, [&] { return replace_base_type(regular, " int64_t"); }} - , {"ssize", nullptr, [&] { return replace_base_type(regular, " ssize_t"); }} + {"byte", nullptr, nullptr, nullptr, [&] { return replace_base_type(regular, " char"); }} + , {"llong", nullptr, nullptr, nullptr, [&] { return replace_base_type(regular, " long long"); }} + , {"int8", nullptr, nullptr, nullptr, [&] { return replace_base_type(regular, " int8_t"); }} + , {"int16", nullptr, nullptr, nullptr, [&] { return replace_base_type(regular, " int16_t"); }} + , {"int32", nullptr, nullptr, nullptr, [&] { return replace_base_type(regular, " int32_t"); }} + , {"int64", nullptr, nullptr, nullptr, [&] { return replace_base_type(regular, " int64_t"); }} + , {"ssize", nullptr, nullptr, nullptr, [&] { return replace_base_type(regular, " ssize_t"); }} // unsigned primitives - , {"ubyte", nullptr, [&] { return replace_base_type(regular, " unsigned char"); }} - , {"ushort", nullptr, [&] { return replace_base_type(regular, " unsigned short"); }} - , {"uint", nullptr, [&] { return replace_base_type(regular, " unsigned int"); }} - , {"ulong", nullptr, [&] { return replace_base_type(regular, " unsigned long"); }} - , {"ullong", nullptr, [&] { return replace_base_type(regular, " unsigned long long"); }} - , {"uint8", nullptr, [&] { return replace_base_type(regular, " uint8_t"); }} - , {"uint16", nullptr, [&] { return replace_base_type(regular, " uint16_t"); }} - , {"uint32", nullptr, [&] { return replace_base_type(regular, " uint32_t"); }} - , {"uint64", nullptr, [&] { return replace_base_type(regular, " uint64_t"); }} - , {"size", nullptr, [&] { return replace_base_type(regular, " size_t"); }} + , {"ubyte", nullptr, nullptr, nullptr, [&] { return replace_base_type(regular, " unsigned char"); }} + , {"ushort", nullptr, nullptr, nullptr, [&] { return replace_base_type(regular, " unsigned short"); }} + , {"uint", nullptr, nullptr, nullptr, [&] { return replace_base_type(regular, " unsigned int"); }} + , {"ulong", nullptr, nullptr, nullptr, [&] { return replace_base_type(regular, " unsigned long"); }} + , {"ullong", nullptr, nullptr, nullptr, [&] { return replace_base_type(regular, " unsigned long long"); }} + , {"uint8", nullptr, nullptr, nullptr, [&] { return replace_base_type(regular, " uint8_t"); }} + , {"uint16", nullptr, nullptr, nullptr, [&] { return replace_base_type(regular, " uint16_t"); }} + , {"uint32", nullptr, nullptr, nullptr, [&] { return replace_base_type(regular, " uint32_t"); }} + , {"uint64", nullptr, nullptr, nullptr, [&] { return replace_base_type(regular, " uint64_t"); }} + , {"size", nullptr, nullptr, nullptr, [&] { return replace_base_type(regular, " size_t"); }} + , {"size", nullptr, nullptr, nullptr, [&] { return replace_base_type(regular, " size_t"); }} + , {"File", nullptr, nullptr, {{"Eina"}}, [&] + { + const char const_[] = "const "; + if(regular.base_qualifier.qualifier & qualifier_info::is_const) + std::copy(&const_[0], &const_[0] + sizeof(const_) - 1, sink); + const char name[] = "Eina_File*"; + std::copy(&name[0], &name[0] + sizeof(name) - 1, sink); + if(is_out) + *sink++ = '*'; + return attributes::type_def::variant_type{}; + }} - , {"ptrdiff", nullptr, [&] { return replace_base_type(regular, " ptrdiff_t"); }} - , {"intptr", nullptr, [&] { return replace_base_type(regular, " intptr_t"); }} - , {"string", true, [&] + , {"ptrdiff", nullptr, nullptr, nullptr, [&] { return replace_base_type(regular, " ptrdiff_t"); }} + , {"intptr", nullptr, nullptr, nullptr, [&] { return replace_base_type(regular, " intptr_t"); }} + , {"string", true, nullptr, nullptr, [&] { regular_type_def r = regular; r.base_qualifier.qualifier ^= qualifier_info::is_ref; @@ -90,22 +104,23 @@ struct visitor_generate return replace_base_type(r, " ::std::string"); else return replace_base_type(r, " ::efl::eina::string_view"); }} - , {"string", false, [&] + , {"string", false, nullptr, nullptr, [&] { regular_type_def r = regular; r.base_qualifier.qualifier ^= qualifier_info::is_ref; return replace_base_type(r, " ::efl::eina::string_view"); }} - , {"stringshare", nullptr, [&] + , {"stringshare", nullptr, nullptr, nullptr, [&] { regular_type_def r = regular; r.base_qualifier.qualifier ^= qualifier_info::is_ref; return replace_base_type(r, " ::efl::eina::stringshare"); }} - , {"generic_value", true, [&] - { return regular_type_def{" ::efl::eina::value", regular.base_qualifier, {}}; + , {"generic_value", true, nullptr, nullptr, [&] + { + return regular_type_def{" ::efl::eina::value", regular.base_qualifier ^ qualifier_info::is_ref, {}}; }} - , {"generic_value", false, [&] + , {"generic_value", false, nullptr, nullptr, [&] { return regular_type_def{" ::efl::eina::value_view", regular.base_qualifier, {}}; }} }; @@ -127,11 +142,16 @@ struct visitor_generate { return (!m.name || *m.name == regular.base_type) && (!m.has_own || *m.has_own == (bool)(regular.base_qualifier & qualifier_info::is_own)) + && (!m.namespaces || *m.namespaces == regular.namespaces) + && (!m.is_ref || *m.is_ref == (bool)(regular.base_qualifier & qualifier_info::is_ref)) ; } , [&] (attributes::type_def::variant_type const& v) { - return v.visit(*this); // we want to keep is_out info + if(!v.empty()) + return v.visit(*this); // we want to keep is_out info + else + return true; })) { return *b; diff --git a/src/tests/eina_cxx/eina_cxx_test_accessor.cc b/src/tests/eina_cxx/eina_cxx_test_accessor.cc index 6590779160..864e0743c3 100644 --- a/src/tests/eina_cxx/eina_cxx_test_accessor.cc +++ b/src/tests/eina_cxx/eina_cxx_test_accessor.cc @@ -17,6 +17,13 @@ struct wrapper : efl::eo::concrete : concrete(o) {} }; +namespace efl { namespace eo { + +template <> +struct is_eolian_object< ::wrapper> : std::true_type {}; + +} } + START_TEST(eina_cxx_accessor_indexing) { efl::eina::eina_init eina_init; diff --git a/src/tests/eina_cxx/eina_cxx_test_ptrarray.cc b/src/tests/eina_cxx/eina_cxx_test_ptrarray.cc index 2bfa44f68a..f5d24474f1 100644 --- a/src/tests/eina_cxx/eina_cxx_test_ptrarray.cc +++ b/src/tests/eina_cxx/eina_cxx_test_ptrarray.cc @@ -18,6 +18,13 @@ struct wrapper : efl::eo::concrete : concrete(o) {} }; +namespace efl { namespace eo { + +template <> +struct is_eolian_object< ::wrapper> : std::true_type {}; + +} } + START_TEST(eina_cxx_ptrarray_push_back) { efl::eina::eina_init eina_init; diff --git a/src/tests/eina_cxx/eina_cxx_test_ptrlist.cc b/src/tests/eina_cxx/eina_cxx_test_ptrlist.cc index 7c43854867..82a1deeec8 100644 --- a/src/tests/eina_cxx/eina_cxx_test_ptrlist.cc +++ b/src/tests/eina_cxx/eina_cxx_test_ptrlist.cc @@ -20,6 +20,13 @@ struct wrapper : efl::eo::concrete : concrete(o) {} }; +namespace efl { namespace eo { + +template <> +struct is_eolian_object< ::wrapper> : std::true_type {}; + +} } + START_TEST(eina_cxx_ptrlist_push_back) { efl::eina::eina_init eina_init;