@@ -39,6 +39,17 @@ Or cast to char to explicitly indicate that output should be
a character.
std::cout << static_cast(v);
+Options
+---
+
+.. option:: WarnOnExplicitCast
+
+ When `WarnOnExplicitCast` is set to `false`, the check will not warn when
+ output of ostream
@@ -169,6 +172,7 @@ void ConstCorrectnessCheck::check(const
MatchFinder::MatchResult &Result) {
if (ArrayT->getElementType()->isPointerType())
VC = VariableCategory::Pointer;
}
+ llvm::errs() << (int)VC << "\n";
vbvictor wrote:
This also unintent
https://github.com/vbvictor updated
https://github.com/llvm/llvm-project/pull/132635
>From d9ccb7b48405fbe6831bf23e4357465a8ae83908 Mon Sep 17 00:00:00 2001
From: Victor Baranov
Date: Sun, 23 Mar 2025 23:57:15 +0300
Subject: [PATCH 1/3] [clang-tidy] Add support of `bind` function calls that
ca
https://github.com/vbvictor edited
https://github.com/llvm/llvm-project/pull/131969
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/vbvictor edited
https://github.com/llvm/llvm-project/pull/132573
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -163,7 +163,11 @@ Options
Semicolon-separated list of containers without their template parameters
and some ``emplace``-like method of the container. Example:
``vector::emplace_back``. Those methods will be checked for improper use
and
-the check will report
https://github.com/vbvictor updated
https://github.com/llvm/llvm-project/pull/126434
>From bc1b4ada7615d407c2df009f414d62da3857ee86 Mon Sep 17 00:00:00 2001
From: Victor Baranov
Date: Mon, 3 Mar 2025 09:25:03 +0300
Subject: [PATCH 01/10] [clang-tidy] add scoped-lock-check
---
.../clang-tidy/m
https://github.com/vbvictor edited
https://github.com/llvm/llvm-project/pull/132573
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -305,6 +320,36 @@ void UseEmplaceCheck::registerMatchers(MatchFinder
*Finder) {
this);
}
+static const CXXConstructExpr *unwrapToConstructorExpr(const Expr *E) {
+
vbvictor wrote:
```suggestion
```
Maybe excessive line
https://github.com/llvm/llvm-
https://github.com/vbvictor updated
https://github.com/llvm/llvm-project/pull/133694
>From 3f2086a843ccbc2dca5185199bbb91c366bcae06 Mon Sep 17 00:00:00 2001
From: Victor Baranov
Date: Mon, 31 Mar 2025 13:12:23 +0300
Subject: [PATCH 1/4] [clang-tidy] improve docs for various checks
---
.../che
@@ -1289,7 +1305,11 @@ void testBracedInitTemporaries() {
v2.push_back(NonTrivialWithVector{{0}});
v2.push_back({{0}});
v2.push_back(NonTrivialWithVector{std::vector{0}});
+ // CHECK-MESSAGES-CPP20: :[[@LINE-1]]:6: warning: use emplace_back instead
of push_back
vbvictor wrote:
Could anyone merge this please? Thank you
Hopefully default values of all check will be fixed with this commit:)
https://github.com/llvm/llvm-project/pull/133694
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm
https://github.com/vbvictor created
https://github.com/llvm/llvm-project/pull/134375
This PR add stacktrace of escaped exception to `bugprone-exception-escape`
check.
Changes:
1. Modified `ExceptionAnalyzer` and `ExceptionInfo` classes to hold stacktrace
of escaped exception in `llvm::SetVecto
https://github.com/vbvictor updated
https://github.com/llvm/llvm-project/pull/134375
>From 9865b1a58d03cb4ac721748da9ff710e8a21 Mon Sep 17 00:00:00 2001
From: Victor Baranov
Date: Fri, 4 Apr 2025 15:50:09 +0300
Subject: [PATCH] [clang-tidy] add stacktrace to exception-escape
---
.../bugpr
vbvictor wrote:
@HerrCai0907, Could you please merge this? Thank you
https://github.com/llvm/llvm-project/pull/132635
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -45,8 +45,8 @@ Options
A semicolon-separated list of qualified types which should not be allowed
to
persist across suspension points.
-Eg: ``my::lockable; a::b;::my::other::lockable;``
-The default value of this option is `"std::lock_guard;std::scoped_lock"
https://github.com/vbvictor updated
https://github.com/llvm/llvm-project/pull/133694
>From 3f2086a843ccbc2dca5185199bbb91c366bcae06 Mon Sep 17 00:00:00 2001
From: Victor Baranov
Date: Mon, 31 Mar 2025 13:12:23 +0300
Subject: [PATCH 1/3] [clang-tidy] improve docs for various checks
---
.../che
@@ -45,8 +45,8 @@ Options
A semicolon-separated list of qualified types which should not be allowed
to
persist across suspension points.
-Eg: ``my::lockable; a::b;::my::other::lockable;``
-The default value of this option is `"std::lock_guard;std::scoped_lock"
https://github.com/vbvictor updated
https://github.com/llvm/llvm-project/pull/133694
>From 3f2086a843ccbc2dca5185199bbb91c366bcae06 Mon Sep 17 00:00:00 2001
From: Victor Baranov
Date: Mon, 31 Mar 2025 13:12:23 +0300
Subject: [PATCH 1/2] [clang-tidy] improve docs for various checks
---
.../che
https://github.com/vbvictor created
https://github.com/llvm/llvm-project/pull/133694
Improved "options" sections of various checks:
1. Added Options keyword to be a delimiter between "body" and "options" parts
of docs
2. Added default values where were absent.
3. Changed double-tick to single-
@@ -0,0 +1,40 @@
+// RUN: %check_clang_tidy %s bugprone-unintended-char-ostream-output %t
-check-suffix=WARN-EXPLICIT-CAST
+// RUN: %check_clang_tidy %s bugprone-unintended-char-ostream-output %t \
+// RUN: -config='{CheckOptions: { \
+// RUN: bugprone-unintended-char-ost
https://github.com/vbvictor edited
https://github.com/llvm/llvm-project/pull/133639
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -39,6 +39,17 @@ Or cast to char to explicitly indicate that output should be
a character.
std::cout << static_cast(v);
+Options
vbvictor wrote:
Could you please rebase on fresh main, this must be added by
https://github.com/llvm/llvm-project/commit/52
@@ -305,6 +320,36 @@ void UseEmplaceCheck::registerMatchers(MatchFinder
*Finder) {
this);
}
+static const CXXConstructExpr *unwrapToConstructorExpr(const Expr *E) {
+
+ while (E) {
+
vbvictor wrote:
```suggestion
```
https://github.com/llvm/llvm-proj
https://github.com/vbvictor updated
https://github.com/llvm/llvm-project/pull/133525
>From 9b88fc69e06d08fd06b60af24b5a9c12749185ef Mon Sep 17 00:00:00 2001
From: Victor Baranov
Date: Sat, 29 Mar 2025 00:46:22 +0300
Subject: [PATCH 1/3] improve docs options of `bugprone-` and `modernize-`
chec
https://github.com/vbvictor edited
https://github.com/llvm/llvm-project/pull/133639
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
vbvictor wrote:
@carlosgalvezp, Can you please help land this PR? Thank you
https://github.com/llvm/llvm-project/pull/133525
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/vbvictor edited
https://github.com/llvm/llvm-project/pull/131969
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -1285,11 +1289,9 @@ void testBracedInitTemporaries() {
// These should not be noticed or fixed; after the correction, the code won't
- // compile.
+ // compile in version previous to C++20.
vbvictor wrote:
This is not needed anymore since those cases
@@ -39,6 +39,17 @@ Or cast to char to explicitly indicate that output should be
a character.
std::cout << static_cast(v);
+Options
+---
+
+.. option:: WarnOnExplicitCast
+
+ When `WarnOnExplicitCast` is set to `false`, the check will not warn when
+ output of ostream
@@ -39,6 +39,17 @@ Or cast to char to explicitly indicate that output should be
a character.
std::cout << static_cast(v);
+Options
+---
+
+.. option:: WarnOnExplicitCast
+
+ When `WarnOnExplicitCast` is set to `false`, the check will not warn when
+ output of ostream
@@ -163,7 +163,11 @@ Options
Semicolon-separated list of containers without their template parameters
and some ``emplace``-like method of the container. Example:
``vector::emplace_back``. Those methods will be checked for improper use
and
-the check will report
@@ -163,7 +163,11 @@ Options
Semicolon-separated list of containers without their template parameters
and some ``emplace``-like method of the container. Example:
``vector::emplace_back``. Those methods will be checked for improper use
and
-the check will report
@@ -53,4 +53,4 @@ Options
If set to non-zero, the check does not suggest edits that will transform
vbvictor wrote:
yes, thanks for the notice
https://github.com/llvm/llvm-project/pull/133525
___
cfe-commits maili
https://github.com/vbvictor updated
https://github.com/llvm/llvm-project/pull/133525
>From 9b88fc69e06d08fd06b60af24b5a9c12749185ef Mon Sep 17 00:00:00 2001
From: Victor Baranov
Date: Sat, 29 Mar 2025 00:46:22 +0300
Subject: [PATCH 1/2] improve docs options of `bugprone-` and `modernize-`
chec
https://github.com/vbvictor created
https://github.com/llvm/llvm-project/pull/133525
Improved "options" sections of `bugprone-` and `modernize-` checks:
1. Added `Options` keyword to be a delimiter between "body" and "options" parts
of docs
2. Added default values where was absent.
3. Improved
vbvictor wrote:
@PiotrZSL, Ping
https://github.com/llvm/llvm-project/pull/126434
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/vbvictor updated
https://github.com/llvm/llvm-project/pull/131455
>From 0b98489770f380f209d7b7a0a9223dd80c782478 Mon Sep 17 00:00:00 2001
From: Victor Baranov
Date: Sat, 15 Mar 2025 17:36:23 +0300
Subject: [PATCH 1/2] add new construct-reusable-objects-once check
---
.../cl
@@ -305,6 +320,38 @@ void UseEmplaceCheck::registerMatchers(MatchFinder
*Finder) {
this);
}
+const Expr *unwrapInnerExpression(const Expr *E) {
vbvictor wrote:
This function should be made `static` to restrict visibility
https://github.com/llvm/llvm-p
@@ -305,6 +320,38 @@ void UseEmplaceCheck::registerMatchers(MatchFinder
*Finder) {
this);
}
+const Expr *unwrapInnerExpression(const Expr *E) {
+
+ while (true) {
vbvictor wrote:
you could write `while(E)` and get rid of if
```cpp
if (!E)
break;
vbvictor wrote:
@PiotrZSL, could you please merge this PR when you have time, thank you.
https://github.com/llvm/llvm-project/pull/132573
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commit
https://github.com/vbvictor commented:
Few nits.
Thought, I'm not very familiar this kind of AST-matchers and PR needs review
from someone else.
https://github.com/llvm/llvm-project/pull/131969
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
h
vbvictor wrote:
@carlosgalvezp, when all checks are passed, could you merge this please, thank
you.
https://github.com/llvm/llvm-project/pull/133436
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinf
https://github.com/vbvictor created
https://github.com/llvm/llvm-project/pull/133436
Improve docs for `bugprone-argument-comment` check by writing explicitly
default values for options.
Before this change, it was unclear what values are default.
>From 916062c02019d805f94f494e9ded33c0f40462e2 M
https://github.com/vbvictor edited
https://github.com/llvm/llvm-project/pull/131969
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -1289,7 +1305,11 @@ void testBracedInitTemporaries() {
v2.push_back(NonTrivialWithVector{{0}});
v2.push_back({{0}});
v2.push_back(NonTrivialWithVector{std::vector{0}});
+ // CHECK-MESSAGES-CPP20: :[[@LINE-1]]:6: warning: use emplace_back instead
of push_back
https://github.com/vbvictor edited
https://github.com/llvm/llvm-project/pull/126434
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -332,19 +380,44 @@ void UseEmplaceCheck::check(const
MatchFinder::MatchResult &Result) {
}();
assert(Call && "No call matched");
- assert((CtorCall || MakeCall) && "No push_back parameter matched");
+ assert((CtorCall || MakeCall || AggInitCall) &&
+ "No push
@@ -305,6 +320,38 @@ void UseEmplaceCheck::registerMatchers(MatchFinder
*Finder) {
this);
}
+const Expr *unwrapInnerExpression(const Expr *E) {
+
+ while (true) {
vbvictor wrote:
you could write `while(E)` and get rid of if
```cpp
if (!E)
break;
```
https://github.com/vbvictor deleted
https://github.com/llvm/llvm-project/pull/131969
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/vbvictor edited
https://github.com/llvm/llvm-project/pull/131969
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -0,0 +1,342 @@
+//===--- UseScopedLockCheck.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
https://github.com/vbvictor deleted
https://github.com/llvm/llvm-project/pull/131969
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -1289,7 +1305,11 @@ void testBracedInitTemporaries() {
v2.push_back(NonTrivialWithVector{{0}});
v2.push_back({{0}});
v2.push_back(NonTrivialWithVector{std::vector{0}});
+ // CHECK-MESSAGES-CPP20: :[[@LINE-1]]:6: warning: use emplace_back instead
of push_back
@@ -161,6 +163,7 @@ void ConstCorrectnessCheck::check(const
MatchFinder::MatchResult &Result) {
VariableCategory VC = VariableCategory::Value;
const QualType VT = Variable->getType();
+ VT->dump();
vbvictor wrote:
Is this left unintentionally?
https://
vbvictor wrote:
> maybe we should mention it in check's doc also.
Added mention of this behavior in docs.
https://github.com/llvm/llvm-project/pull/132543
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/
https://github.com/vbvictor updated
https://github.com/llvm/llvm-project/pull/132543
>From 814972e0398507a5137a1ee6c69e7bba3704eb6b Mon Sep 17 00:00:00 2001
From: Victor Baranov
Date: Sat, 22 Mar 2025 14:39:43 +0300
Subject: [PATCH 1/2] [clang-tidy] Fix false positives in
crtp-constructor-acce
@@ -87,33 +94,54 @@ void
CapturingThisInMemberVariableCheck::registerMatchers(MatchFinder *Finder) {
// [self = this]
capturesVar(varDecl(hasInitializer(cxxThisExpr());
auto IsLambdaCapturingThis =
- lambdaExpr(hasAnyCapture(CaptureThis.bind("capture")))
https://github.com/vbvictor updated
https://github.com/llvm/llvm-project/pull/132635
>From c91ad611e7a64b08a243a4a7f07a7f51e96b8ac0 Mon Sep 17 00:00:00 2001
From: Victor Baranov
Date: Sun, 23 Mar 2025 23:57:15 +0300
Subject: [PATCH 1/3] [clang-tidy] Add support of `bind` function calls that
ca
@@ -64,16 +64,21 @@ AST_MATCHER(CXXRecordDecl, correctHandleCaptureThisLambda) {
constexpr const char *DefaultFunctionWrapperTypes =
"::std::function;::std::move_only_function;::boost::function";
+constexpr const char *DefaultBindFunctions = "::std::bind;::boost::bind";
--
https://github.com/vbvictor updated
https://github.com/llvm/llvm-project/pull/132635
>From c91ad611e7a64b08a243a4a7f07a7f51e96b8ac0 Mon Sep 17 00:00:00 2001
From: Victor Baranov
Date: Sun, 23 Mar 2025 23:57:15 +0300
Subject: [PATCH 1/2] [clang-tidy] Add support of `bind` function calls that
ca
https://github.com/vbvictor created
https://github.com/llvm/llvm-project/pull/132635
Improve `bugprone-capturing-this-in-member-variable` check:
Added support of `bind`-like functions that capture and store `this` pointer in
class member.
Closes https://github.com/llvm/llvm-project/issues/1312
https://github.com/vbvictor created
https://github.com/llvm/llvm-project/pull/132573
Based on C++ standard (see issue
https://github.com/llvm/llvm-project/issues/131679) and
[StackOverflow](https://stackoverflow.com/questions/22794382/are-c11-thread-local-variables-automatically-static)
`thre
@@ -0,0 +1,342 @@
+//===--- UseScopedLockCheck.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
@@ -159,8 +159,8 @@ Changes in existing checks
- Improved :doc:`modernize-use-default-member-init
` check by matching
- ``constexpr`` and ``static``` values on member initialization and by
detecting
- explicit casting of built-in types within member list initialization.
+
@@ -159,8 +159,8 @@ Changes in existing checks
- Improved :doc:`modernize-use-default-member-init
` check by matching
- ``constexpr`` and ``static``` values on member initialization and by
detecting
- explicit casting of built-in types within member list initialization.
+
https://github.com/vbvictor updated
https://github.com/llvm/llvm-project/pull/129564
>From e72ae0e2ee12265ec69b0c5ff726261eb7466caa Mon Sep 17 00:00:00 2001
From: Victor Baranov
Date: Sat, 22 Mar 2025 13:29:20 +0300
Subject: [PATCH] [clang-tidy] fixed false positives on find and rfind
---
...
https://github.com/vbvictor created
https://github.com/llvm/llvm-project/pull/132543
Fix false positives in `bugprone-crtp-constructor-accessibility` check on
deleted constructors that cannot be used to construct objects, even if they
have public or protected access.
Closes https://github.com
vbvictor wrote:
Rebase and PR-checks are done, ready to merge
https://github.com/llvm/llvm-project/pull/129564
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/vbvictor updated
https://github.com/llvm/llvm-project/pull/126434
>From bc1b4ada7615d407c2df009f414d62da3857ee86 Mon Sep 17 00:00:00 2001
From: Victor Baranov
Date: Mon, 3 Mar 2025 09:25:03 +0300
Subject: [PATCH 01/11] [clang-tidy] add scoped-lock-check
---
.../clang-tidy/m
@@ -0,0 +1,342 @@
+//===--- UseScopedLockCheck.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
vbvictor wrote:
Since commit access request takes time than I expected, could you please merge
this PR, @nicovank?
Thank you in advance
https://github.com/llvm/llvm-project/pull/129564
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://li
@@ -1,4 +1,4 @@
-// RUN: %check_clang_tidy %s modernize-use-emplace %t -- \
+// RUN: %check_clang_tidy %s -std=c++17 modernize-use-emplace %t -- \
vbvictor wrote:
check has `LangOpts.CPlusPlus11`, so this need to be removed
```suggestion
// RUN: %check_clang_tidy
https://github.com/vbvictor updated
https://github.com/llvm/llvm-project/pull/126434
>From bc1b4ada7615d407c2df009f414d62da3857ee86 Mon Sep 17 00:00:00 2001
From: Victor Baranov
Date: Mon, 3 Mar 2025 09:25:03 +0300
Subject: [PATCH 1/9] [clang-tidy] add scoped-lock-check
---
.../clang-tidy/mod
https://github.com/vbvictor edited
https://github.com/llvm/llvm-project/pull/126434
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/vbvictor edited
https://github.com/llvm/llvm-project/pull/126434
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -0,0 +1,342 @@
+//===--- UseScopedLockCheck.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
https://github.com/vbvictor edited
https://github.com/llvm/llvm-project/pull/126434
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -0,0 +1,342 @@
+//===--- UseScopedLockCheck.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
@@ -202,19 +202,36 @@ void UseEmplaceCheck::registerMatchers(MatchFinder
*Finder) {
// overloaded functions and template names.
auto SoughtConstructExpr =
cxxConstructExpr(
- unless(anyOf(IsCtorOfSmartPtr, HasInitList, BitFieldAsArgument,
-
vbvictor wrote:
@PiotrZSL Ping
https://github.com/llvm/llvm-project/pull/126434
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
vbvictor wrote:
> Do you know how much build times and binary size are affected by this change?
Binary size comparison was addressed in discussion on previous PR, here is
comment for reference
https://github.com/llvm/llvm-project/pull/123734#discussion_r1925090946.
However, this may have chang
@@ -19,16 +19,22 @@ namespace clang::tidy::bugprone {
namespace {
-AST_MATCHER(EnumDecl, isCompleteAndHasNoZeroValue) {
+AST_MATCHER(EnumDecl, isCompleteNonEmptyAndHasNoZeroValue) {
const EnumDecl *Definition = Node.getDefinition();
return Definition && Node.isComplete(
@@ -0,0 +1,86 @@
+// RUN: %check_clang_tidy %s -std=c++20 modernize-use-emplace %t -- \
+// RUN: -config="{CheckOptions: \
+// RUN: {modernize-use-emplace.ContainersWithPushBack: \
+// RUN:'::std::vector; ::std::list; ::std::deque;
llvm::LikeASmallVe
@@ -0,0 +1,86 @@
+// RUN: %check_clang_tidy %s -std=c++20 modernize-use-emplace %t -- \
vbvictor wrote:
Consider mergin this file `use-emplace.cpp` using 2 RUN commands with specified
custom suffix. This will remove unnecessary deplication of `vector` and
`init
https://github.com/vbvictor edited
https://github.com/llvm/llvm-project/pull/131804
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -0,0 +1,50 @@
+#include "../ClangTidy.h"
+#include "../ClangTidyModule.h"
+#include "../ClangTidyModuleRegistry.h"
+#include "../ClangTidyOptions.h"
+#include "QueryCheck.h"
+#include "llvm/ADT/SmallSet.h"
+#include "llvm/ADT/SmallString.h"
+#include "llvm/ADT/StringRef.h"
+#in
https://github.com/vbvictor created
https://github.com/llvm/llvm-project/pull/131669
Improve `readability-function-size` by counting class member initializers as
statements.
Relates to
https://github.com/llvm/llvm-project/issues/131126#issuecomment-2725906714.
This PR in draft state until htt
https://github.com/vbvictor updated
https://github.com/llvm/llvm-project/pull/126434
>From bc1b4ada7615d407c2df009f414d62da3857ee86 Mon Sep 17 00:00:00 2001
From: Victor Baranov
Date: Mon, 3 Mar 2025 09:25:03 +0300
Subject: [PATCH 1/8] [clang-tidy] add scoped-lock-check
---
.../clang-tidy/mod
@@ -72,3 +72,9 @@ can be either ``char* argv[]`` or ``char** argv``, but cannot
be
.. code:: c++
const char name[] = "Some name";
+
+.. option:: CheckSugaredTypes
+
+ When set to `true` (default is `false`), type aliases, decltypes as well as
vbvictor
https://github.com/vbvictor converted_to_draft
https://github.com/llvm/llvm-project/pull/131455
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
vbvictor wrote:
Thank you for the fast feedback.
As for general approach, I will limit the usage to classes that are marked
`const` and provide reference to `misc-const-correctness` in docs. Also, I will
add support for initializer-list constructors.
However, I think we should not give warning
@@ -0,0 +1,326 @@
+//===--- UseScopedLockCheck.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,102 @@
+.. title:: clang-tidy - modernize-use-scoped-lock
+
+modernize-use-scoped-lock
+=
+
+Finds uses of ``std::lock_guard`` and suggests replacing them with C++17's
+alternative ``std::scoped_lock``. The check will automatically transform only
https://github.com/vbvictor created
https://github.com/llvm/llvm-project/pull/130626
1. Fixed ordering to be alphabetical
2. Made lines no more than 80 characters long
3. Fixed typos
>From 2add09ddbc3cdeeb77257170de9f349bf3a47b94 Mon Sep 17 00:00:00 2001
From: Victor Baranov
Date: Mon, 10 Mar
@@ -136,6 +136,10 @@ Changes in existing checks
` check by updating suppress
warnings logic for ``nullptr`` in ``std::find``.
+- Improved :doc:`modernize-use-std-numbers
+ ` check to support math
functions
vbvictor wrote:
Please make lines no more than
https://github.com/vbvictor updated
https://github.com/llvm/llvm-project/pull/126434
>From 45d80294dd6fdab4bd85d51b0f952b515486bc8b Mon Sep 17 00:00:00 2001
From: Victor Baranov
Date: Mon, 3 Mar 2025 09:25:03 +0300
Subject: [PATCH 1/4] [clang-tidy] add scoped-lock-check
---
.../clang-tidy/mod
@@ -0,0 +1,124 @@
+//===--- CapturingThisInMemberVariableCheck.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
https://github.com/vbvictor updated
https://github.com/llvm/llvm-project/pull/131455
>From 0b98489770f380f209d7b7a0a9223dd80c782478 Mon Sep 17 00:00:00 2001
From: Victor Baranov
Date: Sat, 15 Mar 2025 17:36:23 +0300
Subject: [PATCH] add new construct-reusable-objects-once check
---
.../clang-
https://github.com/vbvictor created
https://github.com/llvm/llvm-project/pull/131455
New check to find variable declarations of expensive-to-construct classes that
are constructed from only constant literals and so can be reused to avoid
repeated construction costs on each function invocation.
1 - 100 of 360 matches
Mail list logo