[clang-tools-extra] [clang-tidy][clangd] Fixed removeFunctionArgs don't remove comma for use-ranges check (PR #118568)

2025-05-24 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor edited https://github.com/llvm/llvm-project/pull/118568 ___ 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 false positives with deducing this in `readability-convert-member-functions-to-static` check (PR #141391)

2025-05-24 Thread Baranov Victor via cfe-commits
@@ -0,0 +1,14 @@ +// RUN: %check_clang_tidy -std=c++23 %s readability-convert-member-functions-to-static %t + +namespace std{ + class string {}; + void println(const char *format, const std::string &str) {} +} + +namespace PR141381 { +struct Hello { + std::string str_; + + vo

[clang-tools-extra] [clang-tidy] Fix false positives with deducing this in `readability-convert-member-functions-to-static` check (PR #141391)

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

[clang-tools-extra] [clang-tidy][clangd] Fixed removeFunctionArgs don't remove comma for use-ranges check (PR #118568)

2025-05-24 Thread Baranov Victor via cfe-commits
@@ -148,6 +148,9 @@ New check aliases Changes in existing checks ^^ +- Improved :doc:`boost-use-ranges + ` check to more precisely remove comma. vbvictor wrote: In discussion, I saw that we don't need release notes for this change. Ho

[clang-tools-extra] [clang-tidy][clangd] Fixed removeFunctionArgs don't remove comma for use-ranges check (PR #118568)

2025-05-24 Thread Baranov Victor via cfe-commits
@@ -164,6 +165,24 @@ void UseRangesCheck::registerMatchers(MatchFinder *Finder) { static void removeFunctionArgs(DiagnosticBuilder &Diag, const CallExpr &Call, ArrayRef Indexes, const ASTContext &Ctx) { + const aut

[clang-tools-extra] [clang-tidy] Fix false positives with deducing this in `readability-convert-member-functions-to-static` check (PR #141391)

2025-05-24 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor edited https://github.com/llvm/llvm-project/pull/141391 ___ 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] Refactor `modernize-use-trailing-return-type-check` check code and tests (PR #140759)

2025-05-24 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor closed https://github.com/llvm/llvm-project/pull/140759 ___ 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 false positives in `bugprone-crtp-constructor-accessibility` check (PR #132543)

2025-05-24 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor updated https://github.com/llvm/llvm-project/pull/132543 >From a23fa792a3929882cd7b496e9027cbed6a3e7dc2 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

[clang-tools-extra] [clang-tidy] detect arithmetic operations within member list initialization in modernize-use-default-member-init check (PR #129370)

2025-05-24 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor closed https://github.com/llvm/llvm-project/pull/129370 ___ 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 check 'bugprone-function-visibility-change' (PR #140086)

2025-05-24 Thread Baranov Victor via cfe-commits
=?utf-8?q?Balázs_Kéri?= , =?utf-8?q?Balázs_Kéri?= Message-ID: In-Reply-To: https://github.com/vbvictor edited https://github.com/llvm/llvm-project/pull/140086 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mail

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

2025-05-27 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 check for assignment or comparision operators' operand in `readability-math-missing-parentheses` (PR #141345)

2025-05-27 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor approved this pull request. LGTM https://github.com/llvm/llvm-project/pull/141345 ___ 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 (PR #134188)

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

[clang] [clang][ASTMatchers][NFC] fix typos in AST-matchers docs. (PR #141307)

2025-05-27 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor closed https://github.com/llvm/llvm-project/pull/141307 ___ 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 (PR #134188)

2025-05-27 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor edited https://github.com/llvm/llvm-project/pull/134188 ___ 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 (PR #134188)

2025-05-27 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor requested changes to this pull request. Need to add tests that will cover all cases after introduction of `callExpr` matcher. https://github.com/llvm/llvm-project/pull/134188 ___ cfe-commits mailing list cfe-commits@lists.l

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

2025-05-27 Thread Baranov Victor via cfe-commits
@@ -39,9 +39,11 @@ 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(hasCanoni

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

2025-05-27 Thread Baranov Victor via cfe-commits
@@ -121,3 +121,29 @@ int AllComparisons() { return 0; } + +namespace PR127471 { +int getSignedValue(); vbvictor wrote: Can we add a test with a member function call (like in description of the PR) https://github.com/llvm/llvm-project/pull/134188

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

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

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

2025-05-27 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-05-27 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-05-27 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] [clang][AST][NFC] fix spelling typos in clang AST files (PR #141346)

2025-05-27 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor closed https://github.com/llvm/llvm-project/pull/141346 ___ 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 formatting and add release notes entry (PR #141584)

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

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

2025-05-27 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-05-27 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-05-27 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-05-27 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-05-27 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-05-27 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-05-27 Thread Baranov Victor via cfe-commits
=��___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

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

2025-05-27 Thread Baranov Victor via cfe-commits
=��___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

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

2025-05-27 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-05-27 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-05-27 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] properly handle private move constructors in `modernize-pass-by-value` check (PR #141304)

2025-05-23 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor created https://github.com/llvm/llvm-project/pull/141304 Fixed false positives when class passed by const-reference had a private move constructor, which could not be used for a fix-it. >From fea5b6609391e6dc9d33777640ff98df1b54fecf Mon Sep 17 00:00:00 2001 From: Ba

[clang-tools-extra] [clang-tidy] properly handle private move constructors in `modernize-pass-by-value` check (PR #141304)

2025-05-23 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor updated https://github.com/llvm/llvm-project/pull/141304 >From fea5b6609391e6dc9d33777640ff98df1b54fecf Mon Sep 17 00:00:00 2001 From: Baranov Victor Date: Sat, 17 May 2025 18:40:54 +0300 Subject: [PATCH 1/5] [clang-tidy] Add isFriendOfClass helper function for Pass

[clang-tools-extra] [clang-tidy] properly handle private move constructors in `modernize-pass-by-value` check (PR #141304)

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

[clang] [ASTMatchers][NFC] fix typos in AST-matchers docs. (PR #141307)

2025-05-23 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor created https://github.com/llvm/llvm-project/pull/141307 Found these typos using [CSpell](https://cspell.org/) utility. >From 4ee68d62a21f75110b9406c86c9c059b1c2a840d Mon Sep 17 00:00:00 2001 From: Baranov Victor Date: Sat, 24 May 2025 03:17:57 +0300 Subject: [PATCH

[clang-tools-extra] [clang-tidy] Added check 'bugprone-function-visibility-change' (PR #140086)

2025-05-23 Thread Baranov Victor via cfe-commits
___ 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 check 'bugprone-function-visibility-change' (PR #140086)

2025-05-23 Thread Baranov Victor via cfe-commits
=?utf-8?q?Balázs_Kéri?= , =?utf-8?q?Balázs_Kéri?= Message-ID: In-Reply-To: @@ -0,0 +1,136 @@ +//===--- FunctionVisibilityChangeCheck.cpp - clang-tidy ---===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https:/

[clang-tools-extra] [clang-tidy] Added check 'bugprone-function-visibility-change' (PR #140086)

2025-05-23 Thread Baranov Victor via cfe-commits
=?utf-8?q?Balázs_Kéri?= , =?utf-8?q?Balázs_Kéri?= Message-ID: In-Reply-To: @@ -124,6 +124,11 @@ New checks pointer and store it as class members without handle the copy and move constructors and the assignments. +- New :doc:`bugprone-function-visibility-change + ` chec

[clang-tools-extra] [clang-tidy] Add performance-bool-bitwise-operation check (PR #142324)

2025-06-02 Thread Baranov Victor via cfe-commits
@@ -0,0 +1,200 @@ +//===--- BoolBitwiseOperationCheck.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] Added Conflicting Global Accesses checker (PR #130421)

2025-06-01 Thread Baranov Victor via cfe-commits
@@ -0,0 +1,72 @@ +.. title:: clang-tidy - bugprone-conflicting-global-accesses + +bugprone-conflicting-global-accesses + + +Finds conflicting accesses on global variables. + +Modifying twice or reading and modifying a memory location without a +

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

2025-06-01 Thread Baranov Victor via cfe-commits
@@ -0,0 +1,72 @@ +.. title:: clang-tidy - bugprone-conflicting-global-accesses + +bugprone-conflicting-global-accesses + + +Finds conflicting accesses on global variables. + +Modifying twice or reading and modifying a memory location without a +

[clang-tools-extra] [clang-tidy] Add check performance-lost-std-move (PR #139525)

2025-06-01 Thread Baranov Victor via cfe-commits
@@ -0,0 +1,32 @@ +.. title:: clang-tidy - performance-lost-std-move + +performance-lost-std-move += + +Warns if copy constructor is used instead of std::move() and suggests a fix. +It honours cycles, lambdas, and unspecified call order in compound expressio

[clang-tools-extra] [clang-tidy] Add check performance-lost-std-move (PR #139525)

2025-06-01 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor edited https://github.com/llvm/llvm-project/pull/139525 ___ 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 performance-lost-std-move (PR #139525)

2025-06-01 Thread Baranov Victor via cfe-commits
@@ -0,0 +1,32 @@ +.. title:: clang-tidy - performance-lost-std-move + +performance-lost-std-move += + +Warns if copy constructor is used instead of std::move() and suggests a fix. +It honours cycles, lambdas, and unspecified call order in compound expressio

[clang-tools-extra] [clang-tidy] Add performance-bool-bitwise-operation check (PR #142324)

2025-06-02 Thread Baranov Victor via cfe-commits
@@ -0,0 +1,40 @@ +.. title:: clang-tidy - performance-bool-bitwise-operation + +performance-bool-bitwise-operation +== + +Finds potentially inefficient use of bitwise operators such as ``&``, +``|`` and their compound analogues on boolean values wh

[clang-tools-extra] [clang-tidy] Add performance-bool-bitwise-operation check (PR #142324)

2025-06-02 Thread Baranov Victor via cfe-commits
@@ -0,0 +1,200 @@ +//===--- BoolBitwiseOperationCheck.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 performance-bool-bitwise-operation check (PR #142324)

2025-06-02 Thread Baranov Victor via cfe-commits
@@ -0,0 +1,40 @@ +.. title:: clang-tidy - performance-bool-bitwise-operation + +performance-bool-bitwise-operation +== + +Finds potentially inefficient use of bitwise operators such as ``&``, +``|`` and their compound analogues on boolean values wh

[clang-tools-extra] [clang-tidy] Add performance-bool-bitwise-operation check (PR #142324)

2025-06-02 Thread Baranov Victor via cfe-commits
@@ -0,0 +1,38 @@ +//===--- BoolBitwiseOperationCheck.h - clang-tidy ---*- C++ -*-===// +// +// 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 performance-bool-bitwise-operation check (PR #142324)

2025-06-02 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor edited https://github.com/llvm/llvm-project/pull/142324 ___ 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 performance-bool-bitwise-operation check (PR #142324)

2025-06-02 Thread Baranov Victor via cfe-commits
@@ -0,0 +1,200 @@ +//===--- BoolBitwiseOperationCheck.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 performance-bool-bitwise-operation check (PR #142324)

2025-06-02 Thread Baranov Victor via cfe-commits
@@ -0,0 +1,200 @@ +//===--- BoolBitwiseOperationCheck.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 performance-bool-bitwise-operation check (PR #142324)

2025-06-02 Thread Baranov Victor via cfe-commits
@@ -0,0 +1,200 @@ +//===--- BoolBitwiseOperationCheck.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 performance-bool-bitwise-operation check (PR #142324)

2025-06-02 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor commented: Left some general feedback, mostly docs/wording suggestions. For ease of review in the future, may you try to make `BoolBitwiseOperationCheck::check` function easier to read. E.g. extract some helper functions like `HasVolatileOrSideEffects`, `GetTranslat

[clang-tools-extra] [clang-tidy] Add performance-bool-bitwise-operation check (PR #142324)

2025-06-02 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor edited https://github.com/llvm/llvm-project/pull/142324 ___ 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 performance-bool-bitwise-operation check (PR #142324)

2025-06-02 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor edited https://github.com/llvm/llvm-project/pull/142324 ___ 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 false negatives with type aliases in `cppcoreguidlines-pro-bounds-pointer-arithmetic` check (PR #139430)

2025-05-29 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor updated https://github.com/llvm/llvm-project/pull/139430 >From 5236d19483bbde755d0595c01ba2607031b69568 Mon Sep 17 00:00:00 2001 From: Baranov Victor Date: Sun, 11 May 2025 05:22:55 +0300 Subject: [PATCH] [clang-tidy] fix false positives with type aliases in pro-bou

[clang-tools-extra] [clang-tidy] fix false negatives with type aliases in `cppcoreguidlines-pro-bounds-pointer-arithmetic` check (PR #139430)

2025-05-29 Thread Baranov Victor via cfe-commits
vbvictor wrote: rebase + Ping https://github.com/llvm/llvm-project/pull/139430 ___ 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 Conflicting Global Accesses checker (PR #130421)

2025-06-01 Thread Baranov Victor via cfe-commits
@@ -0,0 +1,72 @@ +.. title:: clang-tidy - bugprone-conflicting-global-accesses + +bugprone-conflicting-global-accesses + + +Finds conflicting accesses on global variables. vbvictor wrote: "conflicting" may not be very meaningfu

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

2025-06-01 Thread Baranov Victor via cfe-commits
@@ -0,0 +1,72 @@ +.. title:: clang-tidy - bugprone-conflicting-global-accesses + +bugprone-conflicting-global-accesses + + +Finds conflicting accesses on global variables. + +Modifying twice or reading and modifying a memory location without a +

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

2025-06-01 Thread Baranov Victor via cfe-commits
@@ -151,6 +157,14 @@ New checks New check aliases ^ +- New `cert-exp30-c ` alias for vbvictor wrote: Please create entries in `docs/` folder for these aliases, they should have filling like this: https://github.com/llvm/llvm-project/blob/mai

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

2025-06-01 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor edited https://github.com/llvm/llvm-project/pull/130421 ___ 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 Conflicting Global Accesses checker (PR #130421)

2025-06-01 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor commented: Mostly left comments in docs about general improvements. Didn't look closely at the code, but here are some general recommendations that you should do before major review: There are a lot of new code that is relatively hard to review, you should try to f

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

2025-06-01 Thread Baranov Victor via cfe-commits
@@ -0,0 +1,72 @@ +.. title:: clang-tidy - bugprone-conflicting-global-accesses + +bugprone-conflicting-global-accesses + + +Finds conflicting accesses on global variables. + +Modifying twice or reading and modifying a memory location without a +

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

2025-06-01 Thread Baranov Victor via cfe-commits
@@ -0,0 +1,72 @@ +.. title:: clang-tidy - bugprone-conflicting-global-accesses + +bugprone-conflicting-global-accesses + + +Finds conflicting accesses on global variables. + +Modifying twice or reading and modifying a memory location without a +

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

2025-06-01 Thread Baranov Victor via cfe-commits
@@ -0,0 +1,72 @@ +.. title:: clang-tidy - bugprone-conflicting-global-accesses + +bugprone-conflicting-global-accesses + + +Finds conflicting accesses on global variables. + +Modifying twice or reading and modifying a memory location without a +

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

2025-06-01 Thread Baranov Victor via cfe-commits
@@ -0,0 +1,72 @@ +.. title:: clang-tidy - bugprone-conflicting-global-accesses + +bugprone-conflicting-global-accesses + + +Finds conflicting accesses on global variables. + +Modifying twice or reading and modifying a memory location without a +

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

2025-06-01 Thread Baranov Victor via cfe-commits
@@ -9,15 +9,16 @@ #include #include +#include namespace absl { // Use const char * for the format since the real type is hard to mock up. vbvictor wrote: Unnecessary comment for now? https://github.com/llvm/llvm-project/pull/142312 __

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

2025-06-01 Thread Baranov Victor via cfe-commits
@@ -16,8 +16,8 @@ namespace absl { -template -std::string StrFormat(const S &format, const Args&... args); +template +std::string StrFormat(const std::string &format, const Args&... args); vbvictor wrote: Shouldn't this also be a `std::string_view`? ```sugg

[clang-tools-extra] [clang-tidy] Add check for assignment or comparision operators' operand in `readability-math-missing-parentheses` (PR #141345)

2025-06-04 Thread Baranov Victor via cfe-commits
vbvictor wrote: @flovent, please change email from private to public in github settings If you wish to have actual email written in commit. https://github.com/llvm/llvm-project/pull/141345 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https:

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

2025-06-03 Thread Baranov Victor via cfe-commits
vbvictor wrote: Could this PR be closed? @sebwolf-de, @paulhdk It can be reopened later if needed https://github.com/llvm/llvm-project/pull/90043 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cf

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

2025-06-17 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor updated https://github.com/llvm/llvm-project/pull/126434 >From 81a21a90e03e4b9cea58d6bcffddf3bde0f82710 Mon Sep 17 00:00:00 2001 From: Victor Baranov Date: Mon, 3 Mar 2025 09:25:03 +0300 Subject: [PATCH 01/12] [clang-tidy] add scoped-lock-check --- .../clang-tidy/m

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

2025-06-17 Thread Baranov Victor via cfe-commits
vbvictor wrote: Rebased + ping @PiotrZSL. I'd merge it at the end of the month if there would be no more reviews. https://github.com/llvm/llvm-project/pull/126434 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/ma

[clang] [Clang] Fix '-Wformat-overflow' FP when floats had field-width and plus prefix (PR #144274)

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

[clang] [Clang] Fix '-Wformat-overflow' FP when floats had field-width and plus prefix (PR #144274)

2025-06-17 Thread Baranov Victor via cfe-commits
@@ -43,6 +43,11 @@ void call_snprintf(double d, int n, int *ptr) { __builtin_snprintf(node_name, sizeof(node_name), "%pOFn", ptr); // nonkprintf-warning {{'snprintf' will always be truncated; specified size is 6, but format string expands to at least 7}} __builtin_snprintf

[clang] [Clang] Fix '-Wformat-overflow' FP when floats had field-width and plus prefix (PR #144274)

2025-06-17 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor updated https://github.com/llvm/llvm-project/pull/144274 >From 98fc81696400be2ea990d867375530ef3f544b82 Mon Sep 17 00:00:00 2001 From: Victor Baranov Date: Sun, 15 Jun 2025 22:20:54 +0300 Subject: [PATCH 1/3] [Clang] Fix '-Wformat-overflow' FP when floats had field-

[clang] [Clang] Fix '-Wformat-overflow' FP when floats had field-width and plus prefix (PR #144274)

2025-06-17 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor edited https://github.com/llvm/llvm-project/pull/144274 ___ 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 false negatives with type aliases in `cppcoreguidlines-pro-bounds-pointer-arithmetic` check (PR #139430)

2025-06-18 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor updated https://github.com/llvm/llvm-project/pull/139430 >From a5e4fbcf644279ad002f55f9f6ed506d7ab764a4 Mon Sep 17 00:00:00 2001 From: Baranov Victor Date: Sun, 11 May 2025 05:22:55 +0300 Subject: [PATCH] [clang-tidy] fix false positives with type aliases in pro-bou

[clang-tools-extra] [clang-tidy] fix false negatives with type aliases in `cppcoreguidlines-pro-bounds-pointer-arithmetic` check (PR #139430)

2025-06-18 Thread Baranov Victor via cfe-commits
vbvictor wrote: rebased + ping https://github.com/llvm/llvm-project/pull/139430 ___ 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 option to keep virtual in 'modernize-use-override' (PR #144916)

2025-06-19 Thread Baranov Victor via cfe-commits
@@ -0,0 +1,25 @@ +// RUN: %check_clang_tidy %s modernize-use-override %t -- \ +// RUN: -config="{CheckOptions: {modernize-use-override.AllowVirtual: true}}" + +struct Base { + virtual ~Base(); + virtual void a(); + virtual void b(); + virtual void c(); +}; + +struct Derived

[clang-tools-extra] [clang-tidy] Add option to keep virtual in 'modernize-use-override' (PR #144916)

2025-06-19 Thread Baranov Victor via cfe-commits
@@ -0,0 +1,25 @@ +// RUN: %check_clang_tidy %s modernize-use-override %t -- \ +// RUN: -config="{CheckOptions: {modernize-use-override.AllowVirtual: true}}" + +struct Base { + virtual ~Base(); + virtual void a(); + virtual void b(); + virtual void c(); +}; + +struct Derived

[clang-tools-extra] [clang-tidy] Add option to keep virtual in 'modernize-use-override' (PR #144916)

2025-06-19 Thread Baranov Victor via cfe-commits
@@ -0,0 +1,25 @@ +// RUN: %check_clang_tidy %s modernize-use-override %t -- \ +// RUN: -config="{CheckOptions: {modernize-use-override.AllowVirtual: true}}" + +struct Base { + virtual ~Base(); + virtual void a(); + virtual void b(); + virtual void c(); +}; + +struct Derived

[clang-tools-extra] [clang-tidy] Add option to keep virtual in 'modernize-use-override' (PR #144916)

2025-06-19 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor edited https://github.com/llvm/llvm-project/pull/144916 ___ 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 option to keep virtual in 'modernize-use-override' (PR #144916)

2025-06-19 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor requested changes to this pull request. Please add your change to ReleaseNotes.rst https://github.com/llvm/llvm-project/pull/144916 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mail

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

2025-06-18 Thread Baranov Victor via cfe-commits
vbvictor wrote: Ping @HerrCai0907 @PiotrZSL @carlosgalvezp 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] support query based custom check (PR #131804)

2025-06-18 Thread Baranov Victor via cfe-commits
@@ -0,0 +1,63 @@ + +Query Based Custom Clang-Tidy Checks + + +Introduction + + +This page provides examples of how to add query based custom checks for +:program:`clang-tidy`. + +Custom checks are

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

2025-06-16 Thread Baranov Victor via cfe-commits
vbvictor wrote: > At the moment of the previous PR, there was a concern about configurability > of check I think I was about adding an option to configure list of optional classes. Probably `OptionalClasses` or similar. I haven't seen issues about it, so it may not be a high priority. https:/

[clang-tools-extra] [clang-tidy] support query based custom check (PR #131804)

2025-06-16 Thread Baranov Victor via cfe-commits
@@ -104,7 +104,14 @@ Improvements to clang-tidy clauses. Added a ``--match-partial-fixes`` option to keep previous behavior on specific tests. This may break tests for users with custom out-of-tree checks who use :program:`check_clang_tidy.py` as-is. - +- :program:`clang

[clang-tools-extra] [clang-tidy] support query based custom check (PR #131804)

2025-06-15 Thread Baranov Victor via cfe-commits
@@ -0,0 +1,111 @@ +//===--- QueryCheck.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] support query based custom check (PR #131804)

2025-06-15 Thread Baranov Victor via cfe-commits
@@ -0,0 +1,111 @@ +//===--- QueryCheck.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] support query based custom check (PR #131804)

2025-06-15 Thread Baranov Victor via cfe-commits
@@ -17,6 +18,7 @@ #include "llvm/Support/MemoryBufferRef.h" #include "llvm/Support/VirtualFileSystem.h" #include +#include vbvictor wrote: Is this include needed? https://github.com/llvm/llvm-project/pull/131804 _

[clang-tools-extra] [clang-tidy] support query based custom check (PR #131804)

2025-06-15 Thread Baranov Victor via cfe-commits
@@ -104,7 +104,14 @@ Improvements to clang-tidy clauses. Added a ``--match-partial-fixes`` option to keep previous behavior on specific tests. This may break tests for users with custom out-of-tree checks who use :program:`check_clang_tidy.py` as-is. - +- :program:`clang

[clang-tools-extra] [clang-tidy] support query based custom check (PR #131804)

2025-06-15 Thread Baranov Victor via cfe-commits
@@ -62,6 +62,8 @@ class ClangTidyCheckFactories { }); } + void erase(llvm::StringRef CheckName) { Factories.erase(CheckName); } vbvictor wrote: ```suggestion void eraseCheck(llvm::StringRef CheckName) { Factories.erase(CheckName)

[clang-tools-extra] [clang-tidy] support query based custom check (PR #131804)

2025-06-15 Thread Baranov Victor via cfe-commits
@@ -0,0 +1,111 @@ +//===--- QueryCheck.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] support query based custom check (PR #131804)

2025-06-15 Thread Baranov Victor via cfe-commits
@@ -0,0 +1,50 @@ +#include "../ClangTidy.h" +#include "../ClangTidyModule.h" +#include "../ClangTidyModuleRegistry.h" +#include "../ClangTidyOptions.h" +#include "QueryCheck.h" +#include "llvm/ADT/SmallSet.h" +#include "llvm/ADT/SmallString.h" +#include "llvm/ADT/StringRef.h" +#in

[clang-tools-extra] [clang-tidy] support query based custom check (PR #131804)

2025-06-15 Thread Baranov Victor via cfe-commits
@@ -0,0 +1,111 @@ +//===--- QueryCheck.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] support query based custom check (PR #131804)

2025-06-15 Thread Baranov Victor via cfe-commits
@@ -0,0 +1,111 @@ +//===--- QueryCheck.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

<    2   3   4   5   6   7   8   9   10   11   >