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

Richard via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Jan 31 10:41:56 PST 2022


LegalizeAdulthood added inline comments.


================
Comment at: clang-tools-extra/test/clang-tidy/checkers/cppcoreguidelines-const-correctness-templates.cpp:16
+  int value_int = 42;
+  // CHECK-MESSAGES:[[@LINE-1]]:3: warning: variable 'value_int' of type 'int' can be declared 'const'
+}
----------------
`CHECK-FIXES`?


================
Comment at: clang-tools-extra/test/clang-tidy/checkers/cppcoreguidelines-const-correctness-transform-pointer-as-values.cpp:12
+  // CHECK-MESSAGES: [[@LINE-1]]:3: warning: variable 'p_local0' of type 'double *' can be declared 'const'
+  // CHECK-FIXES: const
+}
----------------
Shouldn't this validate that the `const` was placed in the correct position?
e.g. `const double *` is a different meaning from `double *const`

Apply to all the other `CHECK-FIXES` as well


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D54943



More information about the cfe-commits mailing list