This is an archive of the discontinued LLVM Phabricator instance.

Warn on explicit copy constructors.
ClosedPublic

Authored by alexfh on Apr 29 2014, 6:58 AM.

Details

Summary

The Google C++ Style Guide doesn't require copy constructors to be
declared explicit, but some people do this by mistake. Make this check detect
and fix such cases.

Diff Detail

Event Timeline

alexfh updated this revision to Diff 8919.Apr 29 2014, 6:58 AM
alexfh retitled this revision from to Warn on explicit copy constructors..
alexfh updated this object.
alexfh edited the test plan for this revision. (Show Details)
alexfh added a reviewer: djasper.
alexfh added a subscriber: Unknown Object (MLST).
alexfh updated this revision to Diff 8920.Apr 29 2014, 7:04 AM

Added a separate variable for lambda, reformatted code.

djasper accepted this revision.Apr 29 2014, 7:53 AM
djasper edited edge metadata.
djasper added inline comments.
clang-tidy/google/GoogleTidyModule.cpp
34

IMO, passing in a lambda is a slight overkill here, at least until this is actually used for a second purpose. But ok.

62

So, this is:

if (a || b) {
  if (a && b) {
    ..
  }
  return;
}

I think this is easier to follow as:

if (a && b) {
  ..
}
if (a || b)
  return;

And the latter if can actually be merged with the if concerning the parameter count.

This revision is now accepted and ready to land.Apr 29 2014, 7:53 AM
alexfh closed this revision.Apr 29 2014, 8:14 AM