[clang-tools-extra] [clang-tidy] add modernize-use-constexpr check (PR #162741)
Victor Chernyakin via cfe-commits
cfe-commits at lists.llvm.org
Tue Dec 16 13:58:53 PST 2025
================
@@ -0,0 +1,72 @@
+.. title:: clang-tidy - modernize-use-constexpr
+
+modernize-use-constexpr
+=======================
+
+Finds functions and variables that can be declared ``constexpr``.
+
+This check currently supports the ``constexpr`` rule-set of C++11.
+
+The check analyses any function and variable according to the rules defined
+for the language version that the code compiles with.
+Changing to a newer language standard may therefore offer additional
+opportunities to declare a function or variable as ``constexpr``.
+Furthermore, this check can be incremental in terms of its diagnostics. For
+example, declaring a function ``constepxr`` might create new opportunities of
+marking additional variables or function ``constexpr``, which can only be found
----------------
localspook wrote:
```suggestion
example, declaring a function ``constepxr`` might create new opportunities for
marking additional variables or functions ``constexpr``, which can only be found
```
https://github.com/llvm/llvm-project/pull/162741
More information about the cfe-commits
mailing list