[clang-tools-extra] [clang-tidy] add new check: modernize-use-scoped-lock (PR #126434)

2025-07-18 Thread Baranov Victor via 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

[clang-tools-extra] [clang-tidy] add new check: modernize-use-scoped-lock (PR #126434)

2025-07-18 Thread Baranov Victor via cfe-commits
@@ -0,0 +1,471 @@ +// RUN: %check_clang_tidy -std=c++17-or-later %s modernize-use-scoped-lock %t -- -- -isystem %clang_tidy_headers -fno-delayed-template-parsing + +#include + +void Positive() { + std::mutex m; + { +std::lock_guard l(m); +// CHECK-MESSAGES: :[[@LINE-1]

[clang-tools-extra] [clang-tidy] add new check: modernize-use-scoped-lock (PR #126434)

2025-07-18 Thread Baranov Victor via cfe-commits
@@ -0,0 +1,471 @@ +// RUN: %check_clang_tidy -std=c++17-or-later %s modernize-use-scoped-lock %t -- -- -isystem %clang_tidy_headers -fno-delayed-template-parsing + +#include + +void Positive() { + std::mutex m; + { +std::lock_guard l(m); +// CHECK-MESSAGES: :[[@LINE-1]

[clang-tools-extra] [clang-tidy] add modernize-use-constexpr check (PR #146553)

2025-07-17 Thread Baranov Victor via cfe-commits
@@ -0,0 +1,972 @@ +//===--- 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

[clang-tools-extra] [clang-tidy] add modernize-use-constexpr check (PR #146553)

2025-07-17 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor commented: Gave this a very rought look, so only a couple of general questions/suggestions. Could we do something with methods that repeat in some of the visitors, e.g. `bool TraverseType(QualType QT)` and others. Maybe macros..? I can't think of a better idea right

[clang-tools-extra] [clang-tidy] add modernize-use-constexpr check (PR #146553)

2025-07-17 Thread Baranov Victor via cfe-commits
@@ -0,0 +1,972 @@ +//===--- 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

[clang-tools-extra] [clang-tidy] add modernize-use-constexpr check (PR #146553)

2025-07-17 Thread Baranov Victor via cfe-commits
@@ -0,0 +1,972 @@ +//===--- 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

[clang-tools-extra] [clang-tidy] add modernize-use-constexpr check (PR #146553)

2025-07-17 Thread Baranov Victor via cfe-commits
@@ -0,0 +1,972 @@ +//===--- 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

[clang-tools-extra] [clang-tidy] add modernize-use-constexpr check (PR #146553)

2025-07-17 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor edited 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

[clang-tools-extra] [clang-tools-extra][NFC] Fix link to code review in README.txt (PR #148384)

2025-07-17 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor closed https://github.com/llvm/llvm-project/pull/148384 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy][NFC] Add mention of running 'clang-tidy' on changes in Contributing.rst (PR #148547)

2025-07-17 Thread Baranov Victor via cfe-commits
vbvictor wrote: > Clang-Tidy pull requests are usually small, so is `-j` really necessary? Do you have anything against `-j` anymore? Otherwise, I'd merge this PR https://github.com/llvm/llvm-project/pull/148547 ___ cfe-commits mailing list cfe-commit

[clang-tools-extra] [clang-tidy][NFC] Enable 'performance-move-const-arg' in '.clang-tidy' config (PR #148549)

2025-07-17 Thread Baranov Victor via cfe-commits
vbvictor wrote: > Are they really need to "std::move" in the patch? I think `MixData` is > meaningless since it is still need to copy all field. Do you mean with `CheckTriviallyCopyableMove` set to `true`? Technically, there would probably be no performance benefit. However, from author's poin

[clang-tools-extra] Cleanout clang-tools-extra ReleaseNotes (PR #149306)

2025-07-17 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor approved this pull request. LGTM, Maybe better commit name will be "[clang-tools-extra] Bump ReleaseNotes to 22.0.0git" https://github.com/llvm/llvm-project/pull/149306 ___ cfe-commits mailing list cfe-commits@lists.llvm.or

[clang-tools-extra] [clang-tidy] Add MLIR check for old op builder usage. (PR #149148)

2025-07-17 Thread Baranov Victor via cfe-commits
vbvictor wrote: > Something like > https://github.com/llvm/llvm-project/compare/main...jpienaar:llvm-project:cleanout?expand=1 Looks good, that must be the patch needed. https://github.com/llvm/llvm-project/pull/149148

[clang-tools-extra] [clang-tidy] Add MLIR check for old op builder usage. (PR #149148)

2025-07-17 Thread Baranov Victor via cfe-commits
vbvictor wrote: Yes, Tobias didn't have time to make a PR with cleaning release notes. https://discord.com/channels/636084430946959380/654052269301694465/1394963436538040421. At this time of the week, I can't either:( We shouldn't merge anything before release n

[clang] [clang-tools-extra] [clang-tidy] bugprone-infinite-loop: Add support for tuple structured bindings (PR #147410)

2025-07-16 Thread Baranov Victor via cfe-commits
vbvictor wrote: Thank you for the PR! Did you try to address this issue https://github.com/llvm/llvm-project/issues/138842? There is an ongoing PR https://github.com/llvm/llvm-project/pull/144213 that essentially tries to handle the same case with structured bindings. To be fair with everyone,

[clang-tools-extra] [clang-tidy] Add MLIR check for old op builder usage. (PR #149148)

2025-07-16 Thread Baranov Victor via cfe-commits
vbvictor wrote: I think we should go through an RFC before creating a new module. TBH, I don't think we need a new module for MLIR in upstream since it is not a widely known thing in C++ community. Would it be viable for MLIR folks to use [plugins](https://clang.llvm.org/extra/clang-tidy/Contr

[clang] [clang][docs] Add all clang-tools-extra to 'ClangTools.rst' (PR #148622)

2025-07-16 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor edited https://github.com/llvm/llvm-project/pull/148622 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][docs] Add all clang-tools-extra (PR #148622)

2025-07-16 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor approved this pull request. LGTM, but please wait some time for EugeneZelenko to leave a review. https://github.com/llvm/llvm-project/pull/148622 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org

[clang] [clang][docs] Add all clang-tools-extra (PR #148622)

2025-07-15 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor edited https://github.com/llvm/llvm-project/pull/148622 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][docs] Add all clang-tools-extra (PR #148622)

2025-07-15 Thread Baranov Victor via cfe-commits
@@ -89,14 +89,53 @@ they'll be tracked here. The focus of this documentation is on the scope and features of the tools for other tool developers; each tool should provide its own user-focused documentation. -``clang-tidy`` +``Clang-Doc`` +- + +`Clang-Doc

[clang-tools-extra] [clang-tidy] added `IgnoreAliasing` option to `readability-qualified-auto check` (PR #147060)

2025-07-15 Thread Baranov Victor via cfe-commits
@@ -96,3 +96,49 @@ Note in the LLVM alias, the default value is `false`. matched against only the type name (i.e. ``Type``). E.g. to suppress reports for ``std::array`` iterators use `std::array<.*>::(const_)?iterator` string. The default is an empty string. + +.. option:

[clang-tools-extra] [clang-tidy] added `IgnoreAliasing` option to `readability-qualified-auto check` (PR #147060)

2025-07-15 Thread Baranov Victor via cfe-commits
@@ -96,3 +96,49 @@ Note in the LLVM alias, the default value is `false`. matched against only the type name (i.e. ``Type``). E.g. to suppress reports for ``std::array`` iterators use `std::array<.*>::(const_)?iterator` string. The default is an empty string. + +.. option:

[clang-tools-extra] [clang-tidy] added `IgnoreAliasing` option to `readability-qualified-auto check` (PR #147060)

2025-07-15 Thread Baranov Victor via cfe-commits
@@ -96,3 +96,49 @@ Note in the LLVM alias, the default value is `false`. matched against only the type name (i.e. ``Type``). E.g. to suppress reports for ``std::array`` iterators use `std::array<.*>::(const_)?iterator` string. The default is an empty string. + +.. option:

[clang-tools-extra] [clang-tidy] added `IgnoreAliasing` option to `readability-qualified-auto check` (PR #147060)

2025-07-15 Thread Baranov Victor via cfe-commits
@@ -134,14 +136,26 @@ void QualifiedAutoCheck::registerMatchers(MatchFinder *Finder) { auto IsBoundToType = refersToType(equalsBoundNode("type")); auto UnlessFunctionType = unless(hasUnqualifiedDesugaredType(functionType())); - auto IsAutoDeducedToPointer = [](const std

[clang-tools-extra] [clang-tidy] added `IgnoreAliasing` option to `readability-qualified-auto check` (PR #147060)

2025-07-15 Thread Baranov Victor via cfe-commits
@@ -96,3 +96,49 @@ Note in the LLVM alias, the default value is `false`. matched against only the type name (i.e. ``Type``). E.g. to suppress reports for ``std::array`` iterators use `std::array<.*>::(const_)?iterator` string. The default is an empty string. + +.. option:

[clang-tools-extra] [clang-tidy] Speed up `misc-header-include-cycle` (PR #148757)

2025-07-14 Thread Baranov Victor via cfe-commits
vbvictor wrote: Could you use `-enable-check-profile` and get a benchmark for standalone `clang-tidy` before and after the patch? https://clang.llvm.org/extra/clang-tidy/Contributing.html#on-checks-profiling https://github.com/llvm/llvm-project/pull/148757 _

[clang-tools-extra] [clang-tidy] do not diagnose array types within implicit instantiations of a template (PR #132924)

2025-07-14 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor edited https://github.com/llvm/llvm-project/pull/132924 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy] do not diagnose array types within implicit instantiations of a template (PR #132924)

2025-07-14 Thread Baranov Victor via cfe-commits
@@ -66,22 +89,45 @@ void AvoidCArraysCheck::registerMatchers(MatchFinder *Finder) { hasParent(varDecl(isExternC())), hasParent(fieldDecl( hasParent(recordDecl(isExternCContext(), -

[clang-tools-extra] [clang-tidy] do not diagnose array types within implicit instantiations of a template (PR #132924)

2025-07-14 Thread Baranov Victor via cfe-commits
@@ -66,22 +89,45 @@ void AvoidCArraysCheck::registerMatchers(MatchFinder *Finder) { hasParent(varDecl(isExternC())), hasParent(fieldDecl( hasParent(recordDecl(isExternCContext(), -

[clang-tools-extra] [clang-tidy] do not diagnose array types within implicit instantiations of a template (PR #132924)

2025-07-14 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor commented: Tests lgtm, minor comments on code. Please rebase on fresh main https://github.com/llvm/llvm-project/pull/132924 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listi

[clang] [clang][docs] Add all clang-tools-extra (PR #148622)

2025-07-14 Thread Baranov Victor via cfe-commits
@@ -97,6 +97,41 @@ linter tool. It provides an extensible framework for building compiler-based static analyses detecting and fixing bug-prone patterns, performance, portability and maintainability issues. +``clang-include-fixer`` +--- + +`clang-include-fi

[clang] [clang][docs] Add all clang-tools-extra (PR #148622)

2025-07-14 Thread Baranov Victor via cfe-commits
@@ -97,6 +97,41 @@ linter tool. It provides an extensible framework for building compiler-based static analyses detecting and fixing bug-prone patterns, performance, portability and maintainability issues. +``clang-include-fixer`` +--- + +`clang-include-fi

[clang-tools-extra] [clang-tidy] Improve `bugprone-exception-escape`: add stacktrace of escaped exception (PR #134375)

2025-07-14 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor closed 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

[clang-tools-extra] [clang-tidy] Improve `bugprone-exception-escape`: add stacktrace of escaped exception (PR #134375)

2025-07-14 Thread Baranov Victor via 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

[clang-tools-extra] [clang-tidy][NFC] Do less unnecessary work in `NoLintDirectiveHandler` (PR #147553)

2025-07-14 Thread Baranov Victor via cfe-commits
@@ -93,15 +92,17 @@ class NoLintToken { // The location of the first character, "N", in "NOLINT". size_t Pos; + // A glob of the checks this NOLINT token disables. + std::unique_ptr ChecksGlob; vbvictor wrote: Do we need to put it in `public`? https://

[clang-tools-extra] [clang-tidy][NFC] Do less unnecessary work in `NoLintDirectiveHandler` (PR #147553)

2025-07-14 Thread Baranov Victor via cfe-commits
@@ -349,46 +369,21 @@ bool NoLintDirectiveHandler::Impl::diagHasNoLint( return false; // Do we have cached NOLINT block locations for this file? - if (Cache.count(*FileName) == 0) + if (!Cache.contains(*FileName)) // Warning: heavy operation - need to read entire

[clang-tools-extra] [clang-tidy] Update `confusables.txt` in `misc-confusable-identifiers` (PR #148399)

2025-07-14 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor closed https://github.com/llvm/llvm-project/pull/148399 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy] Improve `bugprone-exception-escape`: add stacktrace of escaped exception (PR #134375)

2025-07-14 Thread Baranov Victor via 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

[clang-tools-extra] [clang-tidy] Add new check: `readability-use-concise-preprocessor-directives` (PR #146830)

2025-07-14 Thread Baranov Victor via cfe-commits
vbvictor wrote: > A LLVM syncbot commit turned our buildbot red: > https://lab.llvm.org/buildbot/#/builders/123/builds/23254 > > The syncbot commit links to this PR. [edit] On a second look it looks more > like an infra issue on our end, I'll investigate. [/edit] Hi! Any logs/errors that are

[clang-tools-extra] [clang-tidy][C++20] Add support for Initialization Forwarding in structs and Nested Objects within modernize-use-emplace (PR #131969)

2025-07-13 Thread Baranov Victor via cfe-commits
@@ -332,19 +376,42 @@ 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

[clang-tools-extra] [clang-tidy][C++20] Add support for Initialization Forwarding in structs and Nested Objects within modernize-use-emplace (PR #131969)

2025-07-13 Thread Baranov Victor via cfe-commits
@@ -332,19 +376,42 @@ 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

[clang-tools-extra] [clang-tidy][C++20] Add support for Initialization Forwarding in structs and Nested Objects within modernize-use-emplace (PR #131969)

2025-07-13 Thread Baranov Victor via cfe-commits
@@ -332,19 +376,42 @@ 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

[clang-tools-extra] [clang-tidy][C++20] Add support for Initialization Forwarding in structs and Nested Objects within modernize-use-emplace (PR #131969)

2025-07-13 Thread Baranov Victor via cfe-commits
@@ -1434,3 +1436,33 @@ void testWithPointerTypes() { // CHECK-MESSAGES: :[[@LINE-1]]:15: warning: unnecessary temporary object created while calling emplace // CHECK-FIXES: sp->emplace(); } + +namespace GH1225740 { + +void CXX20testBracedInitTemporaries(){ + --

[clang-tools-extra] [clang-tidy][C++20] Add support for Initialization Forwarding in structs and Nested Objects within modernize-use-emplace (PR #131969)

2025-07-13 Thread Baranov Victor via cfe-commits
@@ -1434,3 +1436,33 @@ void testWithPointerTypes() { // CHECK-MESSAGES: :[[@LINE-1]]:15: warning: unnecessary temporary object created while calling emplace // CHECK-FIXES: sp->emplace(); } + +namespace GH1225740 { + +void CXX20testBracedInitTemporaries(){

[clang-tools-extra] [clang-tidy][C++20] Add support for Initialization Forwarding in structs and Nested Objects within modernize-use-emplace (PR #131969)

2025-07-13 Thread Baranov Victor via cfe-commits
@@ -1434,3 +1436,33 @@ void testWithPointerTypes() { // CHECK-MESSAGES: :[[@LINE-1]]:15: warning: unnecessary temporary object created while calling emplace // CHECK-FIXES: sp->emplace(); } + +namespace GH1225740 { + +void CXX20testBracedInitTemporaries(){ + + std::vector

[clang-tools-extra] [clang-tidy][C++20] Add support for Initialization Forwarding in structs and Nested Objects within modernize-use-emplace (PR #131969)

2025-07-13 Thread Baranov Victor via cfe-commits
@@ -1434,3 +1436,33 @@ void testWithPointerTypes() { // CHECK-MESSAGES: :[[@LINE-1]]:15: warning: unnecessary temporary object created while calling emplace // CHECK-FIXES: sp->emplace(); } + +namespace GH1225740 { vbvictor wrote: nit: After N years this

[clang-tools-extra] [clang-tidy][C++20] Add support for Initialization Forwarding in structs and Nested Objects within modernize-use-emplace (PR #131969)

2025-07-13 Thread Baranov Victor via cfe-commits
@@ -1,4 +1,12 @@ -// RUN: %check_clang_tidy %s modernize-use-emplace %t -- \ +// RUN: %check_clang_tidy %s -std=c++11 modernize-use-emplace %t -- \ vbvictor wrote: ```suggestion // RUN: %check_clang_tidy %s -std=c++11,c++14,c++17 modernize-use-emplace %t -- \ ``

[clang-tools-extra] [clang-tidy][C++20] Add support for Initialization Forwarding in structs and Nested Objects within modernize-use-emplace (PR #131969)

2025-07-13 Thread Baranov Victor via cfe-commits
@@ -1,4 +1,12 @@ -// RUN: %check_clang_tidy %s modernize-use-emplace %t -- \ +// RUN: %check_clang_tidy %s -std=c++11 modernize-use-emplace %t -- \ +// RUN: -config="{CheckOptions: \ +// RUN: {modernize-use-emplace.ContainersWithPushBack: \ +// RUN:':

[clang-tools-extra] [clang-tidy][C++20] Add support for Initialization Forwarding in structs and Nested Objects within modernize-use-emplace (PR #131969)

2025-07-13 Thread Baranov Victor via cfe-commits
@@ -332,19 +376,42 @@ 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

[clang-tools-extra] [clang-tidy][NFC] Add mention of running 'clang-tidy' on changes in Contributing.rst (PR #148547)

2025-07-13 Thread Baranov Victor via cfe-commits
vbvictor wrote: IMO, we should implicitly use `multiprocessing.cpu_count()` in `run-clang-tidy` and `clang-tidy-diff` and use that number if user didn't specify `-j` explicitly. P.S. running lint over all clang-tidy is not so fast now:) ```bash $ time run-clang-tidy -p build/ clang-tools-extra

[clang-tools-extra] [clang-tidy][NFC] Add mention of running 'clang-tidy' on changes in Contributing.rst (PR #148547)

2025-07-13 Thread Baranov Victor via cfe-commits
vbvictor wrote: > Clang-Tidy pull requests are usually small, so is `-j` really necessary? I may say why not to use all cores when we can. If PR only touches 1 file, `clang-tidy-diff` will not load other cores. If PR touches multiple files, the user can have N times faster linting time, which i

[clang-tools-extra] [clang-tidy] modernize-use-std-print, format: Fix checks with Abseil functions (PR #142312)

2025-07-13 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor approved this pull request. LGTM As I understand now, `IgnoreImplicitAsWritten` does not skip `CXXConstructExpr` and other similar nodes but `IgnoreUnlessSpelledInSource` does. To drill down to the `StringLiteral` we need to use `IgnoreUnlessSpelledInSource`. https:/

[clang-tools-extra] [clang-tidy][NFC] Enable 'performance-move-const-arg' in '.clang-tidy' config (PR #148549)

2025-07-13 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor created https://github.com/llvm/llvm-project/pull/148549 Set `performance-move-const-arg.CheckTriviallyCopyableMove` option to `false` because "trivially copyable" is too strict and give warning for e.g. `MixData` class: https://github.com/llvm/llvm-project/blob/1f

[clang-tools-extra] [clang-tidy][NFC] Add mention of running 'clang-tidy' on changes in Contributing.rst (PR #148547)

2025-07-13 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor edited https://github.com/llvm/llvm-project/pull/148547 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy] Add filtering of check options by enabled checks in '--dump-config' (PR #147142)

2025-07-13 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor closed https://github.com/llvm/llvm-project/pull/147142 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy][NFC] Add mention of running 'clang-tidy' on changes in Contributing.rst (PR #148547)

2025-07-13 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor created https://github.com/llvm/llvm-project/pull/148547 Follow up to https://github.com/llvm/llvm-project/pull/147793. Originally suggested in https://github.com/llvm/llvm-project/pull/147793#issuecomment-3059021433 >From 9ee0621a78423ee97d2dcafb6b8de35783222b4e M

[clang-tools-extra] [clang-tidy] Add new check: `readability-use-concise-preprocessor-directives` (PR #146830)

2025-07-13 Thread Baranov Victor via cfe-commits
vbvictor wrote: Buildbot failure seems unrelated https://github.com/llvm/llvm-project/pull/146830 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy] Add new check: `readability-use-concise-preprocessor-directives` (PR #146830)

2025-07-13 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor closed https://github.com/llvm/llvm-project/pull/146830 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-tools-extra] [clang-tidy] `bugprone-unchecked-optional-access`: handle `BloombergLP::bdlb:NullableValue::makeValue` to prevent false-positives (PR #144313)

2025-07-13 Thread Baranov Victor via cfe-commits
vbvictor wrote: Analysis reviewers, could you please take a look at this https://github.com/llvm/llvm-project/pull/144313#discussion_r2188585118. Your opinion is highly appreciated! https://github.com/llvm/llvm-project/pull/144313 ___ cfe-commits mai

[clang] [clang-tools-extra] [clang-tidy] `bugprone-unchecked-optional-access`: handle `BloombergLP::bdlb:NullableValue::makeValue` to prevent false-positives (PR #144313)

2025-07-13 Thread Baranov Victor via cfe-commits
@@ -985,6 +985,20 @@ auto buildTransferMatchSwitch() { isOptionalMemberCallWithNameMatcher(hasName("isNull")), transferOptionalIsNullCall) + // NullableValue::makeValue, NullableValue::makeValueInplace + // Only NullableValue has these methods, bu

[clang-tools-extra] Reland "[clang-tidy] Improve integer comparison by matching valid expressions outside implicitCastExpr for use-integer-sign-comparison" (PR #144240)

2025-07-13 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor edited https://github.com/llvm/llvm-project/pull/144240 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] Reland [clang-tidy] Improve integer comparison by matching valid expressions outside implicitCastExpr for use-integer-sign-comparison (PR #144240)

2025-07-13 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor edited https://github.com/llvm/llvm-project/pull/144240 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy] Improve integer comparison by matching valid expressions outside implicitCastExpr for use-integer-sign-comparison (PR #144240)

2025-07-13 Thread Baranov Victor via cfe-commits
vbvictor wrote: Ping @carlosgalvezp, @5chmidti, @HerrCai0907 as original reviewers of the check. You may have more thought here, second opinion in appreciated since this PR is a reland. https://github.com/llvm/llvm-project/pull/144240 ___ cfe-commits

[clang-tools-extra] [clang-tidy] Add filtering of check options by enabled checks in '--dump-config' (PR #147142)

2025-07-13 Thread Baranov Victor via cfe-commits
@@ -503,6 +503,21 @@ getCheckNames(const ClangTidyOptions &Options, return Factory.getCheckNames(); } +void filterCheckOptions(ClangTidyOptions &Options, +const std::vector &EnabledChecks) { + StringSet<> EnabledChecksSet(llvm::from_range, EnabledChe

[clang-tools-extra] [clang-tidy] Add filtering of check options by enabled checks in '--dump-config' (PR #147142)

2025-07-13 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor updated https://github.com/llvm/llvm-project/pull/147142 >From d70b792ece6709b7a68baf116c0895394c71fd16 Mon Sep 17 00:00:00 2001 From: Victor Baranov Date: Sat, 5 Jul 2025 15:12:04 +0300 Subject: [PATCH 1/2] [clang-tidy] filter check options by enabled checks in '--

[clang-tools-extra] [clang-tidy] Improve `bugprone-exception-escape`: add stacktrace of escaped exception (PR #134375)

2025-07-12 Thread Baranov Victor via cfe-commits
vbvictor wrote: Ran this check on `Poco`, `VTK` and `opencv` successfully, stack traces are printed correctly. https://github.com/llvm/llvm-project/pull/134375 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mail

[clang-tools-extra] [clang-tools-extra][NFC] Fix link to code review in README.txt (PR #148384)

2025-07-12 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor edited https://github.com/llvm/llvm-project/pull/148384 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy] Add filtering of check options by enabled checks in '--dump-config' (PR #147142)

2025-07-12 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor edited https://github.com/llvm/llvm-project/pull/147142 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy] `misc-confusable-identifiers`: Update `confusables.txt` (PR #148399)

2025-07-12 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor approved this pull request. LGTM. You should place verb in commit message in front so that the whole message would be like a sentence: "Update 'confusables.txt' in 'misc-confusable-identifiers'" That is the usual way of naming in LLVM (see other open PRs) https://git

[clang-tools-extra] [clang-tidy] Improve integer comparison by matching valid expressions outside implicitCastExpr for use-integer-sign-comparison (PR #144240)

2025-07-12 Thread Baranov Victor via cfe-commits
vbvictor wrote: > > I will take a look at the weekend. > > No Rush, enjoy your weekend 😸 Thanks! But that's the only time I can thoughtfully read other code apart from main job 🙃 https://github.com/llvm/llvm-project/pull/144240 ___ cfe-commits maili

[clang-tools-extra] [clang-tidy] Improve integer comparison by matching valid expressions outside implicitCastExpr for use-integer-sign-comparison (PR #144240)

2025-07-12 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor edited https://github.com/llvm/llvm-project/pull/144240 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy] Improve integer comparison by matching valid expressions outside implicitCastExpr for use-integer-sign-comparison (PR #144240)

2025-07-12 Thread Baranov Victor via cfe-commits
@@ -112,14 +115,17 @@ void UseIntegerSignComparisonCheck::registerPPCallbacks( void UseIntegerSignComparisonCheck::check( const MatchFinder::MatchResult &Result) { const auto *SignedCastExpression = - Result.Nodes.getNodeAs("sIntCastExpression"); - assert(SignedCast

[clang-tools-extra] [clang-tidy] Improve integer comparison by matching valid expressions outside implicitCastExpr for use-integer-sign-comparison (PR #144240)

2025-07-12 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor edited https://github.com/llvm/llvm-project/pull/144240 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy] Improve integer comparison by matching valid expressions outside implicitCastExpr for use-integer-sign-comparison (PR #144240)

2025-07-12 Thread Baranov Victor via cfe-commits
@@ -39,21 +39,23 @@ intCastExpression(bool IsSigned, // std::cmp_{} functions trigger a compile-time error if either LHS or RHS // is a non-integer type, char, enum or bool // (unsigned char/ signed char are Ok and can be used). - auto IntTypeExpr = expr(hasType(hasCanon

[clang-tools-extra] [clang-tidy] Improve integer comparison by matching valid expressions outside implicitCastExpr for use-integer-sign-comparison (PR #144240)

2025-07-12 Thread Baranov Victor via cfe-commits
@@ -91,7 +93,8 @@ void UseIntegerSignComparisonCheck::storeOptions( void UseIntegerSignComparisonCheck::registerMatchers(MatchFinder *Finder) { const auto SignedIntCastExpr = intCastExpression(true, "sIntCastExpression"); - const auto UnSignedIntCastExpr = intCastExpression

[clang-tools-extra] [clang-tidy] Improve integer comparison by matching valid expressions outside implicitCastExpr for use-integer-sign-comparison (PR #144240)

2025-07-12 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor commented: Could you add more tests, e.g. when we have "inverted" casts in GH127471 like this: ```cpp (unsigned int)a2.size() == size() //size() return int ``` I believe we could also be add more tests with different type of casts in GH127471 case. https://github.c

[clang-tools-extra] [clang-tidy] `misc-confusable-identifiers`: Update `confusables.txt` (PR #148399)

2025-07-12 Thread Baranov Victor via cfe-commits
vbvictor wrote: Is this file taken as-is from some place or crafted by hand? Could you share a source? https://github.com/llvm/llvm-project/pull/148399 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/list

[clang-tools-extra] [clang-tools-extra][NFC] fix link to code review in README.txt (PR #148384)

2025-07-12 Thread Baranov Victor via cfe-commits
vbvictor wrote: > There are dedicated Discourse topics for Clangd and Clang-Tidy. May be they > should be mentioned explicitly? Added links to them as a list, do you think we need a new entry for each of the link? https://github.com/llvm/llvm-project/pull/148384 __

[clang-tools-extra] [clang-tools-extra][NFC] fix link to code review in README.txt (PR #148384)

2025-07-12 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor updated https://github.com/llvm/llvm-project/pull/148384 >From 11662e5e11ff14667893282cd05c4fa7c4be706e Mon Sep 17 00:00:00 2001 From: Victor Baranov Date: Sat, 12 Jul 2025 19:51:24 +0300 Subject: [PATCH 1/2] [clang-tools-extra] fix link to code review in README.txt

[clang-tools-extra] [clang-tidy] Use lexical anon-ns matcher in llvm-prefer-static-over-anonymous-namespace (PR #148357)

2025-07-12 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor closed https://github.com/llvm/llvm-project/pull/148357 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tools-extra][NFC] fix link to code review in README.txt (PR #148384)

2025-07-12 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor created https://github.com/llvm/llvm-project/pull/148384 I'm not sure if we need to add label inside link or not, but `lists.llvm.org` seems outdated for sure, WDYT? >From 11662e5e11ff14667893282cd05c4fa7c4be706e Mon Sep 17 00:00:00 2001 From: Victor Baranov Date:

[clang-tools-extra] [clang-tidy][NFC] fixed invalid formatting in 'ReleaseNotes.rst' (PR #148352)

2025-07-12 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor closed https://github.com/llvm/llvm-project/pull/148352 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-tools-extra] [ASTMatchers][NFC] Replace `makeMatcher` function with CTAD (PR #147197)

2025-07-12 Thread Baranov Victor via cfe-commits
vbvictor wrote: Build errors seem unrelated to this change https://github.com/llvm/llvm-project/pull/147197 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy] Use lexical anon-ns matcher in llvm-prefer-static-over-anonymous-namespace (PR #148357)

2025-07-12 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor updated https://github.com/llvm/llvm-project/pull/148357 >From 82bee931621536e7e59910f1833289510909ce23 Mon Sep 17 00:00:00 2001 From: Victor Baranov Date: Sat, 12 Jul 2025 14:24:31 +0300 Subject: [PATCH] [clang-tidy] Use lexical anon-ns matcher in llvm-prefer-stati

[clang] [clang-tools-extra] [ASTMatchers][NFC] Replace `makeMatcher` function with CTAD (PR #147197)

2025-07-12 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor closed https://github.com/llvm/llvm-project/pull/147197 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy] Use lexical anon-ns matcher in llvm-prefer-static-over-anonymous-namespace (PR #148357)

2025-07-12 Thread Baranov Victor via cfe-commits
@@ -21,6 +21,17 @@ AST_MATCHER(NamedDecl, isInMacro) { AST_MATCHER(VarDecl, isLocalVariable) { return Node.isLocalVarDecl(); } +AST_MATCHER(Decl, isLexicallyInAnonymousNamespace) { + for (const DeclContext *DC = Node.getLexicalDeclContext(); DC != nullptr; + DC = DC->g

[clang-tools-extra] [clang-tidy] Use lexical anon-ns matcher in llvm-prefer-static-over-anonymous-namespace (PR #148357)

2025-07-12 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor created https://github.com/llvm/llvm-project/pull/148357 When having this code: ```cpp namespace { class MyClassOutOfAnon { public: MyClassOutOfAnon(); } // namespace MyClassOutOfAnon::MyClassOutOfAnon() {} ``` `MyClassOutOfAnon::MyClassOutOfAnon` is located in ano

[clang-tools-extra] [clang-tidy][NFC] fixed invalid formatting in 'ReleaseNotes.rst' (PR #148352)

2025-07-12 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor created https://github.com/llvm/llvm-project/pull/148352 None >From faae7788f2789634796d065c8497e8f408c6b8e4 Mon Sep 17 00:00:00 2001 From: Victor Baranov Date: Sat, 12 Jul 2025 13:13:48 +0300 Subject: [PATCH] [clang-tidy][NFC] fixed invalid formatting in ReleaseNo

[clang] [Clang] Improve diagnostics for 'placement new' with const storage argument (PR #144270)

2025-07-11 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor closed https://github.com/llvm/llvm-project/pull/144270 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy] Add new check `llvm-prefer-static-over-anonymous-namespace` (PR #142839)

2025-07-11 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor closed https://github.com/llvm/llvm-project/pull/142839 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy] Teach `cppcoreguidelines-interfaces-global-init` about `constinit` (PR #148334)

2025-07-11 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor approved this pull request. LGTM https://github.com/llvm/llvm-project/pull/148334 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy] Teach `cppcoreguidelines-interfaces-global-init` about `constinit` (PR #148334)

2025-07-11 Thread Baranov Victor via cfe-commits
@@ -1,4 +1,4 @@ -// RUN: %check_clang_tidy %s cppcoreguidelines-interfaces-global-init %t +// RUN: %check_clang_tidy -std=c++20 %s cppcoreguidelines-interfaces-global-init %t vbvictor wrote: Yes, we could do guards https://github.com/llvm/llvm-project/pull/1483

[clang-tools-extra] [clang-tidy] Teach `cppcoreguidelines-interfaces-global-init` about `constinit` (PR #148334)

2025-07-11 Thread Baranov Victor via cfe-commits
@@ -1,4 +1,4 @@ -// RUN: %check_clang_tidy %s cppcoreguidelines-interfaces-global-init %t +// RUN: %check_clang_tidy -std=c++20 %s cppcoreguidelines-interfaces-global-init %t vbvictor wrote: We shouldn't increase standard here because we still want to check that

[clang-tools-extra] [clang-tidy] Teach `cppcoreguidelines-interfaces-global-init` about `constinit` (PR #148334)

2025-07-11 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor requested changes to this pull request. https://github.com/llvm/llvm-project/pull/148334 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy] Improve integer comparison by matching valid expressions outside implicitCastExpr for use-integer-sign-comparison (PR #144240)

2025-07-11 Thread Baranov Victor via cfe-commits
vbvictor wrote: I will take a look at the weekend. Sorry for double ping of other reviewers, GitHub mobile is kind of strange.. https://github.com/llvm/llvm-project/pull/144240 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.

[clang-tools-extra] [clang-tidy][NFC] add '.clang-tidy' config for clang-tidy project (PR #147793)

2025-07-11 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor closed https://github.com/llvm/llvm-project/pull/147793 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy] added `RespectOpaqueTypes` option to `readability-qualified-auto check` (PR #147060)

2025-07-11 Thread Baranov Victor via cfe-commits
vbvictor wrote: > In this case when looking at the type of Data the IntPtr type does not > appear, only int* This is a known "problem" of clang with preserving type sugar. TL;DR currently there is no way to get `IntPtr` as you need. There is work in progress to preserve `IntPtr` through all AS

[clang] [clang-tools-extra] [lldb] [llvm] [mlir] A couple of grammar fixes (PR #144368)

2025-07-11 Thread Baranov Victor via cfe-commits
vbvictor wrote: Please write PR description more specific and add (NFC) at the end. Could be: "Fix typos 'seperate' -> 'separate' (NFC)" https://github.com/llvm/llvm-project/pull/144368 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://li

[clang] [Clang] Improve diagnostics for 'placement new' with const storage argument (PR #144270)

2025-07-11 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor updated https://github.com/llvm/llvm-project/pull/144270 >From ba7db62070dc669d5ee0e54df075abb35772faee Mon Sep 17 00:00:00 2001 From: Victor Baranov Date: Sun, 15 Jun 2025 19:56:05 +0300 Subject: [PATCH 1/4] [Clang] Improve diagnostics when 'placement new' was call

  1   2   3   4   5   6   7   8   9   10   >