[PATCH] D69238: Fix clang-tidy readability-redundant-string-init for c++17/c++2a

Eugene Zelenko via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Oct 21 06:34:42 PDT 2019


Eugene.Zelenko added inline comments.


================
Comment at: clang-tools-extra/clang-tidy/readability/RedundantStringInitCheck.cpp:78
+                const clang::NamedDecl *Decl, const clang::Expr *CtorExpr) {
+  const auto &SM = *Result.SourceManager;
+  const StringRef Name = Decl->getName();
----------------
Please do not use auto if type is not spelled in same statement or iterator


================
Comment at: clang-tools-extra/clang-tidy/readability/RedundantStringInitCheck.cpp:124
   const auto *Decl = Result.Nodes.getNodeAs<NamedDecl>("decl");
-  diag(CtorExpr->getExprLoc(), "redundant string initialization")
-      << FixItHint::CreateReplacement(CtorExpr->getSourceRange(),
-                                      Decl->getName());
+  const auto CtorExprRange = CtorSourceRange(Result, Decl, CtorExpr);
+  DiagnosticBuilder Diag =
----------------
Please do not use auto if type is not spelled in same statement or iterator


Repository:
  rCTE Clang Tools Extra

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

https://reviews.llvm.org/D69238





More information about the cfe-commits mailing list