aaron.ballman requested changes to this revision.
aaron.ballman added inline comments.
This revision now requires changes to proceed.


================
Comment at: clang-tools-extra/clang-tidy/misc/UnusedParametersCheck.cpp:188
     // (constructor initializer counts for non-empty body).
-    if (StrictMode ||
+    if (StrictMode || !Function->isExternallyVisible() ||
         (Function->getBody()->child_begin() !=
----------------
This is looking at the linkage of the function, not at its access control; is 
that intended?


================
Comment at: 
clang-tools-extra/docs/clang-tidy/checks/misc-unused-parameters.rst:43
+   a human reader, and there's basically no place for a bug to hide. On the 
other
+   hand for non-public functions, all the call-sites are visible and the 
parameter
+   can be eliminated entirely.
----------------
Call sites are not always visible for protected functions, so this seems a bit 
suspicious. The changes are missing test coverage for that situation.


================
Comment at: 
clang-tools-extra/test/clang-tidy/checkers/misc-unused-parameters.cpp:157-159
+// CHECK-FIXES: C() {}
+  C(int i) {}
+// CHECK-MESSAGES: :[[@LINE-1]]:9: warning
----------------
I think this demonstrates a bad fix -- this changes code meaning from being a 
converting constructor to being a default constructor, which are very different 
things.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D116512/new/

https://reviews.llvm.org/D116512

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to