Thanks for the review! On Tue, Sep 18, 2012 at 4:26 PM, Matt Beaumont-Gay <[email protected]> wrote: > On Tue, Sep 18, 2012 at 7:26 AM, Hans Wennborg <[email protected]> wrote: >> Hi all, >> >> The attached patch makes Clang warn about self references in in-class >> initializers, for example: >> >> struct S { >> int a = a + 42; >> }; >> >> The patch basically just moves UninitializedFieldVisitor up a bit in >> the file, and adds a call to it from ActOnCXXInClassMemberInitializer. >> >> Please take a look. > > LGTM; one nit: > > + // Also need to take into account that some fields may be initialized > by > + // in-class initializers, see C++0x [class.base.init]p9. > > ITYM "C++11".
Fixed. >> Also, these warnings just say "field is >> unitialized when used here". Would anyone be opposed to changing it to >> "field 'a' is unitiailized when used here"? > > Looking at other test cases in uninitialized.cpp, I think using the > field name in the diagnostic would be more consistent. Cool. I'll do this in a follow-up patch. Landed in r164131. Thanks, Hans _______________________________________________ cfe-commits mailing list [email protected] http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
