[PATCH] D67265: [clang-tidy] Magic number checker shouldn't warn on user defined string literals

Eugene Zelenko via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Sep 6 06:52:48 PDT 2019


Eugene.Zelenko added inline comments.


================
Comment at: clang-tools-extra/clang-tidy/readability/MagicNumbersCheck.cpp:125
+        // std::string s = "Hello World"s;
+        if (const UserDefinedLiteral *UDL = Parent.get<UserDefinedLiteral>())
+          if (UDL->getLiteralOperatorKind() == UserDefinedLiteral::LOK_String)
----------------
You could use const auto *, because type is spelled in same statement.


Repository:
  rCTE Clang Tools Extra

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

https://reviews.llvm.org/D67265





More information about the cfe-commits mailing list