[PATCH] D73548: [clang-tidy] Added option for disabling const qualifiers in readability-qualified-auto
Aaron Ballman via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Sun Feb 2 13:37:32 PST 2020
aaron.ballman added inline comments.
================
Comment at: clang-tools-extra/clang-tidy/readability/QualifiedAutoCheck.cpp:262
+ << (Var->getType().isLocalVolatileQualified() ? "volatile " : "")
+ << Var->getName() << FixItHint::CreateInsertion(InsertPos, "const ");
+ }
----------------
njames93 wrote:
> aaron.ballman wrote:
> > Not specific to this patch, so feel free to address in another one -- I think you should be passing `Var` instead of `Var->getName()` -- the diagnostics engine does magic to format the name properly for any `NamedDecl`, including proper quoting. (Similar applies elsewhere.)
> I couldn't do that as it actually messes the quotes up: `'auto &'TdNakedCRef''`
Ah, good point. I was thinking about variable template specializations, but I'm not certain there's an actual issue with them -- it seems like we really want just the base identifier here.
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