[clang-tools-extra] [clang-tidy] Add modernize-make-direct check (PR #118120)

2025-09-22 Thread Victor Chernyakin via cfe-commits
https://github.com/localspook edited https://github.com/llvm/llvm-project/pull/118120 ___ 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 bugprone-default-lambda-capture (PR #160150)

2025-09-22 Thread Victor Chernyakin via cfe-commits
@@ -0,0 +1,40 @@ +//===--===// +// +// 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: Apac

[clang-tools-extra] [clang-tidy] Add new check `modernize-use-structured-binding` (PR #158462)

2025-09-22 Thread Victor Chernyakin via cfe-commits
@@ -0,0 +1,34 @@ +//===--===// +// +// 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: Apac

[clang-tools-extra] [clang-tidy] Fix `modernize-use-nullptr` crash on 32-bit Windows (PR #160023)

2025-09-22 Thread Victor Chernyakin via cfe-commits
localspook wrote: Ah, no worries then! https://github.com/llvm/llvm-project/pull/160023 ___ 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 bugprone-default-lambda-capture (PR #160150)

2025-09-22 Thread Victor Chernyakin via cfe-commits
https://github.com/localspook edited https://github.com/llvm/llvm-project/pull/160150 ___ 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] http -> https (PR #160128)

2025-09-22 Thread Victor Chernyakin via cfe-commits
@@ -43,7 +43,7 @@ static bool isValidDatePattern(StringRef Pattern) { // Checks if the string pattern used as a date format specifier contains // any incorrect pattern and reports it as a warning. -// See: http://www.unicode.org/reports/tr35/tr35-dates.html#Date_Format_Patter

[clang-tools-extra] [clang-tidy][NFC] http -> https (PR #160128)

2025-09-22 Thread Victor Chernyakin via cfe-commits
https://github.com/localspook closed https://github.com/llvm/llvm-project/pull/160128 ___ 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 bugprone-default-lambda-capture (PR #160150)

2025-09-22 Thread Victor Chernyakin via cfe-commits
@@ -0,0 +1,40 @@ +//===--===// +// +// 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: Apac

[clang-tools-extra] [clang-tidy] Add new check `modernize-use-structured-binding` (PR #158462)

2025-09-22 Thread Victor Chernyakin via cfe-commits
@@ -0,0 +1,410 @@ +//===--===// +// +// 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 clang tidy check performance constexpr non static in scope (PR #147809)

2025-09-22 Thread Victor Chernyakin via cfe-commits
@@ -0,0 +1,37 @@ +//===--- ConstexprNonStaticInScopeCheck.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 check 'bugprone-cast-to-struct' (PR #153428)

2025-09-22 Thread Victor Chernyakin 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?= , =?utf-8?q?Balázs_Kéri?= , =?utf-8?q?Balázs_Kéri?= Message-ID: In-Reply-To: @@ -0,0 +1,39 @@ +//===--- CastToStructCheck.h - clang-tidy ---*- C++ -*-===//

[clang-tools-extra] [clang-tidy] Add check 'bugprone-cast-to-struct' (PR #153428)

2025-09-22 Thread Victor Chernyakin 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?= , =?utf-8?q?Balázs_Kéri?= , =?utf-8?q?Balázs_Kéri?= Message-ID: In-Reply-To: @@ -0,0 +1,39 @@ +//===--- CastToStructCheck.h - clang-tidy ---*- C++ -*-===//

[clang-tools-extra] [clang-tidy] Add check 'bugprone-cast-to-struct' (PR #153428)

2025-09-22 Thread Victor Chernyakin 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?= , =?utf-8?q?Balázs_Kéri?= , =?utf-8?q?Balázs_Kéri?= Message-ID: In-Reply-To: @@ -0,0 +1,97 @@ +//===--- CastToStructCheck.cpp - clang-tidy ---===//

[clang-tools-extra] [clang-tidy][NFC] http -> https (PR #160128)

2025-09-22 Thread Victor Chernyakin via cfe-commits
localspook wrote: > Please also fix clang-tools-extra/clang-tidy/add_new_check.py. It's included in the changes, yep https://github.com/llvm/llvm-project/pull/160128 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bi

[clang-tools-extra] [clang-tidy][NFC] http -> https (PR #160128)

2025-09-22 Thread Victor Chernyakin via cfe-commits
https://github.com/localspook deleted https://github.com/llvm/llvm-project/pull/160128 ___ 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 `modernize-use-nullptr` crash on 32-bit Windows (PR #160023)

2025-09-22 Thread Victor Chernyakin via cfe-commits
localspook wrote: Sorry if I wasn't clear; I have a local x86 build of clang-tidy, I've verified locally that all those fixes work https://github.com/llvm/llvm-project/pull/160023 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.l

[clang-tools-extra] [clang-tidy] Fix `modernize-use-nullptr` crash on 32-bit Windows (PR #160023)

2025-09-22 Thread Victor Chernyakin via cfe-commits
https://github.com/localspook updated https://github.com/llvm/llvm-project/pull/160023 >From 4071d5e2e717d03810ec8d0f7476253d1bb72ee1 Mon Sep 17 00:00:00 2001 From: Victor Chernyakin Date: Sun, 21 Sep 2025 19:15:46 -0700 Subject: [PATCH 1/4] [clang-tidy] Fix `modernize-use-nullptr` crash on 32-

[clang-tools-extra] [clang-tidy] Fix `modernize-use-nullptr` crash on 32-bit Windows (PR #160023)

2025-09-22 Thread Victor Chernyakin via cfe-commits
localspook wrote: > LGTM, wish we could automatically detect that because this is very easy to > miss. Could we maybe remove & from tuple to always store values. cc @AaronBallman as maintainer of AST matchers https://github.com/llvm/llvm-project/pull/160023

[clang-tools-extra] [clang-tidy] Fix `modernize-use-nullptr` crash on 32-bit Windows (PR #160023)

2025-09-21 Thread Victor Chernyakin via cfe-commits
https://github.com/localspook updated https://github.com/llvm/llvm-project/pull/160023 >From 4071d5e2e717d03810ec8d0f7476253d1bb72ee1 Mon Sep 17 00:00:00 2001 From: Victor Chernyakin Date: Sun, 21 Sep 2025 19:15:46 -0700 Subject: [PATCH 1/3] [clang-tidy] Fix `modernize-use-nullptr` crash on 32-

[clang-tools-extra] [clang-tidy] add readability-redundant-parentheses (PR #159911)

2025-09-21 Thread Victor Chernyakin via cfe-commits
localspook wrote: > > Clang-format has [an option like > > this](https://clang.llvm.org/docs/ClangFormatStyleOptions.html#removeparentheses) > > already. Unlike clang-format, we have full semantic information, so this > > check has the potential to be more reliable, but I’m concerned about >

[clang-tools-extra] [clang-tidy] Fix `modernize-use-nullptr` crash on 32-bit Windows (PR #160023)

2025-09-21 Thread Victor Chernyakin via cfe-commits
https://github.com/localspook updated https://github.com/llvm/llvm-project/pull/160023 >From 4071d5e2e717d03810ec8d0f7476253d1bb72ee1 Mon Sep 17 00:00:00 2001 From: Victor Chernyakin Date: Sun, 21 Sep 2025 19:15:46 -0700 Subject: [PATCH 1/2] [clang-tidy] Fix `modernize-use-nullptr` crash on 32-

[clang-tools-extra] [clang-tidy] Fix `modernize-use-nullptr` crash on 32-bit Windows (PR #160023)

2025-09-21 Thread Victor Chernyakin via cfe-commits
localspook wrote: I keep forgetting to do that >_< https://github.com/llvm/llvm-project/pull/160023 ___ 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] Enable `readability-convert-member-functions-to-static` in the codebase (PR #156265)

2025-09-20 Thread Victor Chernyakin via cfe-commits
localspook wrote: In that case, closing this PR and the attached issue as not planned https://github.com/llvm/llvm-project/pull/156265 ___ 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] Construct map at compile time (PR #158166)

2025-09-20 Thread Victor Chernyakin via cfe-commits
@@ -39,31 +32,17 @@ truncateIfIntegral(const FloatingLiteral &FloatLiteral) { const std::pair & getDurationInverseForScale(DurationScale Scale) { - static const llvm::IndexedMap, -DurationScale2IndexFunctor> - InverseMap = []() { -

[clang-tools-extra] [clang-tidy][mlir] Expand to cover pointer of builder (PR #159423)

2025-09-20 Thread Victor Chernyakin via cfe-commits
https://github.com/localspook edited https://github.com/llvm/llvm-project/pull/159423 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy][mlir] Expand to cover pointer of builder (PR #159423)

2025-09-20 Thread Victor Chernyakin via cfe-commits
https://github.com/localspook edited https://github.com/llvm/llvm-project/pull/159423 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy][mlir] Expand to cover pointer of builder (PR #159423)

2025-09-20 Thread Victor Chernyakin via cfe-commits
https://github.com/localspook edited https://github.com/llvm/llvm-project/pull/159423 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy][mlir] Expand to cover pointer of builder (PR #159423)

2025-09-20 Thread Victor Chernyakin via cfe-commits
@@ -40,13 +48,24 @@ void g(mlir::OpBuilder &b) { b.create(b.getUnknownLoc(), "gaz"); } +class CustomBuilder : public mlir::ImplicitLocOpBuilder { +public: + mlir::NamedOp f(const char *name) { +// CHECK-MESSAGES: :[[@LINE+2]]:12: warning: use 'OpType::create(builder, .

[clang-tools-extra] [clang-tidy] add readability-redundant-parentheses (PR #159911)

2025-09-20 Thread Victor Chernyakin via cfe-commits
localspook wrote: Clang-format has [an option like this](https://clang.llvm.org/docs/ClangFormatStyleOptions.html#removeparentheses) already. Unlike clang-format, we have full semantic information, so this check has the potential to be more reliable, but I’m concerned about duplicating funct

[clang-tools-extra] [clang-tidy][mlir] Expand to cover pointer of builder (PR #159423)

2025-09-19 Thread Victor Chernyakin via cfe-commits
@@ -114,19 +123,17 @@ RewriteRuleWith useNewMlirOpBuilderCheckRule() { Stencil message = cat("use 'OpType::create(builder, ...)' instead of " "'builder.create(...)'"); // Match a create call on an OpBuilder. - ast_matchers::internal::Matcher base =

[clang-tools-extra] [clang-tidy] Fix `bugprone-sizeof-expression` crash on arrays of dependent type (PR #159701)

2025-09-19 Thread Victor Chernyakin via cfe-commits
https://github.com/localspook closed https://github.com/llvm/llvm-project/pull/159701 ___ 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-sizeof-expression` crash on arrays of dependent type (PR #159701)

2025-09-19 Thread Victor Chernyakin via cfe-commits
https://github.com/localspook updated https://github.com/llvm/llvm-project/pull/159701 >From 4be37e6a2d9964238ff6d67f5ea2883c79123c84 Mon Sep 17 00:00:00 2001 From: Victor Chernyakin Date: Fri, 19 Sep 2025 04:26:30 + Subject: [PATCH 1/4] [clang-tidy] Fix `bugprone-sizeof-expression` crash o

[clang-tools-extra] [clang-tidy] Fix `bugprone-sizeof-expression` crash on arrays of dependent type (PR #159701)

2025-09-18 Thread Victor Chernyakin via cfe-commits
https://github.com/localspook updated https://github.com/llvm/llvm-project/pull/159701 >From 4be37e6a2d9964238ff6d67f5ea2883c79123c84 Mon Sep 17 00:00:00 2001 From: Victor Chernyakin Date: Fri, 19 Sep 2025 04:26:30 + Subject: [PATCH 1/3] [clang-tidy] Fix `bugprone-sizeof-expression` crash o

[clang-tools-extra] [clang-tidy] Fix `bugprone-sizeof-expression` crash on arrays of dependent type (PR #159701)

2025-09-18 Thread Victor Chernyakin via cfe-commits
https://github.com/localspook updated https://github.com/llvm/llvm-project/pull/159701 >From 4be37e6a2d9964238ff6d67f5ea2883c79123c84 Mon Sep 17 00:00:00 2001 From: Victor Chernyakin Date: Fri, 19 Sep 2025 04:26:30 + Subject: [PATCH 1/2] [clang-tidy] Fix `bugprone-sizeof-expression` crash o

[clang-tools-extra] [clang-tidy][NFC] Enable `readability-convert-member-functions-to-static` in the codebase (PR #156265)

2025-09-18 Thread Victor Chernyakin via cfe-commits
https://github.com/localspook closed https://github.com/llvm/llvm-project/pull/156265 ___ 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] Construct map at compile time (PR #158166)

2025-09-17 Thread Victor Chernyakin via cfe-commits
https://github.com/localspook closed https://github.com/llvm/llvm-project/pull/158166 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] Add clang tidy check performance constexpr non static in scope (PR #147809)

2025-09-17 Thread Victor Chernyakin via cfe-commits
@@ -0,0 +1,45 @@ +//===--- ConstexprNonStaticInScopeCheck.cpp - clang-tidy --===// localspook wrote: We’ve switched to a new file header style: ```suggestion //===--===// ``` h

[clang-tools-extra] Add clang tidy check performance constexpr non static in scope (PR #147809)

2025-09-17 Thread Victor Chernyakin via cfe-commits
@@ -0,0 +1,37 @@ +//===--- ConstexprNonStaticInScopeCheck.h - clang-tidy --*- C++ -*-===// localspook wrote: Ditto ```suggestion //===--===// ``` https://github.com/llvm/llvm-project/pu

[clang-tools-extra] [clang-tidy] New Option Invalid Enum Default Initialization (PR #159220)

2025-09-17 Thread Victor Chernyakin via cfe-commits
@@ -70,3 +70,8 @@ enum type) are set to 0. enum Enum1 Array3[2][2] = {{Enum1_A, Enum1_A}}; // warn: elements of second array are initialized to 0 struct Struct1 S1 = {1}; // warn: element 'b' is initialized to 0 + +.. option:: IgnoredContainers localspook

[clang-tools-extra] [clang-tidy] Enable `modernize-return-braced-init-list`'s tests in C++11 (PR #158196)

2025-09-17 Thread Victor Chernyakin via cfe-commits
@@ -1,4 +1,4 @@ -// RUN: %check_clang_tidy -std=c++14-or-later %s modernize-return-braced-init-list %t +// RUN: %check_clang_tidy %s modernize-return-braced-init-list %t localspook wrote: ```suggestion // RUN: %check_clang_tidy -std=c++11-or-later %s modernize-

[clang-tools-extra] [clang-tidy] Enable `modernize-return-braced-init-list`'s tests in C++11 (PR #158196)

2025-09-17 Thread Victor Chernyakin via cfe-commits
https://github.com/localspook deleted https://github.com/llvm/llvm-project/pull/158196 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy] New Option Invalid Enum Default Initialization (PR #159220)

2025-09-17 Thread Victor Chernyakin via cfe-commits
=?utf-8?q?Félix-Antoine?= Constantin, =?utf-8?q?Félix-Antoine?= Constantin Message-ID: In-Reply-To: @@ -88,12 +90,22 @@ class FindEnumMember : public TypeVisitor { InvalidEnumDefaultInitializationCheck::InvalidEnumDefaultInitializationCheck( StringRef Name, ClangTidyCont

[clang-tools-extra] [clang-tidy] Enable `modernize-return-braced-init-list`'s tests in C++11 (PR #158196)

2025-09-17 Thread Victor Chernyakin via cfe-commits
https://github.com/localspook closed https://github.com/llvm/llvm-project/pull/158196 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy] Enable `modernize-return-braced-init-list`'s tests in C++11 (PR #158196)

2025-09-17 Thread Victor Chernyakin via cfe-commits
localspook wrote: Added `-std=c++11-or-later`. If we want this to be a general policy, that all checks which require `LangOpts.CPlusPlus11` should specify `-std` explicitly, we'll need to fix a number of tests https://github.com/llvm/llvm-project/pull/158196 ___

[clang-tools-extra] [clang-tidy] Enable `modernize-return-braced-init-list`'s tests in C++11 (PR #158196)

2025-09-17 Thread Victor Chernyakin via cfe-commits
https://github.com/localspook updated https://github.com/llvm/llvm-project/pull/158196 >From 404ddb7f7bf62680bfc8fbd4d6306525ac9dd8a7 Mon Sep 17 00:00:00 2001 From: Victor Chernyakin Date: Thu, 11 Sep 2025 21:44:22 -0700 Subject: [PATCH 1/2] [clang-tidy] Enable `modernize-return-braced-init-lis

[clang-tools-extra] [clang-tidy] New Option Invalid Enum Default Initialization (PR #159220)

2025-09-17 Thread Victor Chernyakin via cfe-commits
@@ -70,3 +70,8 @@ enum type) are set to 0. enum Enum1 Array3[2][2] = {{Enum1_A, Enum1_A}}; // warn: elements of second array are initialized to 0 struct Struct1 S1 = {1}; // warn: element 'b' is initialized to 0 + +.. option:: IgnoredContainers + +Semicolon-separated list

[clang-tools-extra] [clang-tidy] New Option Invalid Enum Default Initialization (PR #159220)

2025-09-17 Thread Victor Chernyakin via cfe-commits
@@ -1,4 +1,5 @@ -// RUN: %check_clang_tidy -std=c++17 %s bugprone-invalid-enum-default-initialization %t +// RUN: %check_clang_tidy -check-suffixes=,DEFAULT -std=c++17 %s bugprone-invalid-enum-default-initialization %t +// RUN: %check_clang_tidy -std=c++17 %s bugprone-invalid-e

[clang-tools-extra] [llvm] [WIP] Formatting suggestions in CI (PR #158779)

2025-09-15 Thread Victor Chernyakin via cfe-commits
https://github.com/localspook updated https://github.com/llvm/llvm-project/pull/158779 >From f77b63dc50a4257a36319f5a85f64068896ccfd8 Mon Sep 17 00:00:00 2001 From: Victor Chernyakin Date: Mon, 15 Sep 2025 22:31:15 -0700 Subject: [PATCH] [WIP] Formatting suggestions in CI --- .github/workflow

[clang-tools-extra] [llvm] [WIP] Formatting suggestions in CI (PR #158779)

2025-09-15 Thread Victor Chernyakin via cfe-commits
https://github.com/localspook updated https://github.com/llvm/llvm-project/pull/158779 >From 10fcc7b2653247142c44365bf3d9ff7c8a35f40b Mon Sep 17 00:00:00 2001 From: Victor Chernyakin Date: Mon, 15 Sep 2025 22:31:15 -0700 Subject: [PATCH] [WIP] Formatting suggestions in CI --- .github/workflow

[clang-tools-extra] [WIP] Formatting suggestions in CI (PR #158779)

2025-09-15 Thread Victor Chernyakin via cfe-commits
https://github.com/localspook updated https://github.com/llvm/llvm-project/pull/158779 >From d339d85900df5e19da6212cb18c9b0240b565156 Mon Sep 17 00:00:00 2001 From: Victor Chernyakin Date: Mon, 15 Sep 2025 22:31:15 -0700 Subject: [PATCH] [WIP] Formatting suggestions in CI --- clang-tools-extr

[clang-tools-extra] [llvm] [WIP] Formatting suggestions in CI (PR #158779)

2025-09-15 Thread Victor Chernyakin via cfe-commits
https://github.com/localspook updated https://github.com/llvm/llvm-project/pull/158779 >From efd515aeaa7004fb74844145b36f6a9febb8d5e5 Mon Sep 17 00:00:00 2001 From: Victor Chernyakin Date: Mon, 15 Sep 2025 22:31:15 -0700 Subject: [PATCH] [WIP] Formatting suggestions in CI --- .github/workflow

[clang-tools-extra] [clang-tidy][NFC] Switch to new file header style (PR #158497)

2025-09-14 Thread Victor Chernyakin via cfe-commits
https://github.com/localspook closed https://github.com/llvm/llvm-project/pull/158497 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy] Enable `modernize-return-braced-init-list`'s tests in C++11 (PR #158196)

2025-09-14 Thread Victor Chernyakin via cfe-commits
localspook wrote: Some statistics: if we decide to force specifying `-std`, we would need to fix ~620 test files (number found by looking for `*.{c,cpp,m,mm}` files under `clang-tools-extra/test/clang-tidy` that don't contain the string `-std`). Doable if a bit tedious. https://github.com/llv

[clang-tools-extra] [clang-tidy][NFC] Construct map at compile time (PR #158166)

2025-09-13 Thread Victor Chernyakin via cfe-commits
https://github.com/localspook created https://github.com/llvm/llvm-project/pull/158166 The important part of this PR is the changes to `getDurationInverseForScale`. I changed the other `get*ForScale` functions so that they all follow the same pattern, but those aren't as important. >From 332f

[clang-tools-extra] [clang-tidy] Support find for string-like classes in readability-container-contains (PR #157243)

2025-09-12 Thread Victor Chernyakin via cfe-commits
localspook wrote: It looks like the check could be extended quite easily to support `cend`, not just `end`. (I’m not advocating doing that in *this* PR, but I noticed it and want to note it down) https://github.com/llvm/llvm-project/pull/157243 ___ c

[clang-tools-extra] [clang-tidy] add option to `readability-use-concise-preprocessor-directives` to take consistency into account (PR #156220)

2025-09-12 Thread Victor Chernyakin via cfe-commits
https://github.com/localspook updated https://github.com/llvm/llvm-project/pull/156220 >From 5baddd86094b185aeb5ecd34e13a3c715d6c1ee3 Mon Sep 17 00:00:00 2001 From: Victor Chernyakin Date: Sat, 30 Aug 2025 19:32:56 -0700 Subject: [PATCH 1/2] [clang-tidy] add option to `readability-use-concise-

[clang-tools-extra] [clang-tidy] add option to `readability-use-concise-preprocessor-directives` to take consistency into account (PR #156220)

2025-09-12 Thread Victor Chernyakin via cfe-commits
https://github.com/localspook edited https://github.com/llvm/llvm-project/pull/156220 ___ 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 `readability-use-concise-preprocessor-directives` to take consistency into account (PR #156220)

2025-09-12 Thread Victor Chernyakin via cfe-commits
@@ -11,51 +11,124 @@ #include "clang/Lex/Lexer.h" #include "clang/Lex/PPCallbacks.h" #include "clang/Lex/Preprocessor.h" +#include "llvm/ADT/STLForwardCompat.h" #include namespace clang::tidy::readability { namespace { -class IfPreprocessorCallbacks final : public P

[clang-tools-extra] [clang-tidy] make `misc-const-correctness` work with `auto` variables and lambdas (PR #157319)

2025-09-12 Thread Victor Chernyakin via cfe-commits
localspook wrote: Looks like there’s consensus that there should be an option *to ease migration*. Do you think we should do the usual “leave it in for 2 releases, then remove it” that we do for deprecated features? https://github.com/llvm/llvm-project/pull/157319 _

[clang-tools-extra] [clang-tidy] add option to `readability-use-concise-preprocessor-directives` to take consistency into account (PR #156220)

2025-09-12 Thread Victor Chernyakin via cfe-commits
https://github.com/localspook updated https://github.com/llvm/llvm-project/pull/156220 >From 5baddd86094b185aeb5ecd34e13a3c715d6c1ee3 Mon Sep 17 00:00:00 2001 From: Victor Chernyakin Date: Sat, 30 Aug 2025 19:32:56 -0700 Subject: [PATCH 1/4] [clang-tidy] add option to `readability-use-concise-

[clang-tools-extra] [clang-tidy] add option to `readability-use-concise-preprocessor-directives` to take consistency into account (PR #156220)

2025-09-12 Thread Victor Chernyakin via cfe-commits
https://github.com/localspook updated https://github.com/llvm/llvm-project/pull/156220 >From 5baddd86094b185aeb5ecd34e13a3c715d6c1ee3 Mon Sep 17 00:00:00 2001 From: Victor Chernyakin Date: Sat, 30 Aug 2025 19:32:56 -0700 Subject: [PATCH 1/3] [clang-tidy] add option to `readability-use-concise-

[clang-tools-extra] [clang-tidy] add option to `readability-use-concise-preprocessor-directives` to take consistency into account (PR #156220)

2025-09-12 Thread Victor Chernyakin via cfe-commits
https://github.com/localspook updated https://github.com/llvm/llvm-project/pull/156220 >From 5baddd86094b185aeb5ecd34e13a3c715d6c1ee3 Mon Sep 17 00:00:00 2001 From: Victor Chernyakin Date: Sat, 30 Aug 2025 19:32:56 -0700 Subject: [PATCH] [clang-tidy] add option to `readability-use-concise-prep

[clang-tools-extra] 64f6715 - [clang-tidy][NFC] Fix a couple typoed variable names

2025-09-12 Thread Victor Chernyakin via cfe-commits
Author: Victor Chernyakin Date: 2025-09-09T18:32:26-07:00 New Revision: 64f671537de05c46f16b563ab833f5866f95e479 URL: https://github.com/llvm/llvm-project/commit/64f671537de05c46f16b563ab833f5866f95e479 DIFF: https://github.com/llvm/llvm-project/commit/64f671537de05c46f16b563ab833f5866f95e479.d

[clang-tools-extra] a566044 - [clang-tidy][NFC] Fix typoed function name

2025-09-12 Thread Victor Chernyakin via cfe-commits
Author: Victor Chernyakin Date: 2025-09-09T18:56:05-07:00 New Revision: a5660446f006a51fe41cccaa986d0d4011507678 URL: https://github.com/llvm/llvm-project/commit/a5660446f006a51fe41cccaa986d0d4011507678 DIFF: https://github.com/llvm/llvm-project/commit/a5660446f006a51fe41cccaa986d0d4011507678.d

[clang-tools-extra] [clang-tidy] Support find for string-like classes in readability-container-contains (PR #157243)

2025-09-11 Thread Victor Chernyakin via cfe-commits
@@ -318,17 +321,15 @@ void testPrivateContains(CustomMapPrivateContains &MyMap, if (MyMap2.count(0)) {}; } -struct MyString {}; - struct WeirdNonMatchingContains { unsigned count(char) const; - bool contains(const MyString&) const; + bool contains(const std::string&) c

[clang-tools-extra] [clang-tidy] Support find for string-like classes in readability-container-contains (PR #157243)

2025-09-11 Thread Victor Chernyakin via cfe-commits
@@ -458,3 +454,41 @@ void testOperandPermutations(std::map& Map) { // CHECK-MESSAGES: :[[@LINE-1]]:{{[0-9]+}}: warning: use 'contains' to check for membership [readability-container-contains] // CHECK-FIXES: if (!Map.contains(0)) {}; } + +void testStringNpos(std::string St

[clang-tools-extra] [clang-tidy] Support find for string-like classes in readability-container-contains (PR #157243)

2025-09-08 Thread Victor Chernyakin via cfe-commits
@@ -1,4 +1,7 @@ -// RUN: %check_clang_tidy -std=c++11-or-later %s readability-container-contains %t +// RUN: %check_clang_tidy -std=c++11-or-later %s readability-container-contains %t -- \ localspook wrote: ```suggestion // RUN: %check_clang_tidy %s readability

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

2025-09-08 Thread Victor Chernyakin via cfe-commits
https://github.com/localspook closed https://github.com/llvm/llvm-project/pull/147553 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy] make `misc-const-correctness` work with `auto` variables and lambdas (PR #157319)

2025-09-07 Thread Victor Chernyakin via cfe-commits
localspook wrote: Re: adding it under an option I'm struggling to imagine a user that wants this change: ```diff - int i = 10; + int const i = 10; ``` but *doesn't* want this change: ```diff - auto i = 10; + auto const i = 10; ``` The way I see it, this PR is more of a bugfix rather than a new f

[clang-tools-extra] [clang-tidy] make `misc-const-correctness` work with `auto` variables and lambdas (PR #157319)

2025-09-07 Thread Victor Chernyakin via cfe-commits
https://github.com/localspook updated https://github.com/llvm/llvm-project/pull/157319 >From e28e9e234b6165b49884cf254e1fb4efe44fe756 Mon Sep 17 00:00:00 2001 From: Victor Chernyakin Date: Sat, 6 Sep 2025 17:35:36 -0700 Subject: [PATCH 1/3] [clang-tidy] make `misc-const-correctness` work with

[clang-tools-extra] [clang-tidy] make `misc-const-correctness` work with `auto` variables and lambdas (PR #157319)

2025-09-07 Thread Victor Chernyakin via cfe-commits
localspook wrote: > I notice now there's no update in Release Notes for this. There is though; did you maybe mean documentation? https://github.com/llvm/llvm-project/pull/157319 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.ll

[clang-tools-extra] [clang-tidy] make `misc-const-correctness` work with `auto` variables and lambdas (PR #157319)

2025-09-07 Thread Victor Chernyakin via cfe-commits
@@ -10,6 +10,12 @@ template void type_dependent_variables() { T value = 42; auto &ref = value; + // CHECK-MESSAGES:[[@LINE-1]]:3: warning: variable 'ref' of type 'int &' can be declared 'const' + // CHECK-FIXES: auto const&ref = value; + // + // FIXME: This is a fals

[clang-tools-extra] [clang-tidy] make `misc-const-correctness` work with `auto` variables and lambdas (PR #157319)

2025-09-07 Thread Victor Chernyakin via cfe-commits
https://github.com/localspook updated https://github.com/llvm/llvm-project/pull/157319 >From e28e9e234b6165b49884cf254e1fb4efe44fe756 Mon Sep 17 00:00:00 2001 From: Victor Chernyakin Date: Sat, 6 Sep 2025 17:35:36 -0700 Subject: [PATCH 1/2] [clang-tidy] make `misc-const-correctness` work with

[clang-tools-extra] [clang-tidy] make `misc-const-correctness` work with `auto` variables and lambdas (PR #157319)

2025-09-07 Thread Victor Chernyakin via cfe-commits
@@ -10,6 +10,12 @@ template void type_dependent_variables() { T value = 42; auto &ref = value; + // CHECK-MESSAGES:[[@LINE-1]]:3: warning: variable 'ref' of type 'int &' can be declared 'const' + // CHECK-FIXES: auto const&ref = value; localspook wrote

[clang-tools-extra] [clang-tidy] make `misc-const-correctness` work with `auto` variables and lambdas (PR #157319)

2025-09-06 Thread Victor Chernyakin via cfe-commits
@@ -185,6 +185,10 @@ Changes in existing checks adding an option to allow pointer arithmetic via prefix/postfix increment or decrement operators. +- Improved :doc:`misc-const-correctness + ` check to diagnose + variables declared with ``auto``. localspoo

[clang-tools-extra] [clang-tidy] make `misc-const-correctness` work with `auto` variables and lambdas (PR #157319)

2025-09-06 Thread Victor Chernyakin via cfe-commits
https://github.com/localspook created https://github.com/llvm/llvm-project/pull/157319 Fixes #60789. Currently, the check will never make `auto` variables `const`. Here's the relevant bit of code: https://github.com/llvm/llvm-project/blob/6b200e21adec0e28407def6fcb2e6c7359fd881b/clang-tools-e

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

2025-09-04 Thread Victor Chernyakin via cfe-commits
@@ -31,8 +31,6 @@ class NoLintDirectiveHandler { public: NoLintDirectiveHandler(); ~NoLintDirectiveHandler(); localspook wrote: This check does backflips to keep the definition of `Impl` out of the header, and this is one of those backflips. The destructo

[clang-tools-extra] [clang-tidy][NFC] Enable `readability-convert-member-functions-to-static` in the codebase (PR #156265)

2025-09-04 Thread Victor Chernyakin via cfe-commits
localspook wrote: Tell me if I’m understanding correctly: Your concern is with the API of a class. That means you’re concerned about changes to `public` and `protected` methods, but okay with changes to `private` ones? https://github.com/llvm/llvm-project/pull/156265 _

[clang-tools-extra] [clang-tidy] Raise minimum standard level for several checks from C++98 to C++11 (PR #152401)

2025-09-04 Thread Victor Chernyakin via cfe-commits
https://github.com/localspook closed https://github.com/llvm/llvm-project/pull/152401 ___ 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] Do not crash when an empty directory is used in the comp… (PR #156873)

2025-09-04 Thread Victor Chernyakin via cfe-commits
@@ -574,22 +574,30 @@ int ClangTool::run(ToolAction *Action) { continue; } for (CompileCommand &CompileCommand : CompileCommandsForFile) { + // If the 'directory' field of the compilation database is empty, display + // an error and use the working direc

[clang-tools-extra] [clang-tidy] Add new '-hide-progress' option to tidy-scripts for suppressing progress information (PR #154416)

2025-09-03 Thread Victor Chernyakin via cfe-commits
@@ -122,6 +122,10 @@ Improvements to clang-tidy - Improved :program:`clang-tidy` option `-quiet` by suppressing diagnostic count messages. +- Improved :program:`run-clang-tidy.py` and :program:`clang-tidy-diff.py` + scripts by adding the `-hide-progress` option to suppress

[clang-tools-extra] [clang-tidy] Fix `readability-uppercase-literal-suffix` warning with hex literals (PR #156584)

2025-09-03 Thread Victor Chernyakin via cfe-commits
https://github.com/localspook closed https://github.com/llvm/llvm-project/pull/156584 ___ 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 `readability-uppercase-literal-suffix` warning with hex literals (PR #156584)

2025-09-03 Thread Victor Chernyakin via cfe-commits
localspook wrote: Because of the new `wb` suffix. I should’ve just added `wW` https://github.com/llvm/llvm-project/pull/156584 ___ 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 `readability-uppercase-literal-suffix` warning with hex literals (PR #156584)

2025-09-03 Thread Victor Chernyakin via cfe-commits
https://github.com/localspook created https://github.com/llvm/llvm-project/pull/156584 This is a regression I introduced in #148275 and was [noticed by](https://github.com/llvm/llvm-project/pull/148275#issuecomment-3246670841) @nettle. The check incorrectly fires on hex literals containing the

[clang-tools-extra] [clang-tidy] Teach `readability-uppercase-literal-suffix` about C++23 and C23 suffixes (PR #148275)

2025-09-02 Thread Victor Chernyakin via cfe-commits
localspook wrote: Good catch, thank you! Opened #156584 with a fix. https://github.com/llvm/llvm-project/pull/148275 ___ 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 `readability-uppercase-literal-suffix` about C++23 and C23 suffixes (PR #148275)

2025-09-02 Thread Victor Chernyakin via cfe-commits
localspook wrote: That CI failure looks unrelated. https://github.com/llvm/llvm-project/pull/148275 ___ 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] Enable `readability-convert-member-functions-to-static` in the codebase (PR #156265)

2025-08-31 Thread Victor Chernyakin via cfe-commits
https://github.com/localspook updated https://github.com/llvm/llvm-project/pull/156265 >From c368372b8cc915a401a5dcbf6346e23a101f95e4 Mon Sep 17 00:00:00 2001 From: Victor Chernyakin Date: Sun, 31 Aug 2025 17:18:42 -0700 Subject: [PATCH 1/2] [clang-tidy][NFC] Enable `readability-convert-member

[clang-tools-extra] [clang-tidy][NFC] Enable `readability-convert-member-functions-to-static` in the codebase (PR #156265)

2025-08-31 Thread Victor Chernyakin via cfe-commits
https://github.com/localspook created https://github.com/llvm/llvm-project/pull/156265 Closes #156158. Ironically, one warning found in `ConvertMemberFunctionsToStatic.cpp` >From c368372b8cc915a401a5dcbf6346e23a101f95e4 Mon Sep 17 00:00:00 2001 From: Victor Chernyakin Date: Sun, 31 Aug 2025 1

[clang-tools-extra] [clang-tidy] Teach `readability-uppercase-literal-suffix` about C++23 and C23 suffixes (PR #148275)

2025-08-31 Thread Victor Chernyakin via cfe-commits
https://github.com/localspook closed https://github.com/llvm/llvm-project/pull/148275 ___ 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 `readability-use-concise-preprocessor-directives` to take consistency into account (PR #156220)

2025-08-30 Thread Victor Chernyakin via cfe-commits
https://github.com/localspook edited https://github.com/llvm/llvm-project/pull/156220 ___ 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 `readability-use-concise-preprocessor-directives` to take consistency into account (PR #156220)

2025-08-30 Thread Victor Chernyakin via cfe-commits
https://github.com/localspook created https://github.com/llvm/llvm-project/pull/156220 Fixes #155680. See that issue for context. The precise heuristic this PR implements is this: *none of the conditions in a chain will be shortened if any of them contains the `defined` operator but cannot be

[clang-tools-extra] [clang-tidy] New bugprone-derived-method-shadowing-base-method (PR #154746)

2025-08-29 Thread Victor Chernyakin via cfe-commits
@@ -0,0 +1,132 @@ +//===--===// +// +// 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] New bugprone-derived-method-shadowing-base-method (PR #154746)

2025-08-29 Thread Victor Chernyakin via cfe-commits
@@ -0,0 +1,127 @@ +//===--===// +// +// 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] New bugprone-derived-method-shadowing-base-method (PR #154746)

2025-08-29 Thread Victor Chernyakin via cfe-commits
@@ -153,6 +154,8 @@ class BugproneModule : public ClangTidyModule { "bugprone-incorrect-enable-if"); CheckFactories.registerCheck( "bugprone-incorrect-enable-shared-from-this"); +CheckFactories.registerCheck( +"bugprone-derived-method-shadowing-b

[clang-tools-extra] [clang-tidy] New bugprone-derived-method-shadowing-base-method (PR #154746)

2025-08-29 Thread Victor Chernyakin via cfe-commits
@@ -0,0 +1,127 @@ +//===--===// +// +// 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] New bugprone-derived-method-shadowing-base-method (PR #154746)

2025-08-29 Thread Victor Chernyakin via cfe-commits
@@ -0,0 +1,127 @@ +//===--===// +// +// 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] New bugprone-derived-method-shadowing-base-method (PR #154746)

2025-08-29 Thread Victor Chernyakin via cfe-commits
@@ -31,6 +31,7 @@ add_clang_library(clangTidyBugproneModule STATIC IncorrectEnableIfCheck.cpp IncorrectEnableSharedFromThisCheck.cpp InvalidEnumDefaultInitializationCheck.cpp + DerivedMethodShadowingBaseMethodCheck.cpp localspook wrote: Ditto alphabetic

[clang-tools-extra] [clang-tidy] New bugprone-derived-method-shadowing-base-method (PR #154746)

2025-08-29 Thread Victor Chernyakin via cfe-commits
@@ -0,0 +1,127 @@ +//===--===// +// +// 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] Teach `readability-uppercase-literal-suffix` about C++23 and C23 suffixes (PR #148275)

2025-08-26 Thread Victor Chernyakin via cfe-commits
@@ -0,0 +1,162 @@ +// TODO: When Clang adds support for decimal floating point types, enable these tests by: +//1. Removing all the #if 0 + #endif guards. +//2. Removing all occurrences of the string "DISABLED-" in this file. +//3. Deleting this message. + +// RUN: %c

[clang-tools-extra] [clang-tidy] Teach `readability-uppercase-literal-suffix` about C++23 and C23 suffixes (PR #148275)

2025-08-26 Thread Victor Chernyakin via cfe-commits
https://github.com/localspook edited https://github.com/llvm/llvm-project/pull/148275 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

  1   2   3   >