[cfe-commits] [patch] Rename -Wself-assign-memvar to -Wself-assign-field

Richard Smith richard at metafoo.co.uk
Mon Jul 2 18:07:03 PDT 2012

On Mon, Jul 2, 2012 at 5:47 PM, Jordan Rose <jordan_rose at apple.com> wrote:

> On Jul 2, 2012, at 5:40 PM, Chandler Carruth wrote:
> > I'd be very happy for the diagnostic text to use more specialized
> terminology when it can -- I think that makes the user experience quite a
> bit better.
> >
> > Not sure its worth having two flags though.
> I already made Nico do that :-) and yes, I agree about the flags. I just
> wanted to make sure we didn't end up with something exclusively C++.
> ("field", of course, is just falling back to the common denominator of C.)

"field" doesn't mean anything in C or in C++ (or, as far as I know,
Objective-C). I'm not sure whether that makes it a great choice or a
terrible choice for naming things which are either members in C, non-static
data members in C++, or ivars (and @defs) in Objective-C, but that's how we
currently use it. For instance:

<stdin>:1:28: error: field has incomplete type 'X'
struct X; @interface A { X x; } @end
<stdin>:1:8: note: forward declaration of 'X'
struct X; @interface A { X x; } @end
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20120702/dcc115f9/attachment.html>

More information about the cfe-commits mailing list