[PATCH] D54943: [clang-tidy] implement const-transformation for cppcoreguidelines-const-correctness

Jonas Toth via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sat Jan 29 12:25:03 PST 2022


JonasToth updated this revision to Diff 404296.
JonasToth added a comment.

- use boolean for option parsing


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D54943

Files:
  clang-tools-extra/clang-tidy/cppcoreguidelines/ConstCorrectnessCheck.h


Index: clang-tools-extra/clang-tidy/cppcoreguidelines/ConstCorrectnessCheck.h
===================================================================
--- clang-tools-extra/clang-tidy/cppcoreguidelines/ConstCorrectnessCheck.h
+++ clang-tools-extra/clang-tidy/cppcoreguidelines/ConstCorrectnessCheck.h
@@ -26,13 +26,13 @@
 public:
   ConstCorrectnessCheck(StringRef Name, ClangTidyContext *Context)
       : ClangTidyCheck(Name, Context),
-        AnalyzeValues(Options.get("AnalyzeValues", 1)),
-        AnalyzeReferences(Options.get("AnalyzeReferences", 1)),
-        WarnPointersAsValues(Options.get("WarnPointersAsValues", 0)),
-        TransformValues(Options.get("TransformValues", 1)),
-        TransformReferences(Options.get("TransformReferences", 1)),
-        TransformPointersAsValues(Options.get("TransformPointersAsValues", 0)) {
-  }
+        AnalyzeValues(Options.get("AnalyzeValues", true)),
+        AnalyzeReferences(Options.get("AnalyzeReferences", true)),
+        WarnPointersAsValues(Options.get("WarnPointersAsValues", false)),
+        TransformValues(Options.get("TransformValues", true)),
+        TransformReferences(Options.get("TransformReferences", true)),
+        TransformPointersAsValues(
+            Options.get("TransformPointersAsValues", false)) {}
 
   // The rules for C and 'const' are different and incompatible for this check.
   bool isLanguageVersionSupported(const LangOptions &LangOpts) const override {


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D54943.404296.patch
Type: text/x-patch
Size: 1447 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20220129/12e5c9ac/attachment.bin>


More information about the cfe-commits mailing list