[PATCH] D145778: [clang-tidy] Change readability-magic-numbers to allow numbers in type aliases.

Piotr Zegar via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Mar 10 02:36:04 PST 2023


PiotrZSL added inline comments.


================
Comment at: clang-tools-extra/clang-tidy/readability/MagicNumbersCheck.cpp:40
 
+  if (Node.get<TypeAliasDecl>() || Node.get<TypedefNameDecl>())
+    return true;
----------------
This should be configurable, someone else may don't want magic numbers in template arguments.
So we shouldn't change default behaviour.


================
Comment at: clang-tools-extra/docs/ReleaseNotes.rst:196
+- Improved :doc:`readability-magic-numbers 
+  <clang-tidy/checks/readability/magic-numbers>` check. The check now allows for
+  magic numbers in type aliases such as ``using`` and ``typedef`` declarations.
----------------
consider: "check, now allows..."


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D145778



More information about the cfe-commits mailing list