Missing "override" keyword not always caught by the chromium style clang plugin |
||
Issue descriptionRunning the clang-tidy modernize-use-override check finds instances of missing "override" keywords that our chromium style plugin should have caught. Here's a list of instances in //content/renderer: https://chromium-review.googlesource.com/c/chromium/src/+/727386 thakis@: could you help find a component/owner for this please?
,
Oct 20 2017
Not sure how soon I'll be able to poke at this, but definitely seems buggy.
,
Oct 23 2017
OK I think I understand what's going on. We avoid emitting this check for things that we believe to be gmock objects. All the objects where checks are being skipped contain mocked-out method overrides, which we explicitly skip virtual checks for: https://cs.chromium.org/chromium/src/tools/clang/plugins/FindBadConstructsConsumer.cpp?rcl=778426a57df0f89eaa432f417b6ed8d94ff45448&l=501 One simple way to improve this situation is to still check destructors, but skip everything else. The more complex solution is to improve the logic for skipping methods defined by Gmock macros, using something similar to what we used for rewriting Blink to Chrome style: https://cs.chromium.org/chromium/src/tools/clang/rewrite_to_chrome_style/RewriteToChromeStyle.cpp |
||
►
Sign in to add a comment |
||
Comment 1 by dcheng@chromium.org
, Oct 20 2017Labels: clang
Owner: dcheng@chromium.org