carlosgalvezp wrote:
I'm ok with modernize-use-constexpr as well!
https://github.com/llvm/llvm-project/pull/146553
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -270,6 +270,10 @@ Changes in existing checks
excluding variables with ``thread_local`` storage class specifier from being
matched.
+- Added :doc:`modernize-use-constexpr
vbvictor wrote:
Also, synced with first sentence in docs.
https://github.com/llvm
@@ -270,6 +270,10 @@ Changes in existing checks
excluding variables with ``thread_local`` storage class specifier from being
matched.
+- Added :doc:`modernize-use-constexpr
vbvictor wrote:
This should be placed under "New checks" section
https://github.c
@@ -0,0 +1,562 @@
+// RUN: %check_clang_tidy -std=c++11 -check-suffix=11 %s misc-use-constexpr %t
-- -- -fno-delayed-template-parsing
+// RUN: %check_clang_tidy -std=c++14 -check-suffix=11,14 %s misc-use-constexpr
%t -- -- -fno-delayed-template-parsing
+// RUN: %check_clang_tidy
@@ -0,0 +1,562 @@
+// RUN: %check_clang_tidy -std=c++11 -check-suffix=11 %s misc-use-constexpr %t
-- -- -fno-delayed-template-parsing
+// RUN: %check_clang_tidy -std=c++14 -check-suffix=11,14 %s misc-use-constexpr
%t -- -- -fno-delayed-template-parsing
+// RUN: %check_clang_tidy
vbvictor wrote:
I'm +1 on the `modernize-use-constexpr`.
https://github.com/llvm/llvm-project/pull/146553
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -0,0 +1,562 @@
+// RUN: %check_clang_tidy -std=c++11 -check-suffix=11 %s misc-use-constexpr %t
-- -- -fno-delayed-template-parsing
+// RUN: %check_clang_tidy -std=c++14 -check-suffix=11,14 %s misc-use-constexpr
%t -- -- -fno-delayed-template-parsing
+// RUN: %check_clang_tidy
@@ -0,0 +1,562 @@
+// RUN: %check_clang_tidy -std=c++11 -check-suffix=11 %s misc-use-constexpr %t
-- -- -fno-delayed-template-parsing
+// RUN: %check_clang_tidy -std=c++14 -check-suffix=11,14 %s misc-use-constexpr
%t -- -- -fno-delayed-template-parsing
+// RUN: %check_clang_tidy
denzor200 wrote:
`constexpr` is one of the important additions of C++11. Most of the users will
search this check in "modernize" section and will be misled by not finding it
there.
"misc-const-correctness" - not a modernize check at all, it even relevant for
C++98, so it exists in "misc"
htt
@@ -0,0 +1,946 @@
+//===--- UseConstexprCheck.cpp -
clang-tidy===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM
Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Ap
@@ -0,0 +1,946 @@
+//===--- UseConstexprCheck.cpp -
clang-tidy===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM
Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Ap
@@ -0,0 +1,946 @@
+//===--- UseConstexprCheck.cpp -
clang-tidy===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM
Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Ap
@@ -0,0 +1,946 @@
+//===--- UseConstexprCheck.cpp -
clang-tidy===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM
Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Ap
@@ -0,0 +1,946 @@
+//===--- UseConstexprCheck.cpp -
clang-tidy===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM
Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Ap
@@ -43,6 +44,7 @@ class MiscModule : public ClangTidyModule {
"misc-confusable-identifiers");
CheckFactories.registerCheck(
"misc-const-correctness");
+CheckFactories.registerCheck("misc-use-constexpr");
vbvictor wrote:
ditto
https://g
@@ -19,6 +19,7 @@ set_target_properties(genconfusable PROPERTIES FOLDER "Clang
Tools Extra/Sourceg
add_clang_library(clangTidyMiscModule STATIC
ConstCorrectnessCheck.cpp
+ UseConstexprCheck.cpp
vbvictor wrote:
Please fix ordering
https://github.com/llvm/
github-actions[bot] wrote:
:warning: C/C++ code formatter, clang-format found issues in your code.
:warning:
You can test this locally with the following command:
``bash
git-clang-format --diff HEAD~1 HEAD --extensions h,cpp --
clang-tools-extra/clang-tidy/misc/ConstexprCheck.cp
5chmidti wrote:
> > misc-use-constexpr? :)
>
> modernize-use-constexpr?
Hm. It is indeed also a modernization... +- on which to pick. Let's see what
others think.
On one hand, the modernize checks have
- modernize-use-auto
- modernize-use-nodiscard
- modernize-use-noexcept
- modernize-use-over
llvmbot wrote:
@llvm/pr-subscribers-clang-tools-extra
Author: Julian Schmidt (5chmidti)
Changes
This check finds all functions and variables that can be declared as
`constexpr`, using the specified standard version to check if the
requirements are met.
Fixes #115622
---
Patch is 95.12
https://github.com/5chmidti updated
https://github.com/llvm/llvm-project/pull/146553
>From 16d5a3fb942673d1fda0ef4b17363a0b5d634fbb Mon Sep 17 00:00:00 2001
From: Julian Schmidt
Date: Fri, 6 Sep 2024 22:58:46 +0200
Subject: [PATCH] [clang-tidy] add misc-constexpr check
This check finds all fun
carlosgalvezp wrote:
misc-use-constexpr? :)
https://github.com/llvm/llvm-project/pull/146553
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/5chmidti updated
https://github.com/llvm/llvm-project/pull/146553
>From 8d354249e8c28fb2a83f90479cc74e41be2d58be Mon Sep 17 00:00:00 2001
From: Julian Schmidt
Date: Fri, 6 Sep 2024 22:58:46 +0200
Subject: [PATCH] [clang-tidy] add misc-constexpr check
This check finds all fun
https://github.com/5chmidti updated
https://github.com/llvm/llvm-project/pull/146553
>From 2a50c3ef9aed91488a5650b8f3719fc338db7a49 Mon Sep 17 00:00:00 2001
From: Julian Schmidt
Date: Fri, 6 Sep 2024 22:58:46 +0200
Subject: [PATCH] [clang-tidy] add misc-constexpr check
This check finds all fun
denzor200 wrote:
> misc-use-constexpr? :)
modernize-use-constexpr?
https://github.com/llvm/llvm-project/pull/146553
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
5chmidti wrote:
I ran this check on all of `clang/` and `clang-tools-extra/` and got no
compilation errors from too aggressively changing things to `constexpr`.
Some perf info from running the checks enabled in LLVM + this check:
Running on: `clang/lib/Sema/SemaExprCXX.cpp` (1 diag):
```text
=
llvmbot wrote:
@llvm/pr-subscribers-clang-tidy
Author: Julian Schmidt (5chmidti)
Changes
This check finds all functions and variables that can be declared as
`constexpr`, using the specified standard version to check if the
requirements are met.
Fixes #115622
---
Patch is 95.12 KiB, tr
https://github.com/5chmidti created
https://github.com/llvm/llvm-project/pull/146553
This check finds all functions and variables that can be declared as
`constexpr`, using the specified standard version to check if the
requirements are met.
Fixes #115622
>From 35a081fba2d15ee9f4ae825928e5411
27 matches
Mail list logo