[all-commits] [llvm/llvm-project] 556600: [clang-tidy] Add option to ignore user-defined lit...

Carlos Galvez via All-commits all-commits at lists.llvm.org
Sun Mar 26 09:43:18 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 556600af6a8a7f241277f7a22c3e3746e7b09123
      https://github.com/llvm/llvm-project/commit/556600af6a8a7f241277f7a22c3e3746e7b09123
  Author: Carlos Galvez <carlosgalvezp at gmail.com>
  Date:   2023-03-26 (Sun, 26 Mar 2023)

  Changed paths:
    M clang-tools-extra/clang-tidy/readability/MagicNumbersCheck.cpp
    M clang-tools-extra/clang-tidy/readability/MagicNumbersCheck.h
    M clang-tools-extra/docs/ReleaseNotes.rst
    M clang-tools-extra/docs/clang-tidy/checks/readability/magic-numbers.rst
    M clang-tools-extra/test/clang-tidy/checkers/readability/magic-numbers-userliteral.cpp

  Log Message:
  -----------
  [clang-tidy] Add option to ignore user-defined literals in readability-magic-numbers

Some user-defined literals operate on implementation-defined types, like
"unsigned long long" and "long double", which are not well supported by
this check. Currently, the check gives warnings when using UDLs, without
giving possiblity to the user to whitelist common UDLs. A good compromise
until a proper fix is found (if any) is to allow the user to disable
warnings on UDLs.

Partially fixes #61656

Differential Revision: https://reviews.llvm.org/D146913




More information about the All-commits mailing list