On Wed, Jun 02, 2021 at 11:09:45AM -0400, Jason Merrill wrote:
> On 6/2/21 3:59 AM, Jakub Jelinek wrote:
> >           if (!allows_reg && !cxx_mark_addressable (*op))
> >             operand = error_mark_node;
> > +         else if (!allows_reg && bitfield_p (*op))
> > +           {
> > +             error_at (loc, "attempt to take address of bit-field");
> 
> Hmm, why aren't we already catching this in cxx_mark_addressable?

That is certainly possible, but it goes against Eric's patch
https://gcc.gnu.org/pipermail/gcc-patches/2015-June/421483.html

So, do you want to keep the
  if (bitfield_p (arg))
    {
      if (complain & tf_error)
        error_at (loc, "attempt to take address of bit-field");
      return error_mark_node;
    }
in cp_build_addr_expr_1 and duplicate such check in cxx_mark_addressable
(though, that one doesn't have complain, will it be ok to do it
unconditionally for SFINAE)?

Shall the C FE do the same (i.e. diagnose in both places)?

        Jakub

Reply via email to