[clang-tools-extra] [clang-tidy] Adds readability-redundant-const check (PR #189733)

Baranov Victor via cfe-commits cfe-commits at lists.llvm.org
Sat Jul 11 06:45:00 PDT 2026


================
@@ -0,0 +1,44 @@
+.. title:: clang-tidy - readability-redundant-const
+
+readability-redundant-const
+===========================
+
+Detects redundant ``const`` specifiers on variable declarations.
+
+``constexpr`` variables are already implicitly ``const``, so adding an
+explicit ``const`` specifier is redundant.
+
+Examples:
+
+.. code-block:: c++
+
+   constexpr const int var = 10;  // redundant use of `const`
----------------
vbvictor wrote:

Nnit Please use 2-space indent for code.

https://github.com/llvm/llvm-project/pull/189733


More information about the cfe-commits mailing list