This is an archive of the discontinued LLVM Phabricator instance.

[clang-tidy] ProTypeMemberInitCheck - check that field decls do not have in-class initializer
ClosedPublic

Authored by flx on Mar 19 2016, 8:26 PM.

Diff Detail

Event Timeline

flx updated this revision to Diff 51123.Mar 19 2016, 8:26 PM
flx retitled this revision from to [clang-tidy] ProTypeMemberInitCheck - check that field decls do not have in-class initializer.
flx updated this object.
flx added reviewers: alexfh, JVApen.
flx set the repository for this revision to rL LLVM.
flx added a subscriber: cfe-commits.
JVApen accepted this revision.Mar 20 2016, 3:53 AM
JVApen edited edge metadata.

I'm not sure if I'm the right person to do reviews, as I'm mostly a user of the tool and have not yet done any developments or bug fixes to it.
However, from what I know from coding, this looks good to me.

This revision is now accepted and ready to land.Mar 20 2016, 3:53 AM
aaron.ballman added a subscriber: aaron.ballman.
aaron.ballman added inline comments.
test/clang-tidy/cppcoreguidelines-pro-type-member-init.cpp
94

Why is this checking a fix? I thought that point was that this should not generate any diagnostic (and hence, no fix is required)?

flx added inline comments.Mar 20 2016, 9:51 AM
test/clang-tidy/cppcoreguidelines-pro-type-member-init.cpp
94

If I understood Alex correctly, CHECK-FIXES is needed to check for the absence of a change made by ClangTidy. But I agree it seems unlikely to have a change without a warning message which will trigger a test failure at any rate.

aaron.ballman added inline comments.Mar 28 2016, 8:08 AM
test/clang-tidy/cppcoreguidelines-pro-type-member-init.cpp
94

@alexfh, what are your thoughts on this? It seems like we should be able to test negative fixes, like with CHECK-NOT, except CHECK-FIXES-NOT or some such?

alexfh accepted this revision.Apr 11 2016, 9:32 AM
alexfh edited edge metadata.

Missed this patch somehow: it was in a wrong part of my dashboard =\

LG. Thanks for the fix.

test/clang-tidy/cppcoreguidelines-pro-type-member-init.cpp
94

I usually ask people to add CHECK-FIXES in case when there is a warning that could change some code, but shouldn't. When there's no warning that is likely to touch some code, there's no need for a CHECK-FIXES to verify this.

Felix, do you have time to commit the patch or should I do this for you?

flx added a subscriber: flx.Apr 26 2016, 6:32 AM

I should free up again soon, just caught the flu though. Maybe next week?
Feel free to commit before then.

In D18300#412003, @flx wrote:

I should free up again soon, just caught the flu though. Maybe next week?
Feel free to commit before then.

Just tried it, and the patch doesn't apply cleanly. Leaving this to you.

This revision was automatically updated to reflect the committed changes.