[all-commits] [llvm/llvm-project] 68546c: bugprone-forwarding-reference-overload: support no...

Jesse Towner via All-commits all-commits at lists.llvm.org
Thu Jul 29 04:02:06 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 68546c9d6fc54a7ca7ad487cd4b6a5dafea9b4f3
      https://github.com/llvm/llvm-project/commit/68546c9d6fc54a7ca7ad487cd4b6a5dafea9b4f3
  Author: Jesse Towner <townerj at gmail.com>
  Date:   2021-07-29 (Thu, 29 Jul 2021)

  Changed paths:
    M clang-tools-extra/clang-tidy/bugprone/ForwardingReferenceOverloadCheck.cpp
    M clang-tools-extra/docs/clang-tidy/checks/bugprone-forwarding-reference-overload.rst
    M clang-tools-extra/test/clang-tidy/checkers/bugprone-forwarding-reference-overload.cpp

  Log Message:
  -----------
  bugprone-forwarding-reference-overload: support non-type template parameters

Many concepts emulation libraries, such as the one found in Range v3, tend to
use non-type template parameters for the enable_if type expression, due to
their versatility in template functions and constructors containing variadic
template parameter packs.

Unfortunately the bugprone-forwarding-reference-overload check does not
handle non-type template parameters, as was first noted in this bug report:
https://bugs.llvm.org/show_bug.cgi?id=38081

This patch fixes this long standing issue and allows for the check to be suppressed
with the use of a non-type template parameter containing enable_if or enable_if_t in
the type expression, so long as it has a default literal value.




More information about the All-commits mailing list