This is an archive of the discontinued LLVM Phabricator instance.

Use 'override/final' instead of 'virtual' for overridden methods
ClosedPublic

Authored by alexfh on Apr 9 2015, 10:30 AM.

Details

Summary

The patch is generated using clang-tidy misc-use-override check.

This command was used:

tools/clang/tools/extra/clang-tidy/tool/run-clang-tidy.py \
  -checks='-*,misc-use-override' -header-filter='llvm|clang' -j=32 -fix

Diff Detail

Event Timeline

alexfh updated this revision to Diff 23502.Apr 9 2015, 10:30 AM
alexfh retitled this revision from to Use 'override/final' instead of 'virtual' for overridden methods.
alexfh updated this object.
alexfh edited the test plan for this revision. (Show Details)
alexfh added a reviewer: dblaikie.
alexfh added a subscriber: Unknown Object (MLST).
alexfh updated this revision to Diff 23507.Apr 9 2015, 10:41 AM

svn diff|clang-format-diff

alexfh updated this revision to Diff 23515.EditedApr 9 2015, 11:14 AM

Recreated the patch using:

tools/clang/tools/extra/clang-tidy/tool/run-clang-tidy.py -checks='-*,misc-use-override' -header-filter='llvm|clang' -j=32 -fix -format

Fewer formatting-only changes.

dblaikie accepted this revision.Apr 10 2015, 4:40 PM
dblaikie edited edge metadata.

Looks good to me.

Looks like we missed a bunch of 'override' in Clang in general, great to put it in and remove the redundant virtual at the same time.

include/clang/Analysis/AnalysisContext.h
327

Do we have a clang-tidy warning for explicitly writing default definitions of functions? Would love to just not have this sort of code written at all.

This revision is now accepted and ready to land.Apr 10 2015, 4:40 PM
alexfh added inline comments.Apr 10 2015, 6:41 PM
include/clang/Analysis/AnalysisContext.h
327

Would you prefer to remove all empty or default destructors defined inline in derived classes? No, we don't have this check yet.

alexfh closed this revision.Apr 10 2015, 7:03 PM