This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [C++/70393] constexpr constructor


On 03/30/16 13:22, Jason Merrill wrote:
On 03/29/2016 08:40 AM, Nathan Sidwell wrote:
+          /* The field we're initializing must be on the field
+         list.  Look to see if it is present before the
+         field the current ELT initializes.  */
+          for (; fields != cep->index; fields = DECL_CHAIN (fields))
+        if (index == fields)
+          goto insert;

Instead of searching through the fields, could we compare DECL_FIELD_OFFSET of
index and cep->index?

I wondered about that, but then there's bitfields (and I can't recall how they behave WRT DECL_FIELD_OFFSET). pointer equality seems cheap enough?

nathan


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]