From 372c5b97bfa3b744de1d017cf662607eb8a2fa6e Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Wed, 8 May 2019 15:28:39 -0700 Subject: [PATCH] [map] Fix bots Older compilers don't like calling iter() from return-type decltype() ../src/hb-map.hh:226:12: error: cannot call member function 'decltype ((((+ hb_array(((const hb_hashmap_t*)this)->hb_hashmap_t::items, (((const hb_hashmap_t*)this)->hb_hashmap_t::mask ? (((const hb_hashmap_t*)this)->hb_hashmap_t::mask + 1) : 0))) | hb_filter((& hb_hashmap_t::item_t:: is_real))) | hb_map((& hb_hashmap_t::item_t:: get_pair)))) hb_hashmap_t::iter() const [with K = const hb_serialize_context_t::object_t*; V = unsigned int; K kINVALID = 0u; V vINVALID = 0u; decltype ((((+ hb_array(((const hb_hashmap_t*)this)->hb_hashmap_t::items, (((const hb_hashmap_t*)this)->hb_hashmap_t::mask ? (((const hb_hashmap_t*)this)->hb_hashmap_t::mask + 1) : 0))) | hb_filter((& hb_hashmap_t::item_t:: is_real))) | hb_map((& hb_hashmap_t::item_t:: get_pair)))) = hb_map_iter_t::item_t>, bool (hb_hashmap_t::item_t::*)() const, const&, 0u>, hb_pair_t (hb_hashmap_t::item_t::*)() const, 0u>]' without object + iter() ^ ../src/hb-meta.hh:58:41: note: in definition of macro 'HB_AUTO_RETURN' #define HB_AUTO_RETURN(E) -> decltype ((E)) { return (E); } ^ --- src/hb-map.hh | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/hb-map.hh b/src/hb-map.hh index 1c2fe145f..6eac8c3d3 100644 --- a/src/hb-map.hh +++ b/src/hb-map.hh @@ -218,13 +218,15 @@ struct hb_hashmap_t ) auto keys () const HB_AUTO_RETURN ( - + iter() - | hb_map (&hb_pair_t::first) + + hb_array (items, mask ? mask + 1 : 0) + | hb_filter (&item_t::is_real) + | hb_map (&item_t::key) ) auto values () const HB_AUTO_RETURN ( - + iter() - | hb_map (&hb_pair_t::second) + + hb_array (items, mask ? mask + 1 : 0) + | hb_filter (&item_t::is_real) + | hb_map (&item_t::value) ) protected: