[PATCH] D145856: [clang-tidy] Let misc-const-correctness detect auto local variables that can be made const

2023-03-11 Thread Chris Thrasher via Phabricator via cfe-commits
ChrisThrasher created this revision.
ChrisThrasher added a reviewer: JonasToth.
Herald added subscribers: PiotrZSL, carlosgalvezp, xazax.hun.
Herald added a reviewer: njames93.
Herald added a project: All.
ChrisThrasher requested review of this revision.
Herald added a project: clang-tools-extra.
Herald added a subscriber: cfe-commits.

Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D145856

Files:
  clang-tools-extra/clang-tidy/misc/ConstCorrectnessCheck.cpp


Index: clang-tools-extra/clang-tidy/misc/ConstCorrectnessCheck.cpp
===
--- clang-tools-extra/clang-tidy/misc/ConstCorrectnessCheck.cpp
+++ clang-tools-extra/clang-tidy/misc/ConstCorrectnessCheck.cpp
@@ -73,9 +73,9 @@
   
hasType(referenceType(pointee(hasCanonicalType(templateTypeParmType(),
   hasType(referenceType(pointee(substTemplateTypeParmType();
 
-  const auto AutoTemplateType = varDecl(
-  anyOf(hasType(autoType()), hasType(referenceType(pointee(autoType(,
-hasType(pointerType(pointee(autoType());
+  const auto AutoTemplateType =
+  varDecl(anyOf(hasType(referenceType(pointee(autoType(,
+hasType(pointerType(pointee(autoType());
 
   const auto FunctionPointerRef =
   hasType(hasCanonicalType(referenceType(pointee(functionType();


Index: clang-tools-extra/clang-tidy/misc/ConstCorrectnessCheck.cpp
===
--- clang-tools-extra/clang-tidy/misc/ConstCorrectnessCheck.cpp
+++ clang-tools-extra/clang-tidy/misc/ConstCorrectnessCheck.cpp
@@ -73,9 +73,9 @@
   hasType(referenceType(pointee(hasCanonicalType(templateTypeParmType(),
   hasType(referenceType(pointee(substTemplateTypeParmType();
 
-  const auto AutoTemplateType = varDecl(
-  anyOf(hasType(autoType()), hasType(referenceType(pointee(autoType(,
-hasType(pointerType(pointee(autoType());
+  const auto AutoTemplateType =
+  varDecl(anyOf(hasType(referenceType(pointee(autoType(,
+hasType(pointerType(pointee(autoType());
 
   const auto FunctionPointerRef =
   hasType(hasCanonicalType(referenceType(pointee(functionType();
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D145856: [clang-tidy] Let misc-const-correctness detect auto local variables that can be made const

2023-03-12 Thread Chris Thrasher via Phabricator via cfe-commits
ChrisThrasher added a comment.

I'm working on the test failures and improved test coverage. Where can I learn 
more about how to update the release notes and documentation?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D145856

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits