This is an archive of the discontinued LLVM Phabricator instance.

clang-tidy: add IgnoreMacros option to modernize-use-default-member-init
ClosedPublic

Authored by vmiklos on May 6 2017, 12:47 PM.

Details

Summary

And also enable it by default to be consistent with e.g.
modernize-use-using.

This helps e.g. when running this check on cppunit client code where the
macro is provided by the system, so there is no easy way to modify it.

Diff Detail

Repository
rL LLVM

Event Timeline

vmiklos created this revision.May 6 2017, 12:47 PM
malcolm.parsons added a subscriber: cfe-commits.

Should this option be shared?

Should this option be shared?

If the alternative is to make this a general clang-tidy option where all but these two checks ignore it, I think that's more confusing to the users. Or do you have an example option in mind that's shared only between a few checks?

Should this option be shared?

If the alternative is to make this a general clang-tidy option where all but these two checks ignore it, I think that's more confusing to the users. Or do you have an example option in mind that's shared only between a few checks?

See uses of OptionsView::getLocalOrGlobal().

vmiklos updated this revision to Diff 98108.May 7 2017, 1:20 PM

See uses of OptionsView::getLocalOrGlobal().

Ah, I see. Then yes, I think it makes sense; e.g. for the above cppunit case ideally I want to avoid any kind of warning from macros, since none of them can be easily fixed in system headers. (And the other way around, if system headers are not a problem, then all kind of warnings inside macros are probably interesting.) The updated patch uses getLocalOrGlobal() for the new option.

The updated patch uses getLocalOrGlobal() for the new option.

Please change modernize-use-using to match.

vmiklos updated this revision to Diff 98163.May 8 2017, 7:02 AM

Please change modernize-use-using to match.

Done.

This revision is now accepted and ready to land.May 8 2017, 7:33 AM
This revision was automatically updated to reflect the committed changes.