ccotter added inline comments.

================
Comment at: 
clang-tools-extra/docs/clang-tidy/checks/bugprone/std-forward-type-mismatch.rst:18
+    doSomething(std::forward<Derived&>(base)); // Incorrect usage
+    doSomething(static_cast<Derived&>(base)); // Suggested usage
+  }
----------------
How confident are we to suggest a fixit to use `static_cast`? Although 
equivalent, the code could be incorrect to begin with and merit manual review 
to decide what the correct cast really should be.


================
Comment at: 
clang-tools-extra/test/clang-tidy/checkers/bugprone/std-forward-type-mismatch.cpp:116
+void testPartialTemplateBad(WrapperEx<T> value) {
+  test(std::forward<Wrapper<T>>(value));
+// CHECK-MESSAGES: :[[@LINE-1]]:8: warning: using 'std::forward' for type 
conversions from 'WrapperEx<T>' to 'Wrapper<T>' is not recommended here, use 
'static_cast' instead
----------------
Does this check work if `testPartialTemplateBad` is not instantiated?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D154999

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

Reply via email to