[PATCH] D73548: [clang-tidy] Added option for disabling const qualifiers in readability-qualified-auto

Nathan James via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Jan 28 06:41:13 PST 2020


njames93 marked an inline comment as done.
njames93 added inline comments.


================
Comment at: clang-tools-extra/clang-tidy/readability/QualifiedAutoCheck.cpp:209
+      llvm::StringRef PtrConst =
+          (AddConstQualifier && isPointerConst(Var->getType())) ? "const " : "";
       llvm::StringRef LocalConst = IsLocalConst ? "const " : "";
----------------
If a variables is typed as `auto x = cast<const int*>(y)`, should the behaviour be `const auto*x = ...` even if AddConstQualifier is turned off. Thereby making the AddConstQualifier check only there to ensure that variables already typed as `auto *` and `auto &` get const qualifier if necessary


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D73548





More information about the cfe-commits mailing list