From d87d38998a4ff7bec3d8fb658dc9299f144a2fcb Mon Sep 17 00:00:00 2001 From: Ebrahim Byagowi Date: Sat, 21 Sep 2019 17:27:39 +0430 Subject: [PATCH] Fix clang -Wrange-loop-analysis complains ./hb-ot-layout-gpos-table.hh:674:43: error: loop variable '_' is always a copy because the range of type 'hb_zip_iter_t > &>, hb_iter_type > &> >' (aka 'hb_zip_iter_t >, hb_array_t > >') does not return a reference [-Werror,-Wrange-loop-analysis] for (const hb_pair_t& _ : hb_zip (val_iter, first_val_iter)) ^ ./hb-ot-layout-gpos-table.hh:674:12: note: use non-reference type 'hb_pair_t' (aka 'hb_pair_t, IntType >') for (const hb_pair_t& _ : hb_zip (val_iter, first_val_iter)) and In file included from hb-subset.cc:44: ./hb-ot-vorg-table.hh:87:34: error: loop variable '_' is always a copy because the range of type 'hb_map_iter_t, const hb_set_t *, OT::HBGlyphID OT::VertOriginMetric::*, nullptr>, (lambda at ./hb-ot-vorg-table.hh:100:15), hb_function_sortedness_t::NOT_SORTED, nullptr>' does not return a reference [-Werror,-Wrange-loop-analysis] for (const VertOriginMetric& _ : it) ^ ./hb-ot-vorg-table.hh:113:17: note: in instantiation of function template specialization 'OT::VORG::serialize, const hb_set_t *, OT::HBGlyphID OT::VertOriginMetric::*, nullptr>, (lambda at ./hb-ot-vorg-table.hh:100:15), hb_function_sortedness_t::NOT_SORTED, nullptr>, nullptr>' requested here vorg_prime->serialize (c->serializer, it, defaultVertOriginY); ^ ./hb-ot-vorg-table.hh:87:10: note: use non-reference type 'OT::VertOriginMetric' for (const VertOriginMetric& _ : it) ^~~~~~~~~~~~~~~~~~~~~~~~~~~ --- src/hb-ot-layout-gpos-table.hh | 2 +- src/hb-ot-vorg-table.hh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/hb-ot-layout-gpos-table.hh b/src/hb-ot-layout-gpos-table.hh index be6cce5ff..3814213dc 100644 --- a/src/hb-ot-layout-gpos-table.hh +++ b/src/hb-ot-layout-gpos-table.hh @@ -671,7 +671,7 @@ struct SinglePos for (hb_array_t val_iter : + glyph_val_iter_pairs | hb_map (hb_second)) - for (const hb_pair_t& _ : hb_zip (val_iter, first_val_iter)) + for (const hb_pair_t _ : hb_zip (val_iter, first_val_iter)) if (_.first != _.second) { subset_format = 2; diff --git a/src/hb-ot-vorg-table.hh b/src/hb-ot-vorg-table.hh index 2516a9010..fea3a9acf 100644 --- a/src/hb-ot-vorg-table.hh +++ b/src/hb-ot-vorg-table.hh @@ -84,7 +84,7 @@ struct VORG this->defaultVertOriginY = defaultVertOriginY; this->vertYOrigins.len = it.len (); - for (const VertOriginMetric& _ : it) + for (const VertOriginMetric _ : it) c->copy (_); }