@@ -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
@@ -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
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 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
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 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
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
@@ -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
@@ -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
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
@@ -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 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
@@ -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 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
@@ -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 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
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/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
@@ -87,33 +94,54 @@ void
CapturingThisInMemberVariableCheck::registerMatchers(MatchFinder *Finder) {
// [self = this]
capturesVar(varDecl(hasInitializer(cxxThisExpr());
auto IsLambdaCapturingThis =
- lambdaExpr(hasAnyCapture(CaptureThis.bind("capture")))
@@ -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:
Some more real-world examples how it was before

and after

https://github.com/llvm/llvm-project/pul
https://github.com/vbvictor edited
https://github.com/llvm/llvm-project/pull/134375
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
=��___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
=��___
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/134375
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
=?utf-8?q?Björn?= Svensson
Message-ID:
In-Reply-To:
https://github.com/vbvictor commented:
I think we should provide an entry in `ReleaseNotes.rst` since the change
alters behavior of the check.
https://github.com/llvm/llvm-project/pull/135160
___
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 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
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 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:
@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
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
@@ -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
@@ -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
@@ -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
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
@@ -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
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
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 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
@@ -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
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.
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-
@@ -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 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
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
@@ -0,0 +1,36 @@
+.. title:: clang-tidy - bugprone-capturing-this-in-member-variable
+
+bugprone-capturing-this-in-member-variable
+==
+
+Finds lambda captures that capture the ``this`` pointer and store it as class
+members without handle t
@@ -0,0 +1,36 @@
+.. title:: clang-tidy - bugprone-capturing-this-in-member-variable
+
+bugprone-capturing-this-in-member-variable
+==
+
+Finds lambda captures that capture the ``this`` pointer and store it as class
+members without handle t
@@ -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 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/6] [clang-tidy] add scoped-lock-check
---
.../clang-tidy/mod
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
Paul =?utf-8?q?Heidekrüger?= ,
Paul =?utf-8?q?Heidekrüger?= ,
Paul =?utf-8?q?Heidekrüger?= ,
Paul =?utf-8?q?Heidekrüger?= ,
Paul =?utf-8?q?Heidekrüger?= ,
Paul =?utf-8?q?Heidekrüger?= ,
Paul =?utf-8?q?Heidekrüger?= ,
Paul =?utf-8?q?Heidekrüger?= ,
Paul =?utf-8?q?Heidekrüger?= ,
Paul =?utf-8?q?Heide
Paul =?utf-8?q?Heidekrüger?= ,
Paul =?utf-8?q?Heidekrüger?= ,
Paul =?utf-8?q?Heidekrüger?= ,
Paul =?utf-8?q?Heidekrüger?= ,
Paul =?utf-8?q?Heidekrüger?= ,
Paul =?utf-8?q?Heidekrüger?= ,
Paul =?utf-8?q?Heidekrüger?= ,
Paul =?utf-8?q?Heidekrüger?= ,
Paul =?utf-8?q?Heidekrüger?= ,
Paul =?utf-8?q?Heide
Paul =?utf-8?q?Heidekrüger?= ,
Paul =?utf-8?q?Heidekrüger?= ,
Paul =?utf-8?q?Heidekrüger?= ,
Paul =?utf-8?q?Heidekrüger?= ,
Paul =?utf-8?q?Heidekrüger?= ,
Paul =?utf-8?q?Heidekrüger?= ,
Paul =?utf-8?q?Heidekrüger?= ,
Paul =?utf-8?q?Heidekrüger?= ,
Paul =?utf-8?q?Heidekrüger?= ,
Paul =?utf-8?q?Heide
Paul =?utf-8?q?Heidekr=C3=BCger?= ,
Paul =?utf-8?q?Heidekr=C3=BCger?= ,
Paul =?utf-8?q?Heidekr=C3=BCger?= ,
Paul =?utf-8?q?Heidekr=C3=BCger?= ,
Paul =?utf-8?q?Heidekr=C3=BCger?= ,
Paul =?utf-8?q?Heidekr=C3=BCger?= ,
Paul =?utf-8?q?Heidekr=C3=BCger?= ,
Paul =?utf-8?q?Heidekr=C3=BCger?= ,
Paul =?utf-
Paul =?utf-8?q?Heidekrüger?= ,
Paul =?utf-8?q?Heidekrüger?= ,
Paul =?utf-8?q?Heidekrüger?= ,
Paul =?utf-8?q?Heidekrüger?= ,
Paul =?utf-8?q?Heidekrüger?= ,
Paul =?utf-8?q?Heidekrüger?= ,
Paul =?utf-8?q?Heidekrüger?= ,
Paul =?utf-8?q?Heidekrüger?= ,
Paul =?utf-8?q?Heidekrüger?= ,
Paul =?utf-8?q?Heide
Paul =?utf-8?q?Heidekrüger?= ,
Paul =?utf-8?q?Heidekrüger?= ,
Paul =?utf-8?q?Heidekrüger?= ,
Paul =?utf-8?q?Heidekrüger?= ,
Paul =?utf-8?q?Heidekrüger?= ,
Paul =?utf-8?q?Heidekrüger?= ,
Paul =?utf-8?q?Heidekrüger?= ,
Paul =?utf-8?q?Heidekrüger?= ,
Paul =?utf-8?q?Heidekrüger?= ,
Paul =?utf-8?q?Heide
https://github.com/vbvictor created
https://github.com/llvm/llvm-project/pull/135383
Add support for lambda-expression in `use-trailing-return-type` check.
Added two new options:
1. `TransformFunctions` will trigger function declarations to use trailing
return type. Values can be `true` or `fa
@@ -494,4 +554,75 @@ void UseTrailingReturnTypeCheck::check(const
MatchFinder::MatchResult &Result) {
<< FixItHint::CreateInsertion(InsertionLoc, " -> " + ReturnType);
}
+void UseTrailingReturnTypeCheck::diagOnLambda(
+const LambdaExpr *Lambda,
+const ast_matche
https://github.com/vbvictor converted_to_draft
https://github.com/llvm/llvm-project/pull/135383
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
vbvictor wrote:
Converted to draft to fix windows compilation
https://github.com/llvm/llvm-project/pull/135383
___
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/135383
>From 4a7cdb4a9f4de5503eba1488306e238b7334912a Mon Sep 17 00:00:00 2001
From: Victor Baranov
Date: Fri, 11 Apr 2025 20:26:49 +0300
Subject: [PATCH] [clang-tidy] add support for lambdas in
use-trailing-return-t
https://github.com/vbvictor edited
https://github.com/llvm/llvm-project/pull/135383
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/vbvictor ready_for_review
https://github.com/llvm/llvm-project/pull/135383
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -494,4 +554,75 @@ void UseTrailingReturnTypeCheck::check(const
MatchFinder::MatchResult &Result) {
<< FixItHint::CreateInsertion(InsertionLoc, " -> " + ReturnType);
}
+void UseTrailingReturnTypeCheck::diagOnLambda(
+const LambdaExpr *Lambda,
+const ast_matche
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
@@ -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
@@ -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 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 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-
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
@@ -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
@@ -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"
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
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
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
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
@@ -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 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/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
@@ -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(
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
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 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
@@ -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;
```
@@ -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
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
301 - 400 of 438 matches
Mail list logo