[PATCH] D46951: [clang-tidy] misc-unused-parameters - retain old behavior under StrictMode

Roman Lebedev via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Jun 27 08:07:42 PDT 2018


lebedev.ri accepted this revision.
lebedev.ri added a comment.
This revision is now accepted and ready to land.

I would like to see some test in non-strict mode that shows that
it is the child existence is what matters, e.g. with empty lines,
and maybe another one with all the content commented out `/**/`.

Otherwise this looks good.



================
Comment at: clang-tidy/misc/UnusedParametersCheck.cpp:180
+    // (constructor initializer counts for non-empty body).
+    if (StrictMode || llvm::distance(Function->getBody()->children()) > 0 ||
+        (isa<CXXConstructorDecl>(Function) &&
----------------
So this checks that there are children.


Repository:
  rCTE Clang Tools Extra

https://reviews.llvm.org/D46951





More information about the cfe-commits mailing list