[clang-tools-extra] [clang-tidy][C++20] Add support for Initialization Forwarding in Nested Objects (PR #131969)

2025-03-28 Thread Baranov Victor via cfe-commits
@@ -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

[clang-tools-extra] [clang-tidy][NFC] improve documentation for `bugprone-argument-comment` check (PR #133436)

2025-03-28 Thread Baranov Victor via cfe-commits
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

[clang-tools-extra] [clang-tidy][C++20] Add support for Initialization Forwarding in Nested Objects (PR #131969)

2025-03-28 Thread Baranov Victor via cfe-commits
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

[clang-tools-extra] [clang-tidy] Fix `thread_local` false positives in `misc-use-internal-linkage` check (PR #132573)

2025-03-28 Thread Baranov Victor via cfe-commits
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

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

2025-03-28 Thread Baranov Victor via cfe-commits
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

[clang-tools-extra] [clang-tidy][NFC][doc] improve "options" sections of `bugprone-` and `modernize-` checks (PR #133525)

2025-03-30 Thread Baranov Victor via 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

[clang-tools-extra] [clang-tidy][NFC][doc] improve "options" sections of `bugprone-` and `modernize-` checks (PR #133525)

2025-03-30 Thread Baranov Victor via 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

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

2025-03-30 Thread Baranov Victor via cfe-commits
@@ -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

[clang-tools-extra] [clang-tidy][bugprone-unintended-char-ostream-output] add `WarnOnExplicitCast` option (PR #133639)

2025-03-30 Thread Baranov Victor via 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

[clang-tools-extra] [clang-tidy][bugprone-unintended-char-ostream-output] add `WarnOnExplicitCast` option (PR #133639)

2025-03-30 Thread Baranov Victor via cfe-commits
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

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

2025-03-30 Thread Baranov Victor via 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

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

2025-03-30 Thread Baranov Victor via 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

[clang-tools-extra] [clang-tidy][NFC][doc] improve "options" sections of `bugprone-` and `modernize-` checks (PR #133525)

2025-03-30 Thread Baranov Victor via 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

[clang-tools-extra] [clang-tidy][NFC][doc] improve "options" sections of `bugprone-` and `modernize-` checks (PR #133525)

2025-03-30 Thread Baranov Victor via 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

[clang-tools-extra] [clang-tidy][bugprone-unintended-char-ostream-output] add `WarnOnExplicitCast` option (PR #133639)

2025-03-30 Thread Baranov Victor via 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 +--- + +.. option:: WarnOnExplicitCast + + When `WarnOnExplicitCast` is set to `false`, the check will not warn when + output of ostream

[clang-tools-extra] [clang-tidy][bugprone-unintended-char-ostream-output] add `WarnOnExplicitCast` option (PR #133639)

2025-03-30 Thread Baranov Victor via 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 +--- + +.. option:: WarnOnExplicitCast + + When `WarnOnExplicitCast` is set to `false`, the check will not warn when + output of ostream

[clang-tools-extra] [clang-tidy] Add new `construct-reusable-objects-once` check (PR #131455)

2025-03-15 Thread Baranov Victor via cfe-commits
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.

[clang-tools-extra] [clang-tidy] Add new `construct-reusable-objects-once` check (PR #131455)

2025-03-15 Thread Baranov Victor via 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] add new construct-reusable-objects-once check --- .../clang-

[clang-tools-extra] [clang-tidy] support different precisions (PR #130540)

2025-03-15 Thread Baranov Victor via cfe-commits
@@ -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

[clang-tools-extra] [clang-tidy][NFC] clean ReleaseNotes.rst (PR #130626)

2025-03-15 Thread Baranov Victor via cfe-commits
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

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

2025-03-15 Thread Baranov Victor via cfe-commits
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

[clang-tools-extra] [clang-tidy] Add new check bugprone-capture-this-by-field (PR #130297)

2025-03-15 Thread Baranov Victor via cfe-commits
@@ -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

[clang-tools-extra] [clang-tidy] Add new check bugprone-capture-this-by-field (PR #130297)

2025-03-14 Thread Baranov Victor via cfe-commits
@@ -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

[clang-tools-extra] [clang-tidy] Add new check bugprone-capture-this-by-field (PR #130297)

2025-03-14 Thread Baranov Victor via cfe-commits
@@ -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

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

2025-03-15 Thread Baranov Victor via cfe-commits
@@ -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

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

2025-03-15 Thread Baranov Victor via 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/6] [clang-tidy] add scoped-lock-check --- .../clang-tidy/mod

[clang-tools-extra] [clang-tidy] Improve `readability-function-size`: count class member initializers as statements (PR #131669)

2025-03-17 Thread Baranov Victor via cfe-commits
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

[clang-tools-extra] Enforce SL.con.3: Add check to replace operator[] with at() [Cont.] (PR #95220)

2025-04-08 Thread Baranov Victor via cfe-commits
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

[clang-tools-extra] Enforce SL.con.3: Add check to replace operator[] with at() [Cont.] (PR #95220)

2025-04-08 Thread Baranov Victor via cfe-commits
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

[clang-tools-extra] Enforce SL.con.3: Add check to replace operator[] with at() [Cont.] (PR #95220)

2025-04-08 Thread Baranov Victor via cfe-commits
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

[clang-tools-extra] Enforce SL.con.3: Add check to replace operator[] with at() [Cont.] (PR #95220)

2025-04-08 Thread Baranov Victor via cfe-commits
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-

[clang-tools-extra] Enforce SL.con.3: Add check to replace operator[] with at() [Cont.] (PR #95220)

2025-04-08 Thread Baranov Victor via cfe-commits
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

[clang-tools-extra] Enforce SL.con.3: Add check to replace operator[] with at() [Cont.] (PR #95220)

2025-04-09 Thread Baranov Victor via cfe-commits
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

[clang-tools-extra] [clang-tidy] Add support for lambda-expression in `use-trailing-return-type` check (PR #135383)

2025-04-11 Thread Baranov Victor via cfe-commits
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

[clang-tools-extra] [clang-tidy] Add support for lambda-expression in `use-trailing-return-type` check (PR #135383)

2025-04-11 Thread Baranov Victor via 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

[clang-tools-extra] [clang-tidy] Add support for lambda-expression in `use-trailing-return-type` check (PR #135383)

2025-04-11 Thread Baranov Victor via cfe-commits
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

[clang-tools-extra] [clang-tidy] Add support for lambda-expression in `use-trailing-return-type` check (PR #135383)

2025-04-11 Thread Baranov Victor via 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

[clang-tools-extra] [clang-tidy] Add support for lambda-expression in `use-trailing-return-type` check (PR #135383)

2025-04-11 Thread Baranov Victor via 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

[clang-tools-extra] [clang-tidy] Add support for lambda-expression in `use-trailing-return-type` check (PR #135383)

2025-04-11 Thread Baranov Victor via cfe-commits
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

[clang-tools-extra] [clang-tidy] Add support for lambda-expression in `use-trailing-return-type` check (PR #135383)

2025-04-11 Thread Baranov Victor via 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

[clang-tools-extra] [clang-tidy] Add support for lambda-expression in `use-trailing-return-type` check (PR #135383)

2025-04-11 Thread Baranov Victor via 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

[clang-tools-extra] [clang-tidy][NFC] fix `clang-tidy` warnings in `clang-tools-extra/clang-tidy` directory (PR #136097)

2025-04-17 Thread Baranov Victor via cfe-commits
@@ -209,12 +209,14 @@ bool isQualificationConvertiblePointer(QualType From, QualType To, // cv-decomposition of T, that is, cv_1, cv_2, ... , cv_n, is called the // cv-qualification signature of T. - auto isValidP_i = [](QualType P) { + // NOLINTNEXTLINE (readability-id

[clang-tools-extra] [clang-tidy][NFC] fix `clang-tidy` warnings in `clang-tools-extra/clang-tidy` directory (PR #136097)

2025-04-17 Thread Baranov Victor via cfe-commits
@@ -209,12 +209,14 @@ bool isQualificationConvertiblePointer(QualType From, QualType To, // cv-decomposition of T, that is, cv_1, cv_2, ... , cv_n, is called the // cv-qualification signature of T. - auto isValidP_i = [](QualType P) { + // NOLINTNEXTLINE (readability-id

[clang-tools-extra] [clang-tidy][NFC] fix `clang-tidy` warnings in `clang-tools-extra/clang-tidy` directory (PR #136097)

2025-04-17 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor edited https://github.com/llvm/llvm-project/pull/136097 ___ 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 support for lambda-expression in `use-trailing-return-type` check (PR #135383)

2025-04-17 Thread Baranov Victor via cfe-commits
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

[clang-tools-extra] [clang-tidy] Add support for lambda-expression in `use-trailing-return-type` check (PR #135383)

2025-04-17 Thread Baranov Victor via cfe-commits
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

[clang-tools-extra] [clang-tidy] Add support for lambda-expression in `use-trailing-return-type` check (PR #135383)

2025-04-17 Thread Baranov Victor via cfe-commits
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

[clang-tools-extra] [clang-tidy][NFC] fix `clang-tidy` warnings in `clang-tools-extra/clang-tidy` directory (PR #136097)

2025-04-17 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor edited https://github.com/llvm/llvm-project/pull/136097 ___ 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] fix `clang-tidy` warnings in `clang-tools-extra/clang-tidy` directory (PR #136097)

2025-04-17 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor edited https://github.com/llvm/llvm-project/pull/136097 ___ 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-04-13 Thread Baranov Victor via cfe-commits
vbvictor wrote: Ping, appreciate it if someone will take a look at these changes. 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] fix `clang-tidy` warnings in `clang-tools-extra/clang-tidy` directory (PR #136097)

2025-04-17 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor edited https://github.com/llvm/llvm-project/pull/136097 ___ 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 support for lambda-expression in `use-trailing-return-type` check (PR #135383)

2025-04-18 Thread Baranov Victor via 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 1/2] [clang-tidy] add support for lambdas in use-trailing-retu

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

2025-04-20 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 support for lambda-expression in `use-trailing-return-type` check (PR #135383)

2025-04-20 Thread Baranov Victor via cfe-commits
vbvictor wrote: Ping:) 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

[clang-tools-extra] [clang-tidy] Improve `readability-function-size`: count class member initializers as statements (PR #131669)

2025-04-26 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor edited https://github.com/llvm/llvm-project/pull/131669 ___ 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 `readability-function-size`: count class member initializers as statements (PR #131669)

2025-04-26 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor updated https://github.com/llvm/llvm-project/pull/131669 >From baf266d32b321dd4ee11a48ebc86e67e46179e61 Mon Sep 17 00:00:00 2001 From: Victor Baranov Date: Mon, 17 Mar 2025 23:25:10 +0300 Subject: [PATCH] add traverse of ctor-initializers as statements --- .../read

[clang-tools-extra] [clang-tidy] Added Conflicting Global Accesses checker (PR #130421)

2025-04-27 Thread Baranov Victor via cfe-commits
@@ -0,0 +1,748 @@ +//===--===// +// +// 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: Apa

[clang-tools-extra] [clang-tidy] Improve `readability-function-size`: count class member initializers as statements (PR #131669)

2025-04-26 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor updated https://github.com/llvm/llvm-project/pull/131669 >From 8e49dded073cf1e996a8687e9c57776442a36c77 Mon Sep 17 00:00:00 2001 From: Victor Baranov Date: Sat, 26 Apr 2025 13:22:55 +0300 Subject: [PATCH] [clang-tidy] count ctor-initializers as statements in check

[clang-tools-extra] [clang-tidy] Improve `readability-function-size`: count class member initializers as statements (PR #131669)

2025-04-26 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor ready_for_review https://github.com/llvm/llvm-project/pull/131669 ___ 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-04-27 Thread Baranov Victor via cfe-commits
vbvictor wrote: Ping 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 check 'bugprone-invalid-enum-default-initialization' (PR #136823)

2025-04-23 Thread Baranov Victor via cfe-commits
vbvictor wrote: I wonder if behavior of this check should be an extension to [optin.core.EnumCastOutOfRange](https://clang.llvm.org/docs/analyzer/checkers.html#optin-core-enumcastoutofrange). Sure, we don't have `static_cast` here but it's still considered as "cast out of range"? https://gith

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

2025-04-30 Thread Baranov Victor via cfe-commits
@@ -39,6 +39,29 @@ AST_MATCHER(clang::ParmVarDecl, isArgvOfMain) { return FD ? FD->isMain() : false; } +AST_MATCHER(clang::TypeLoc, isInImplicitTemplateInstantiation) { + const auto IsImplicitTemplateInstantiation = [](const auto *Node) { +return (Node != nullptr) && +

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

2025-04-30 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-04-30 Thread Baranov Victor via cfe-commits
@@ -39,6 +39,29 @@ AST_MATCHER(clang::ParmVarDecl, isArgvOfMain) { return FD ? FD->isMain() : false; } +AST_MATCHER(clang::TypeLoc, isInImplicitTemplateInstantiation) { + const auto IsImplicitTemplateInstantiation = [](const auto *Node) { +return (Node != nullptr) && +

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

2025-04-30 Thread Baranov Victor via cfe-commits
@@ -39,6 +39,30 @@ AST_MATCHER(clang::ParmVarDecl, isArgvOfMain) { return FD ? FD->isMain() : false; } +bool isWithinImplicitTemplateInstantiation(const TypeLoc *MatchedTypeLoc, vbvictor wrote: Maybe previous devs did not cover all cases, so you didn't have

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

2025-04-30 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-04-30 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-04-30 Thread Baranov Victor via cfe-commits
@@ -39,6 +39,30 @@ AST_MATCHER(clang::ParmVarDecl, isArgvOfMain) { return FD ? FD->isMain() : false; } +bool isWithinImplicitTemplateInstantiation(const TypeLoc *MatchedTypeLoc, vbvictor wrote: Hmm, I will try rerunning tests. I thought that all new tests c

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

2025-04-13 Thread Baranov Victor via cfe-commits
@@ -28,6 +29,12 @@ class ExceptionAnalyzer { ///< definition. }; + /// We use a SetVector to preserve the order of the functions in the call + /// stack as well as have fast lookup. + using CallStack = llvm::SetVector, +

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

2025-04-13 Thread Baranov Victor via cfe-commits
@@ -80,13 +80,46 @@ void ExceptionEscapeCheck::check(const MatchFinder::MatchResult &Result) { if (!MatchedDecl) return; - if (Tracer.analyze(MatchedDecl).getBehaviour() == - utils::ExceptionAnalyzer::State::Throwing) -// FIXME: We should provide more informat

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

2025-04-12 Thread Baranov Victor via cfe-commits
@@ -92,3 +92,162 @@ const char name[] = "Some string"; void takeCharArray(const char name[]); // CHECK-MESSAGES: :[[@LINE-1]]:26: warning: do not declare C-style arrays, use 'std::array' or 'std::vector' instead [modernize-avoid-c-arrays] + +namespace std { + template + str

[clang-tools-extra] [clang-tidy][NFC] fix `clang-tidy` warnings in `clang-tools-extra/clang-tidy` directory (PR #136097)

2025-04-17 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor created https://github.com/llvm/llvm-project/pull/136097 Mostly stylistic changes to `clang-tidy` source code. Command run: `python3 clang-tools-extra/clang-tidy/tool/run-clang-tidy.py -p build/ -j $(nproc) clang-tools-extra/clang-tidy` >From 479e98e5cc3bfe6992d1aa

[clang-tools-extra] [clang-tidy] Fix bugprone-tagged-union-member-count false-positive (PR #135831)

2025-04-17 Thread Baranov Victor via cfe-commits
=?utf-8?b?R8OhYm9yIFTDs3RodsOhcmk=?=,=?utf-8?b?R8OhYm9yIFTDs3RodsOhcmk=?Message-ID: In-Reply-To: vbvictor wrote: I'm not sure if we need to check explicitly if some `struct`/`enum` comes from `std` since all `std` namespace is already placed in system headers unless some niece cases like `std

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

2025-04-16 Thread Baranov Victor via cfe-commits
vbvictor wrote: Added handling of unknown exceptions, now we diag on place where `throw(int) `is written. Most of the comments in https://reviews.llvm.org/D153298 are covered in my PR. https://github.com/llvm/llvm-project/pull/134375 ___ cfe-commits m

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

2025-04-16 Thread Baranov Victor via cfe-commits
vbvictor wrote: Ping, @PiotrZSL 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] Add check 'modernize-use-enum-class' (PR #138282)

2025-05-05 Thread Baranov Victor via cfe-commits
@@ -0,0 +1,34 @@ +//===--- UseEnumClassCheck.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: Apa

[clang-tools-extra] Add check 'modernize-use-enum-class' (PR #138282)

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

[clang-tools-extra] Add check 'modernize-use-enum-class' (PR #138282)

2025-05-05 Thread Baranov Victor via cfe-commits
@@ -0,0 +1,34 @@ +//===--- UseEnumClassCheck.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: Apa

[clang-tools-extra] Add check 'modernize-use-enum-class' (PR #138282)

2025-05-05 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor edited https://github.com/llvm/llvm-project/pull/138282 ___ 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 support for lambda-expression in `use-trailing-return-type` check (PR #135383)

2025-04-30 Thread Baranov Victor via cfe-commits
vbvictor wrote: Ping 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

[clang-tools-extra] [NFC] Fix potential nullptr dereference. (PR #138283)

2025-05-02 Thread Baranov Victor via cfe-commits
vbvictor wrote: I don't have a strong opinion on this, but this `assert` may be a sign of "false safety". In release builds, it's a no-op, so end users will experience a regular Segfault, e.g. like this issue https://github.com/llvm/llvm-project/issues/135665. Debug builds with asserts are usu

[clang-tools-extra] Add check 'modernize-use-enum-class' (PR #138282)

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

[clang-tools-extra] Add check 'modernize-use-enum-class' (PR #138282)

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

[clang-tools-extra] Add check 'modernize-use-enum-class' (PR #138282)

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

[clang-tools-extra] Add check 'modernize-use-enum-class' (PR #138282)

2025-05-05 Thread Baranov Victor via cfe-commits
@@ -0,0 +1,34 @@ +//===--- UseEnumClassCheck.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: Apa

[clang-tools-extra] Add check 'modernize-use-enum-class' (PR #138282)

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

[clang-tools-extra] Add check 'modernize-use-enum-class' (PR #138282)

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

[clang-tools-extra] Add check 'modernize-use-enum-class' (PR #138282)

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

[clang-tools-extra] Add check 'modernize-use-enum-class' (PR #138282)

2025-05-05 Thread Baranov Victor via cfe-commits
vbvictor wrote: Your branch seems to be way behind current `main`, and `clang-tools-extra/docs/ReleaseNotes.rst` seems to be from already released 20th version of LLVM. (I don't know how can it even show a human-readable diff) Could you please rebase on fresh `main` branch. https://github.com/

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

2025-05-06 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor updated https://github.com/llvm/llvm-project/pull/126434 Rate limit · GitHub body { background-color: #f6f8fa; color: #24292e; font-family: -apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-

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

2025-05-06 Thread Baranov Victor via cfe-commits
vbvictor wrote: Rebased+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

[clang-tools-extra] [clang-tidy] Add check bugprone-misleading-setter-of-reference (PR #132242)

2025-05-06 Thread Baranov Victor via cfe-commits
@@ -0,0 +1,61 @@ +//===--- MisleadingSetterOfReferenceCheck.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: Apa

[clang-tools-extra] [clang-tidy] Add check bugprone-misleading-setter-of-reference (PR #132242)

2025-05-06 Thread Baranov Victor via cfe-commits
=?utf-8?q?Balázs_Kéri?= , =?utf-8?q?Balázs_Kéri?= , =?utf-8?q?Balázs_Kéri?= , =?utf-8?q?Balázs_Kéri?= Message-ID: In-Reply-To: https://github.com/vbvictor deleted https://github.com/llvm/llvm-project/pull/132242 ___ cfe-commits mailing list cfe-commi

[clang-tools-extra] [clang-tidy] Add check bugprone-misleading-setter-of-reference (PR #132242)

2025-05-06 Thread Baranov Victor via cfe-commits
@@ -0,0 +1,58 @@ +//===--- MisleadingSetterOfReferenceCheck.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: Apa

[clang-tools-extra] [clang-tidy] Add check bugprone-misleading-setter-of-reference (PR #132242)

2025-05-06 Thread Baranov Victor via cfe-commits
=?utf-8?q?Balázs_Kéri?= , =?utf-8?q?Balázs_Kéri?= , =?utf-8?q?Balázs_Kéri?= , =?utf-8?q?Balázs_Kéri?= Message-ID: In-Reply-To: vbvictor wrote: Please add entry to `clang-tools-extra/docs/ReleaseNotes.rst`. It should be the first sentence in checks docs. https://github.com/llvm/llvm-project/p

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

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

[clang-tools-extra] [clang-tidy] Fix bugprone-tagged-union-member-count false-positive (PR #135831)

2025-04-24 Thread Baranov Victor via cfe-commits
=?utf-8?b?R8OhYm9yIFTDs3RodsOhcmk=?=,=?utf-8?b?R8OhYm9yIFTDs3RodsOhcmk=?=, =?utf-8?b?R8OhYm9yIFTDs3RodsOhcmk=?= Message-ID: In-Reply-To: @@ -28,6 +31,25 @@ Example: } Data; }; +The following example illustrates the exception for unions and enums from +system header fil

[clang-tools-extra] [clang-tidy] Fix bugprone-tagged-union-member-count false-positive (PR #135831)

2025-04-24 Thread Baranov Victor via cfe-commits
=?utf-8?b?R8OhYm9yIFTDs3RodsOhcmk=?=,=?utf-8?b?R8OhYm9yIFTDs3RodsOhcmk=?=, =?utf-8?b?R8OhYm9yIFTDs3RodsOhcmk=?Message-ID: In-Reply-To: https://github.com/vbvictor edited https://github.com/llvm/llvm-project/pull/135831 ___ cfe-commits mailing list cfe

[clang-tools-extra] [clang-tidy] Fix bugprone-tagged-union-member-count false-positive (PR #135831)

2025-04-24 Thread Baranov Victor via cfe-commits
=?utf-8?b?R8OhYm9yIFTDs3RodsOhcmk=?=,=?utf-8?b?R8OhYm9yIFTDs3RodsOhcmk=?=, =?utf-8?b?R8OhYm9yIFTDs3RodsOhcmk=?Message-ID: In-Reply-To: https://github.com/vbvictor commented: LGMT, with nit. Please wait for a review from someone with write access who will help merge this PR. https://github.com

[clang-tools-extra] Enforce SL.con.3: Add check to replace operator[] with at() [Cont.] (PR #95220)

2025-04-10 Thread Baranov Victor via cfe-commits
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

<    1   2   3   4   5   6   7   >