[PATCH] D144347: [clang-tidy] Add readability-forward-usage check

Chris Cotter via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sun Mar 26 10:19:55 PDT 2023


ccotter added a comment.

Is it worth adding a cppcoreguidelines alias (ES.56)?



================
Comment at: clang-tools-extra/docs/clang-tidy/checks/readability/forward-usage.rst:98
+
+.. option:: DisableTypeMismatchSuggestion
+
----------------
Curious what others thing but I think the tool should by default not remove or replace `forward` with static_cast.  When an author has written `forward`, there is a good chance they intended to forward something (e.g., they forgot to use `&&` in the parameter declaration). My hypothesis is that it's more likely the author intended to forward something, rather than than they were trying to use it as a cast (but had not intention of forward - why else would they have typed it out?). In this case, I think it merits manual review by default (so the tool should always warn, but without the fixits by default).


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D144347



More information about the cfe-commits mailing list