[clang-tools-extra] [clang-tidy] Teach `modernize-type-traits` about more type traits (PR #147074)

2025-07-04 Thread Baranov Victor via cfe-commits
@@ -130,6 +149,12 @@ static const llvm::StringSet<> TypeTraits = { "result_of", "invoke_result", "type_identity", +"tuple_element", vbvictor wrote: There are no tests that will handle recursive traits (AFAIK there weren't any recursive trait i

[clang-tools-extra] [clang-tidy] Teach `modernize-type-traits` about more type traits (PR #147074)

2025-07-04 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor requested changes to this pull request. Thank you for the patch! Could you please add tests with new traits from C++20, 23, 26 standards to make sure we get warning. You will need to change `-std=c++17` to `-std=c++17-or-later` in tests. https://github.com/llvm/llvm

[clang-tools-extra] [clang-tidy] Teach `modernize-type-traits` about more type traits (PR #147074)

2025-07-04 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor edited https://github.com/llvm/llvm-project/pull/147074 ___ 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 `modernize-type-traits` about more type traits (PR #147074)

2025-07-04 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor edited https://github.com/llvm/llvm-project/pull/147074 ___ 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 compilation by disambiguating equality operator (PR #147048)

2025-07-04 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor edited https://github.com/llvm/llvm-project/pull/147048 ___ 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 compilation by disambiguating equality operator (PR #147048)

2025-07-04 Thread Baranov Victor via cfe-commits
@@ -144,7 +144,8 @@ TaggedUnionMemberCountCheck::getNumberOfEnumValues(const EnumDecl *ED) { if (EnableCountingEnumHeuristic && LastEnumConstant && isCountingEnumLikeName(LastEnumConstant->getName()) && - (LastEnumConstant->getInitVal() == (EnumValues.size() - 1)

[clang-tools-extra] [clang-tidy] Add portability-avoid-platform-specific-fundamental-types (PR #146970)

2025-07-08 Thread Baranov Victor via cfe-commits
@@ -0,0 +1,260 @@ +//===--- AvoidPlatformSpecificFundamentalTypesCheck.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] Teach `modernize-type-traits` about more type traits (PR #147074)

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

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

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

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

2025-07-04 Thread Baranov Victor via cfe-commits
@@ -174,6 +176,21 @@ void QualifiedAutoCheck::registerMatchers(MatchFinder *Finder) { void QualifiedAutoCheck::check(const MatchFinder::MatchResult &Result) { if (const auto *Var = Result.Nodes.getNodeAs("auto")) { +if (RespectOpaqueTypes) { vbvictor wr

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

2025-07-04 Thread Baranov Victor via cfe-commits
@@ -0,0 +1,239 @@ +// RUN: %check_clang_tidy %s readability-qualified-auto %t -- -config="{CheckOptions: [\ vbvictor wrote: Please write tests in existing `qualified-auto.cpp`. You can have multiple RUN commands in one file. https://github.com/llvm/llvm-projec

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

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

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

2025-07-04 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor requested changes to this pull request. Please, describe your option in check docs. I find option name a little unclear, I don't encounter "opaque" term ofter, maybe `DesugarTypes` is better? https://github.com/llvm/llvm-project/pull/147060 _

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

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

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

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

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

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

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

2025-07-07 Thread Baranov Victor via cfe-commits
vbvictor wrote: > In that case the default should be true though right? Yes, that would be just as current default behavior. https://github.com/llvm/llvm-project/pull/147060 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.o

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

2025-07-06 Thread Baranov Victor via cfe-commits
vbvictor wrote: I'd suggest marking it `[[deprecated]]` for now and removing it completely after 2 releases of LLVM (AFAIK that's usual procedure). I've [searched](https://sourcegraph.com/search?q=context:global+::clang::ast_matchers::internal::makeMatcher+-file:.*Matchers%5C.h%24+-file:.*ASTM

[clang] [LifetimeSafety] Introduce intra-procedural analysis in Clang (PR #142313)

2025-07-06 Thread Baranov Victor via cfe-commits
@@ -0,0 +1,508 @@ +#include "clang/Analysis/Analyses/LifetimeSafety.h" +#include "clang/AST/Decl.h" +#include "clang/AST/Expr.h" +#include "clang/AST/StmtVisitor.h" +#include "clang/AST/Type.h" +#include "clang/Analysis/AnalysisDeclContext.h" +#include "clang/Analysis/CFG.h" +#inc

[clang] [LifetimeSafety] Introduce intra-procedural analysis in Clang (PR #142313)

2025-07-06 Thread Baranov Victor via cfe-commits
@@ -0,0 +1,13 @@ +#ifndef LLVM_CLANG_ANALYSIS_ANALYSES_LIFETIME_SAFETY_H vbvictor wrote: I think this file has a "Header" with `Part of the LLVM Project ...` and a little in-place description like any other file in `Analyses/` dir. Same to .cpp file. https://g

[clang] [LifetimeSafety] Introduce intra-procedural analysis in Clang (PR #142313)

2025-07-06 Thread Baranov Victor via cfe-commits
@@ -0,0 +1,508 @@ +#include "clang/Analysis/Analyses/LifetimeSafety.h" +#include "clang/AST/Decl.h" +#include "clang/AST/Expr.h" +#include "clang/AST/StmtVisitor.h" +#include "clang/AST/Type.h" +#include "clang/Analysis/AnalysisDeclContext.h" +#include "clang/Analysis/CFG.h" +#inc

[clang] [LifetimeSafety] Introduce intra-procedural analysis in Clang (PR #142313)

2025-07-06 Thread Baranov Victor via cfe-commits
@@ -0,0 +1,508 @@ +#include "clang/Analysis/Analyses/LifetimeSafety.h" +#include "clang/AST/Decl.h" +#include "clang/AST/Expr.h" +#include "clang/AST/StmtVisitor.h" +#include "clang/AST/Type.h" +#include "clang/Analysis/AnalysisDeclContext.h" +#include "clang/Analysis/CFG.h" +#inc

[clang] [LifetimeSafety] Introduce intra-procedural analysis in Clang (PR #142313)

2025-07-06 Thread Baranov Victor via cfe-commits
@@ -0,0 +1,508 @@ +#include "clang/Analysis/Analyses/LifetimeSafety.h" +#include "clang/AST/Decl.h" +#include "clang/AST/Expr.h" +#include "clang/AST/StmtVisitor.h" +#include "clang/AST/Type.h" +#include "clang/Analysis/AnalysisDeclContext.h" +#include "clang/Analysis/CFG.h" +#inc

[clang] [LifetimeSafety] Introduce intra-procedural analysis in Clang (PR #142313)

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

[clang] [LifetimeSafety] Introduce intra-procedural analysis in Clang (PR #142313)

2025-07-06 Thread Baranov Victor via cfe-commits
@@ -0,0 +1,13 @@ +#ifndef LLVM_CLANG_ANALYSIS_ANALYSES_LIFETIME_SAFETY_H vbvictor wrote: ```suggestion #ifndef LLVM_CLANG_ANALYSIS_ANALYSES_LIFETIMESAFETY_H ``` Underscore should be path separators, https://llvm.org/docs/CodingStandards.html#header-guard. https

[clang] [LifetimeSafety] Introduce intra-procedural analysis in Clang (PR #142313)

2025-07-06 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor commented: Thank you for your work! Interested to see this feature in clang. Left a couple of nit comments on code style. https://github.com/llvm/llvm-project/pull/142313 ___ cfe-commits mailing list cfe-commits@lists.llvm.o

[clang] [LifetimeSafety] Introduce intra-procedural analysis in Clang (PR #142313)

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

[clang] [LifetimeSafety] Introduce intra-procedural analysis in Clang (PR #142313)

2025-07-06 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor edited https://github.com/llvm/llvm-project/pull/142313 ___ 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 portability-avoid-platform-specific-fundamental-types (PR #146970)

2025-07-04 Thread Baranov Victor via cfe-commits
vbvictor wrote: > I'm planning for an autofix of float and double since it's unambiguous what > those types should be. For int types, maybe I'll give 3 options for an autofix: Fixed (int32_t) Fast (int_fast32_t) Least (int_least32_t) You could make a universal option to configure autofixes. Mak

[clang-tools-extra] [clang-tidy] Make `bugprone-unhandled-self-assignment` check more general (PR #147066)

2025-07-04 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor edited https://github.com/llvm/llvm-project/pull/147066 ___ 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 `modernize-type-traits` about more type traits (PR #147074)

2025-07-04 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor edited https://github.com/llvm/llvm-project/pull/147074 ___ 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 `modernize-type-traits` about more type traits (PR #147074)

2025-07-04 Thread Baranov Victor via cfe-commits
@@ -130,6 +149,12 @@ static const llvm::StringSet<> TypeTraits = { "result_of", "invoke_result", "type_identity", +"tuple_element", vbvictor wrote: I'd also suggest adding "Limitation" section in check docs. Search in docs directory for refere

[clang-tools-extra] [clang-tidy][NFC] Prefer `constexpr llvm::StringLiteral` over `const char *` (PR #147301)

2025-07-07 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor edited https://github.com/llvm/llvm-project/pull/147301 ___ 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] Prefer `constexpr llvm::StringLiteral` over `const char *` (PR #147301)

2025-07-07 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor approved this pull request. Could we just use `StringLiteral` without `llvm::`? https://github.com/llvm/llvm-project/pull/147301 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/

[clang-tools-extra] [clang-tidy][NFC] Prefer `constexpr llvm::StringLiteral` over `const char *` (PR #147301)

2025-07-07 Thread Baranov Victor via cfe-commits
@@ -55,7 +55,8 @@ namespace clang::tidy { namespace { #if CLANG_TIDY_ENABLE_STATIC_ANALYZER -static const char *AnalyzerCheckNamePrefix = "clang-analyzer-"; +static constexpr llvm::StringLiteral AnalyzerCheckNamePrefix = vbvictor wrote: ```suggestion static c

[clang-tools-extra] [clang-tidy][NFC] Prefer `constexpr llvm::StringLiteral` over `const char *` (PR #147301)

2025-07-07 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor edited https://github.com/llvm/llvm-project/pull/147301 ___ 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] Prefer `constexpr llvm::StringLiteral` over `const char *` (PR #147301)

2025-07-07 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor edited https://github.com/llvm/llvm-project/pull/147301 ___ 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] Prefer `constexpr llvm::StringLiteral` over `const char *` (PR #147301)

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

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

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

[clang-tools-extra] [clang-tidy][NFC] fix compilation by disambiguating equality operator (PR #147048)

2025-07-07 Thread Baranov Victor via cfe-commits
@@ -144,7 +144,9 @@ TaggedUnionMemberCountCheck::getNumberOfEnumValues(const EnumDecl *ED) { if (EnableCountingEnumHeuristic && LastEnumConstant && isCountingEnumLikeName(LastEnumConstant->getName()) && - (LastEnumConstant->getInitVal() == (EnumValues.size() - 1)

[clang-tools-extra] [clang-tidy][NFC] fix compilation by disambiguating equality operator (PR #147048)

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

2025-07-06 Thread Baranov Victor via cfe-commits
@@ -0,0 +1,62 @@ +.. title:: clang-tidy - misc-bool-bitwise-operation + +misc-bool-bitwise-operation +=== + +Finds potentially inefficient use of bitwise operators such as ``&``, ``|`` +and their compound analogues on Boolean values where logical operator

[clang-tools-extra] [clang-tidy][NFC] fix compilation by disambiguating equality operator (PR #147048)

2025-07-08 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor closed https://github.com/llvm/llvm-project/pull/147048 ___ 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 ak_attr_info in diagnostic forwarding (PR #147503)

2025-07-08 Thread Baranov Victor via cfe-commits
vbvictor wrote: Did any of the builders caught this, or it is some local configuration? Asking just in case if we should create one for catching such CE's. https://github.com/llvm/llvm-project/pull/147503 ___ cfe-commits mailing list cfe-commits@lists

[clang-tools-extra] [clang-tidy] Add portability-avoid-platform-specific-fundamental-types (PR #146970)

2025-07-09 Thread Baranov Victor via cfe-commits
vbvictor wrote: > > Please remove unnecessary comments that tell the same as code itself, > > speaking mostly about comments in `registerMatchers`. They mostly don't > > give any more information that matchers themselves. > > To be honest, this is because I coded 98% of this with AI (except fo

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

2025-07-09 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor updated https://github.com/llvm/llvm-project/pull/141304 >From 7323c1b3ed55790cdab240f233113bfb1d52badb 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][NFC] add '.clang-tidy' config for clang-tidy project (PR #147793)

2025-07-09 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor updated https://github.com/llvm/llvm-project/pull/147793 >From a0fd1b04817c03685bacd70f763ef0f62dd4e425 Mon Sep 17 00:00:00 2001 From: Victor Baranov Date: Wed, 9 Jul 2025 21:00:30 +0300 Subject: [PATCH 1/2] [clang-tidy][NFC] add '.clang-tidy' config for clang-tidy

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

2025-07-09 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor closed 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-tools-extra] [clang-tidy] add .clang-tidy config for clang-tidy project (PR #147793)

2025-07-09 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor created https://github.com/llvm/llvm-project/pull/147793 Added `.clang-tidy` config as discussed in [RFC](https://discourse.llvm.org/t/rfc-create-hardened-clang-tidy-config-for-clang-tidy-directory/87247). Added `bugprone` checks that didn't create many warnings. Fix

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

2025-07-09 Thread Baranov Victor via cfe-commits
vbvictor wrote: Added all people that participated in RFC and regular clang-tidy reviewers to see this change. https://github.com/llvm/llvm-project/pull/147793 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mail

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

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

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

2025-07-09 Thread Baranov Victor via cfe-commits
vbvictor wrote: > How about adding modernize relevant to currently used C++ standard? Also some > of readability checks are useful. Yes, I will add more and more checks to config. Just started with `bugprone` as it is the most straightforward improvement. > Please also consider top-level .cla

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

2025-07-09 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor updated https://github.com/llvm/llvm-project/pull/147793 >From a0fd1b04817c03685bacd70f763ef0f62dd4e425 Mon Sep 17 00:00:00 2001 From: Victor Baranov Date: Wed, 9 Jul 2025 21:00:30 +0300 Subject: [PATCH] [clang-tidy][NFC] add '.clang-tidy' config for clang-tidy proj

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

2025-07-08 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor updated https://github.com/llvm/llvm-project/pull/142839 >From d9ecaedefd6d98c653affc76e375fa1f8644a0df Mon Sep 17 00:00:00 2001 From: Victor Baranov Date: Wed, 4 Jun 2025 22:29:51 +0300 Subject: [PATCH 1/4] [clang-tidy] Add new check `llvm-prefer-static-over-anonym

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

2025-07-08 Thread Baranov Victor via cfe-commits
vbvictor wrote: Ping if anyone else what to review this new check. https://github.com/llvm/llvm-project/pull/142839 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

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

2025-07-08 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor updated https://github.com/llvm/llvm-project/pull/142839 >From d9ecaedefd6d98c653affc76e375fa1f8644a0df Mon Sep 17 00:00:00 2001 From: Victor Baranov Date: Wed, 4 Jun 2025 22:29:51 +0300 Subject: [PATCH 1/3] [clang-tidy] Add new check `llvm-prefer-static-over-anonym

[clang-tools-extra] [clang-tidy][NFC] Do more work at compile time (PR #147406)

2025-07-08 Thread Baranov Victor via cfe-commits
vbvictor wrote: Please make the title more detailed about what you changed excatly. https://github.com/llvm/llvm-project/pull/147406 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

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

2025-07-08 Thread Baranov Victor via cfe-commits
@@ -672,9 +672,15 @@ class Matcher { DynTypedMatcher Implementation; }; // class Matcher -/// A convenient helper for creating a Matcher without specifying -/// the template type argument. +// Deduction guide for Matcher. +template Matcher(MatcherInterface *) -> Matcher; +

[clang-tools-extra] [clang-tidy][NFC] Prefer `constexpr llvm::StringLiteral` over `const char *` (PR #147301)

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

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

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

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

2025-07-09 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor updated https://github.com/llvm/llvm-project/pull/147793 >From c4466d677619e6eb8ca65ed943bfb103207527c9 Mon Sep 17 00:00:00 2001 From: Victor Baranov Date: Wed, 9 Jul 2025 21:00:30 +0300 Subject: [PATCH 1/3] [clang-tidy][NFC] add '.clang-tidy' config for clang-tidy

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

2025-07-10 Thread Baranov Victor via cfe-commits
vbvictor wrote: Based on [carlosgalvezp](https://github.com/carlosgalvezp)'s comment in https://github.com/llvm/llvm-project/pull/147902#pullrequestreview-3005674950 changed `Checks: []` to `Checks: >` to comply with older version of `clang-tidy`. https://github.com/llvm/llvm-project/pull/147

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

2025-07-10 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor updated https://github.com/llvm/llvm-project/pull/147793 >From c4466d677619e6eb8ca65ed943bfb103207527c9 Mon Sep 17 00:00:00 2001 From: Victor Baranov Date: Wed, 9 Jul 2025 21:00:30 +0300 Subject: [PATCH 1/4] [clang-tidy][NFC] add '.clang-tidy' config for clang-tidy

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

2025-07-10 Thread Baranov Victor via cfe-commits
vbvictor wrote: > One last thing I'm missing: can you update the clang-tidy contributors guide, > to explain that we expect people to run clang-tidy as well (and what command > to run)? Since it's not currently enforced in CI. I will add it in a separate PR. Don't feel right to make kind-of un

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

[clang-tools-extra] [clang-tidy][readability-named-parameter] Add an option to print names without comment (PR #147953)

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

[clang-tools-extra] [clang-tidy][readability-named-parameter] Add an option to print names without comment (PR #147953)

2025-07-10 Thread Baranov Victor via cfe-commits
@@ -84,7 +95,8 @@ void NamedParameterCheck::check(const MatchFinder::MatchResult &Result) { for (auto P : UnnamedParams) { // Fallback to an unused marker. - StringRef NewName = "unused"; + constexpr StringRef FallbackName = "unused"; vbvi

[clang-tools-extra] [clang-tidy][readability-named-parameter] Add an option to print names without comment (PR #147953)

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

[clang-tools-extra] [clang-tidy][readability-named-parameter] Add an option to print names without comment (PR #147953)

2025-07-10 Thread Baranov Victor via cfe-commits
@@ -105,12 +117,26 @@ void NamedParameterCheck::check(const MatchFinder::MatchResult &Result) { NewName = Name; } - // Now insert the comment. Note that getLocation() points to the place + // Now insert the fix. Note that getLocation() points to the

[clang-tools-extra] [clang-tidy][readability-named-parameter] Add an option to print names without comment (PR #147953)

2025-07-10 Thread Baranov Victor via cfe-commits
@@ -1,29 +1,46 @@ // RUN: %check_clang_tidy %s readability-named-parameter %t +// RUN: %check_clang_tidy -check-suffix=PLAIN-NAMES %s readability-named-parameter %t -- -config="{CheckOptions: [{key: readability-named-parameter.InsertPlainNamesInForwardDecls, value: true}]}" ---

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

2025-07-10 Thread Baranov Victor via cfe-commits
vbvictor wrote: > I suppose this patch does not impede further refactoring if we want to go in > that direction in the future. Yes, also with these tests we will be sure that future `llvm-` alias works properly. https://github.com/llvm/llvm-project/pull/142839

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

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

<    7   8   9   10   11   12   13   >