[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 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][NFC] Refactor `modernize-use-trailing-return-type-check` check code and tests (PR #140759)

2025-05-20 Thread Baranov Victor via cfe-commits
@@ -28,7 +27,7 @@ struct ClassifiedToken { class UseTrailingReturnTypeCheck : public ClangTidyCheck { public: UseTrailingReturnTypeCheck(StringRef Name, ClangTidyContext *Context) - : ClangTidyCheck(Name, Context) {} + : ClangTidyCheck(Name, Context) {}; ---

[clang-tools-extra] [clang-tidy][NFC] Refactor `modernize-use-trailing-return-type-check` check code and tests (PR #140759)

2025-05-20 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor updated https://github.com/llvm/llvm-project/pull/140759 >From fbae463925738d8628593d5daaabe2a299aecbbf Mon Sep 17 00:00:00 2001 From: Baranov Victor Date: Tue, 20 May 2025 19:23:35 +0300 Subject: [PATCH 1/4] [clang-tidy][nfc] refactor use-trailing-return-type-check

[clang-tools-extra] [clang-tidy][NFC] Refactor `modernize-use-trailing-return-type-check` check code and tests (PR #140759)

2025-05-20 Thread Baranov Victor via cfe-commits
@@ -28,7 +27,7 @@ struct ClassifiedToken { class UseTrailingReturnTypeCheck : public ClangTidyCheck { public: UseTrailingReturnTypeCheck(StringRef Name, ClangTidyContext *Context) - : ClangTidyCheck(Name, Context) {} + : ClangTidyCheck(Name, Context) {}; ---

[clang-tools-extra] [clang-tidy][NFC] Refactor `modernize-use-trailing-return-type-check` check code and tests (PR #140759)

2025-05-20 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor updated https://github.com/llvm/llvm-project/pull/140759 >From fbae463925738d8628593d5daaabe2a299aecbbf Mon Sep 17 00:00:00 2001 From: Baranov Victor Date: Tue, 20 May 2025 19:23:35 +0300 Subject: [PATCH 1/3] [clang-tidy][nfc] refactor use-trailing-return-type-check

[clang-tools-extra] [clang-tidy][NFC] Refactor `modernize-use-trailing-return-type-check` check code and tests (PR #140759)

2025-05-20 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor updated https://github.com/llvm/llvm-project/pull/140759 >From fbae463925738d8628593d5daaabe2a299aecbbf Mon Sep 17 00:00:00 2001 From: Baranov Victor Date: Tue, 20 May 2025 19:23:35 +0300 Subject: [PATCH 1/2] [clang-tidy][nfc] refactor use-trailing-return-type-check

[clang-tools-extra] [clang-tidy][NFC] Refactor `modernize-use-trailing-return-type-check` check code and tests (PR #140759)

2025-05-20 Thread Baranov Victor via cfe-commits
@@ -113,7 +113,7 @@ struct UnqualNameVisitor : public RecursiveASTVisitor { }; } // namespace -constexpr llvm::StringLiteral Message = +constexpr llvm::StringLiteral MessageFunction = vbvictor wrote: This came from https://github.com/llvm/llvm-project/pull/1

[clang-tools-extra] [clang-tidy][NFC] Refactor `modernize-use-trailing-return-type-check` check code and tests (PR #140759)

2025-05-20 Thread Baranov Victor via cfe-commits
@@ -383,6 +382,10 @@ void UseTrailingReturnTypeCheck::keepSpecifiers( } } +UseTrailingReturnTypeCheck::UseTrailingReturnTypeCheck( vbvictor wrote: Initially, I did this change in preparation for PR https://github.com/llvm/llvm-project/pull/135383, where I

[clang-tools-extra] [clang-tidy][NFC] Refactor `modernize-pass-by-value` check code and tests (PR #140753)

2025-05-20 Thread Baranov Victor via cfe-commits
vbvictor wrote: > Also, CHECK-MESSAGES-NOT is discouraged, since the testing framework already > checks that no other output is produced by default. So if CHECK-FIXES are the same as previous code, we can remove them completely (I changed them to CHECK-MESSAGES-NOT) https://github.com/llvm/

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

2025-05-20 Thread Baranov Victor via cfe-commits
@@ -56,6 +60,13 @@ class UseTrailingReturnTypeCheck : public ClangTidyCheck { SourceRange ReturnTypeCVRange, const FunctionDecl &F, const FriendDecl *Fr, const ASTContext &Ctx, const SourceManager &SM, const Lang

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

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

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

2025-05-20 Thread Baranov Victor via cfe-commits
@@ -494,4 +554,75 @@ void UseTrailingReturnTypeCheck::check(const MatchFinder::MatchResult &Result) { << FixItHint::CreateInsertion(InsertionLoc, " -> " + ReturnType); } +void UseTrailingReturnTypeCheck::diagOnLambda( +const LambdaExpr *Lambda, +const ast_matche

[clang-tools-extra] [clang-tidy] Add UnusedIncludes/MissingIncludes options to misc-include-cleaner (PR #140600)

2025-05-20 Thread Baranov Victor via cfe-commits
vbvictor wrote: Apart from failing tests, LGTM https://github.com/llvm/llvm-project/pull/140600 ___ 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-20 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor created https://github.com/llvm/llvm-project/pull/140759 - Deleted unused includes - Deleted useless braces - Converted private methods to static function to improve compilations speed and readability - Modernized tests to use `cxx-or-later` >From fbae463925738d862

[clang-tools-extra] [clang-tidy][NFC] Refactor `modernize-pass-by-value` check code and tests (PR #140753)

2025-05-20 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor created https://github.com/llvm/llvm-project/pull/140753 - Deleted unused includes - Deleted useless braces - Modernized tests to use `CHECK-MESSAGES-NOT` and `CHECK-FIXES-NOT` for better readability and maintainability >From 60c4c0432a47637bedd20a88c60b5a715473c78a

[clang-tools-extra] [clang-tidy] Add UnusedIncludes/MissingIncludes options to misc-include-cleaner (PR #140600)

2025-05-20 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor edited https://github.com/llvm/llvm-project/pull/140600 ___ 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 UnusedIncludes/MissingIncludes options to misc-include-cleaner (PR #140600)

2025-05-20 Thread Baranov Victor via cfe-commits
@@ -0,0 +1,13 @@ +// RUN: %check_clang_tidy %s misc-include-cleaner %t \ +// RUN: -config='{CheckOptions: \ +// RUN: {"misc-include-cleaner.UnusedIncludes": false,\ +// RUN: "misc-include-cleaner.MissingIncludes": false,\ +// RUN: }}' -- -fno-delayed-template-parsing + +// CHE

[clang-tools-extra] [clang-tidy] Add UnusedIncludes/MissingIncludes options to misc-include-cleaner (PR #140600)

2025-05-20 Thread Baranov Victor via cfe-commits
@@ -0,0 +1,13 @@ +// RUN: %check_clang_tidy %s misc-include-cleaner %t \ +// RUN: -config='{CheckOptions: \ +// RUN: {"misc-include-cleaner.UnusedIncludes": false,\ +// RUN: "misc-include-cleaner.MissingIncludes": false,\ +// RUN: }}' -- -fno-delayed-template-parsing + +// CHE

[clang-tools-extra] [clang-tidy] Add UnusedIncludes/MissingIncludes options to misc-include-cleaner (PR #140600)

2025-05-20 Thread Baranov Victor via cfe-commits
@@ -68,12 +70,19 @@ IncludeCleanerCheck::IncludeCleanerCheck(StringRef Name, HeaderSuffix += "$"; IgnoreHeadersRegex.emplace_back(HeaderSuffix); } + + if (UnusedIncludes == false && MissingIncludes == false) +this->configurationDiag("The check 'misc-include-cle

[clang-tools-extra] [clang-tidy] Add UnusedIncludes/MissingIncludes options to misc-include-cleaner (PR #140600)

2025-05-20 Thread Baranov Victor via cfe-commits
@@ -225,6 +225,11 @@ Changes in existing checks tolerating fix-it breaking compilation when functions is used as pointers to avoid matching usage of functions within the current compilation unit. +- Improved :doc:`misc-include-cleaner vbvictor wrote: Plea

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

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

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

2025-05-19 Thread Baranov Victor via cfe-commits
@@ -56,6 +60,13 @@ class UseTrailingReturnTypeCheck : public ClangTidyCheck { SourceRange ReturnTypeCVRange, const FunctionDecl &F, const FriendDecl *Fr, const ASTContext &Ctx, const SourceManager &SM, const Lang

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

2025-05-19 Thread Baranov Victor via cfe-commits
@@ -56,6 +60,13 @@ class UseTrailingReturnTypeCheck : public ClangTidyCheck { SourceRange ReturnTypeCVRange, const FunctionDecl &F, const FriendDecl *Fr, const ASTContext &Ctx, const SourceManager &SM, const Lang

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

2025-05-19 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor updated https://github.com/llvm/llvm-project/pull/135383 >From 4a7cdb4a9f4de5503eba1488306e238b7334912a Mon Sep 17 00:00:00 2001 From: Victor Baranov Date: Fri, 11 Apr 2025 20:26:49 +0300 Subject: [PATCH 1/4] [clang-tidy] add support for lambdas in use-trailing-retu

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

2025-05-19 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor updated https://github.com/llvm/llvm-project/pull/135383 >From 4a7cdb4a9f4de5503eba1488306e238b7334912a Mon Sep 17 00:00:00 2001 From: Victor Baranov Date: Fri, 11 Apr 2025 20:26:49 +0300 Subject: [PATCH 1/3] [clang-tidy] add support for lambdas in use-trailing-retu

[clang-tools-extra] [clang-tidy] Add avoid-pragma-once. (PR #140388)

2025-05-18 Thread Baranov Victor via cfe-commits
@@ -0,0 +1,50 @@ +//===--- AvoidPragmaOnceCheck.cpp - clang-tidy ===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apa

[clang-tools-extra] [clang-tidy] Add avoid-pragma-once. (PR #140388)

2025-05-18 Thread Baranov Victor via cfe-commits
@@ -0,0 +1,50 @@ +//===--- AvoidPragmaOnceCheck.cpp - clang-tidy ===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apa

[clang-tools-extra] [clang-tidy] Add avoid-pragma-once. (PR #140388)

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

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

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

2025-05-18 Thread Baranov Victor via cfe-commits
@@ -0,0 +1,50 @@ +//===--- AvoidPragmaOnceCheck.cpp - clang-tidy ===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apa

[clang-tools-extra] [clang-tidy] Add avoid-pragma-once. (PR #140388)

2025-05-18 Thread Baranov Victor via cfe-commits
@@ -0,0 +1,24 @@ +.. title:: clang-tidy - portability-avoid-pragma-once + +portability-avoid-pragma-once += + +Finds uses of ``#pragma once`` and suggests replacing them with standard +include guards (``#ifndef``/``#define``/``#endif``) for improved por

[clang-tools-extra] [clang-tidy] Add avoid-pragma-once. (PR #140388)

2025-05-18 Thread Baranov Victor via cfe-commits
@@ -0,0 +1,50 @@ +//===--- AvoidPragmaOnceCheck.cpp - clang-tidy ===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apa

[clang-tools-extra] [clang-tidy] Add avoid-pragma-once. (PR #140388)

2025-05-18 Thread Baranov Victor via cfe-commits
@@ -0,0 +1,24 @@ +.. title:: clang-tidy - portability-avoid-pragma-once + +portability-avoid-pragma-once += + +Finds uses of ``#pragma once`` and suggests replacing them with standard +include guards (``#ifndef``/``#define``/``#endif``) for improved por

[clang-tools-extra] [clang-tidy] Add avoid-pragma-once. (PR #140388)

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

2025-05-18 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor commented: Some more nit changes. If you will to contribute further, reading https://clang.llvm.org/extra/clang-tidy/Contributing.html may help you. Particularly "Making your check robust" and "Documenting your check". Although, most of it already covered in comments

[clang-tools-extra] [clang-tidy] Add avoid-pragma-once. (PR #140388)

2025-05-18 Thread Baranov Victor via cfe-commits
@@ -0,0 +1,24 @@ +.. title:: clang-tidy - portability-avoid-pragma-once + +portability-avoid-pragma-once += + +Finds uses of ``#pragma once`` and suggests replacing them with standard +include guards (``#ifndef``/``#define``/``#endif``) for improved por

[clang-tools-extra] [clang-tidy] Add avoid-pragma-once. (PR #140388)

2025-05-18 Thread Baranov Victor via cfe-commits
@@ -0,0 +1,12 @@ +.. title:: clang-tidy - portability-avoid-pragma-once + +portability-avoid-pragma-once += + +This check catches pragma once usage. + +For example: + +``` vbvictor wrote: use `.. code-block:: c++` for code, see other .

[clang-tools-extra] [clang-tidy] Add avoid-pragma-once. (PR #140388)

2025-05-18 Thread Baranov Victor via cfe-commits
@@ -351,6 +351,7 @@ Clang-Tidy Checks :doc:`performance-type-promotion-in-math-fn `, "Yes" :doc:`performance-unnecessary-copy-initialization `, "Yes" :doc:`performance-unnecessary-value-param `, "Yes" + :doc:`portability-avoid-pragma-once `, "Yes"

[clang-tools-extra] [clang-tidy] Add avoid-pragma-once. (PR #140388)

2025-05-18 Thread Baranov Victor via cfe-commits
@@ -0,0 +1,5 @@ +// RUN: %check_clang_tidy %s portability-avoid-pragma-once %t \ +// RUN: -- --header-filter='.*' -- -I%S/Inputs/avoid-pragma-once + +#include "lib.h" +// CHECK-MESSAGES: lib.h:1:1: warning: Avoid pragma once. vbvictor wrote: Please add a newli

[clang-tools-extra] [clang-tidy] Add avoid-pragma-once. (PR #140388)

2025-05-18 Thread Baranov Victor via cfe-commits
@@ -0,0 +1,12 @@ +.. title:: clang-tidy - portability-avoid-pragma-once + +portability-avoid-pragma-once += + +This check catches pragma once usage. vbvictor wrote: ```suggestion This check catches ``#pragma once`` usage. ``` Language

[clang-tools-extra] [clang-tidy] Add avoid-pragma-once. (PR #140388)

2025-05-18 Thread Baranov Victor via cfe-commits
@@ -0,0 +1,49 @@ +//===--- AvoidPragmaOnceCheck.cpp - clang-tidy ===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apa

[clang-tools-extra] [clang-tidy] Add avoid-pragma-once. (PR #140388)

2025-05-18 Thread Baranov Victor via cfe-commits
@@ -0,0 +1 @@ +#pragma once vbvictor wrote: Missing tests where there are spaces between `#` and `pragma` and multiple spaces between `pragma` and `once`. https://github.com/llvm/llvm-project/pull/140388 ___ cfe-commi

[clang-tools-extra] [clang-tidy] Add avoid-pragma-once. (PR #140388)

2025-05-18 Thread Baranov Victor via cfe-commits
@@ -0,0 +1,49 @@ +//===--- AvoidPragmaOnceCheck.cpp - clang-tidy ===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apa

[clang-tools-extra] [clang-tidy] Add avoid-pragma-once. (PR #140388)

2025-05-18 Thread Baranov Victor via cfe-commits
@@ -0,0 +1,34 @@ +//===--- AvoidPragmaOnceCheck.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 avoid-pragma-once. (PR #140388)

2025-05-18 Thread Baranov Victor via cfe-commits
@@ -0,0 +1,12 @@ +.. title:: clang-tidy - portability-avoid-pragma-once + +portability-avoid-pragma-once += + +This check catches pragma once usage. + vbvictor wrote: It will be very helpful for users to if you write a small descriptio

[clang-tools-extra] [clang-tidy] Add avoid-pragma-once. (PR #140388)

2025-05-18 Thread Baranov Victor via cfe-commits
@@ -142,6 +142,11 @@ New checks Finds potentially erroneous calls to ``reset`` method on smart pointers when the pointee type also has a ``reset`` method. +- New :doc:`portability-avoid-pragma-once + ` check. + + A check that catches pragma once. vbvicto

[clang-tools-extra] [clang-tidy] Add avoid-pragma-once. (PR #140388)

2025-05-18 Thread Baranov Victor via cfe-commits
@@ -0,0 +1,12 @@ +.. title:: clang-tidy - portability-avoid-pragma-once + +portability-avoid-pragma-once += + +This check catches pragma once usage. vbvictor wrote: Avoid "This check", "The check" in this context. Look at descriptions

[clang-tools-extra] [clang-tidy] Add avoid-pragma-once. (PR #140388)

2025-05-18 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor commented: Good check! Mostly docs/phrasing comments from me. https://github.com/llvm/llvm-project/pull/140388 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commi

[clang-tools-extra] [clang-tidy] Add avoid-pragma-once. (PR #140388)

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

2025-05-17 Thread Baranov Victor via cfe-commits
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/mailman/listinfo/cfe-commits

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

2025-05-17 Thread Baranov Victor via cfe-commits
@@ -0,0 +1,74 @@ +//===--- FunctionVisibilityChangeCheck.cpp - clang-tidy ---===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apa

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

2025-05-17 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor commented: I think we should make change the name of the check to include "method" or "member-function" words in it. It will make clear that we check for methods visibility and not some visibility attributes on functions. Possible names: bugprone-member-function-visi

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

2025-05-17 Thread Baranov Victor via cfe-commits
vbvictor wrote: For now, I think you should wait for an approval/review from one of the clang-tidy maintainers (PiotrZSL, HerrCai0907) that will also help merge this PR. It can take some time, but the new release will only be in July, so don't need to worry about missing your changes for now.

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

2025-05-17 Thread Baranov Victor via cfe-commits
@@ -0,0 +1,74 @@ +//===--- FunctionVisibilityChangeCheck.cpp - clang-tidy ---===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apa

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

2025-05-17 Thread Baranov Victor via cfe-commits
vbvictor wrote: You should wait for an approval from one of the clang-tidy maintainers (PiotrZSL, carlosgalvezp, HerrCai0907) that will also help merge this PR. It can take some time, but the new release will only be in July, so don't need to worry about it for now. You can "Ping" reviewers wi

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

2025-05-17 Thread Baranov Victor via cfe-commits
@@ -130,6 +130,11 @@ New checks Finds unintended character output from ``unsigned char`` and ``signed char`` to an ``ostream``. +- New :doc:`cppcoreguidelines-use-enum-class + ` check. + + Finds plain non-class ``enum`` definitions that could use ``enum class``.

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

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

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

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

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

[clang-tools-extra] Fix the issue #139467 ([clang-tidy] false positive narrowing conversion) (PR #139474)

2025-05-12 Thread Baranov Victor via cfe-commits
@@ -554,15 +554,23 @@ bool NarrowingConversionsCheck::handleConditionalOperator( // We have an expression like so: `output = cond ? lhs : rhs` // From the point of view of narrowing conversion we treat it as two // expressions `output = lhs` and `output = rhs`. -

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

2025-05-10 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor created https://github.com/llvm/llvm-project/pull/139430 Fixed false negatives with type aliases in `cppcoreguidlines-pro-bounds-pointer-arithmetic` check. Added tests with pointer arithmetic in template functions to make test cases more robust. Closes https://gith

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

2025-05-10 Thread Baranov Victor via cfe-commits
Paul =?utf-8?q?Heidekrüger?= , Paul =?utf-8?q?Heidekrüger?= , Paul =?utf-8?q?Heidekrüger?= , Paul =?utf-8?q?Heidekrüger?= , Paul =?utf-8?q?Heidekrüger?= , Paul =?utf-8?q?Heidekrüger?= , Paul =?utf-8?q?Heidekrüger?= , Paul =?utf-8?q?Heidekrüger?= , Paul =?utf-8?q?Heidekrüger?= , Paul =?utf-8?q?Heide

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

2025-05-10 Thread Baranov Victor via cfe-commits
Paul =?utf-8?q?Heidekrüger?= , Paul =?utf-8?q?Heidekrüger?= , Paul =?utf-8?q?Heidekrüger?= , Paul =?utf-8?q?Heidekrüger?= , Paul =?utf-8?q?Heidekrüger?= , Paul =?utf-8?q?Heidekrüger?= , Paul =?utf-8?q?Heidekrüger?= , Paul =?utf-8?q?Heidekrüger?= , Paul =?utf-8?q?Heidekrüger?= , Paul =?utf-8?q?Heide

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

2025-05-10 Thread Baranov Victor via cfe-commits
Paul =?utf-8?q?Heidekrüger?= , Paul =?utf-8?q?Heidekrüger?= , Paul =?utf-8?q?Heidekrüger?= , Paul =?utf-8?q?Heidekrüger?= , Paul =?utf-8?q?Heidekrüger?= , Paul =?utf-8?q?Heidekrüger?= , Paul =?utf-8?q?Heidekrüger?= , Paul =?utf-8?q?Heidekrüger?= , Paul =?utf-8?q?Heidekrüger?= , Paul =?utf-8?q?Heide

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

2025-05-10 Thread Baranov Victor via cfe-commits
@@ -0,0 +1,227 @@ +// RUN: %check_clang_tidy -std=c++2b -check-suffix=DEFAULT %s \ vbvictor wrote: You can have one test file with multiple RUN-commands with different c++ standarts using defines. Look at `clang-tools-extra/test/clang-tidy/checkers/modernize/ma

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

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

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

2025-05-09 Thread Baranov Victor via cfe-commits
@@ -0,0 +1,13 @@ +// RUN: %check_clang_tidy -std=c++11-or-later %s cppcoreguidelines-use-enum-class %t -- -config="{CheckOptions: {cppcoreguidelines-use-enum-class.IgnoreUnscopedEnumsInClasses: true}}" -- + +enum E {}; +// CHECK-MESSAGES: :[[@LINE-1]]:6: warning: enum 'E' is uns

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

2025-05-09 Thread Baranov Victor via cfe-commits
@@ -198,7 +203,7 @@ Changes in existing checks diagnosing designated initializers for ``std::array`` initializations. - Improved :doc:`modernize-use-ranges - ` check by updating suppress + ` check by updating suppress vbvictor wrote: Unrelated change? I'

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

2025-05-09 Thread Baranov Victor via cfe-commits
@@ -59,6 +60,8 @@ class CppCoreGuidelinesModule : public ClangTidyModule { void addCheckFactories(ClangTidyCheckFactories &CheckFactories) override { CheckFactories.registerCheck( "cppcoreguidelines-avoid-capturing-lambda-coroutines"); +CheckFactories.register

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

2025-05-09 Thread Baranov Victor via cfe-commits
@@ -0,0 +1,31 @@ +.. title:: clang-tidy - cppcoreguidelines-use-enum-class + +cppcoreguidelines-use-enum-class += vbvictor wrote: ```suggestion cppcoreguidelines-use-enum-class ``` https://github.com/l

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

2025-05-09 Thread Baranov Victor via cfe-commits
@@ -0,0 +1,31 @@ +.. title:: clang-tidy - cppcoreguidelines-use-enum-class + +cppcoreguidelines-use-enum-class += + +Finds plain non-class ``enum`` definitions that could use ``enum class``. vbvictor wrote: ```suggestion Finds unscoped

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

2025-05-09 Thread Baranov Victor via cfe-commits
@@ -136,6 +136,11 @@ New checks Finds potentially erroneous calls to ``reset`` method on smart pointers when the pointee type also has a ``reset`` method. +- New :doc:`cppcoreguidelines-use-enum-class vbvictor wrote: Please make in alphabetical order htt

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

2025-05-09 Thread Baranov Victor via cfe-commits
@@ -0,0 +1,13 @@ +// RUN: %check_clang_tidy -std=c++11-or-later %s cppcoreguidelines-use-enum-class %t -- -config="{CheckOptions: {cppcoreguidelines-use-enum-class.IgnoreUnscopedEnumsInClasses: true}}" -- vbvictor wrote: nit: for readability, please break this

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

2025-05-09 Thread Baranov Victor via cfe-commits
@@ -0,0 +1,31 @@ +.. title:: clang-tidy - cppcoreguidelines-use-enum-class + +cppcoreguidelines-use-enum-class += + +Finds plain non-class ``enum`` definitions that could use ``enum class``. + +This check implements `Enum.3 +

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

2025-05-09 Thread Baranov Victor via cfe-commits
@@ -0,0 +1,31 @@ +.. title:: clang-tidy - cppcoreguidelines-use-enum-class + +cppcoreguidelines-use-enum-class += + +Finds plain non-class ``enum`` definitions that could use ``enum class``. + +This check implements `Enum.3 +

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

2025-05-09 Thread Baranov Victor via cfe-commits
@@ -0,0 +1,13 @@ +// RUN: %check_clang_tidy -std=c++11-or-later %s cppcoreguidelines-use-enum-class %t -- -config="{CheckOptions: {cppcoreguidelines-use-enum-class.IgnoreUnscopedEnumsInClasses: true}}" -- + +enum E {}; +// CHECK-MESSAGES: :[[@LINE-1]]:6: warning: enum 'E' is uns

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

2025-05-09 Thread Baranov Victor via cfe-commits
@@ -211,6 +211,7 @@ Clang-Tidy Checks :doc:`cppcoreguidelines-rvalue-reference-param-not-moved `, :doc:`cppcoreguidelines-slicing `, :doc:`cppcoreguidelines-special-member-functions `, + :doc:`cppcoreguidelines-use-enum-class `, "Yes" vbvictor wro

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

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

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

2025-05-09 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor commented: Mostly nits and documentation suggestions/improvements. https://github.com/llvm/llvm-project/pull/138282 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-

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

2025-05-09 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor updated https://github.com/llvm/llvm-project/pull/126434 >From c30d6e1cb5770d9a7bda077c60958027515c065c 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 check bugprone-misleading-setter-of-reference (PR #132242)

2025-05-07 Thread Baranov Victor via cfe-commits
=?utf-8?q?Balázs_Kéri?= , =?utf-8?q?Balázs_Kéri?= , =?utf-8?q?Balázs_Kéri?= , =?utf-8?q?Balázs_Kéri?= , =?utf-8?q?Balázs_Kéri?= Message-ID: In-Reply-To: @@ -0,0 +1,58 @@ +//===--- MisleadingSetterOfReferenceCheck.cpp - clang-tidy-===// +// +// Part of the LLVM

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

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

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

2025-05-06 Thread Baranov Victor via cfe-commits
@@ -0,0 +1,58 @@ +//===--- MisleadingSetterOfReferenceCheck.cpp - clang-tidy-===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apa

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

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

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

2025-05-06 Thread Baranov Victor via cfe-commits
@@ -0,0 +1,61 @@ +//===--- MisleadingSetterOfReferenceCheck.cpp - clang-tidy-===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apa

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

2025-05-06 Thread Baranov Victor via cfe-commits
vbvictor wrote: Rebased+Ping https://github.com/llvm/llvm-project/pull/126434 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

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

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

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

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

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

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

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

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

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

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

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

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

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

2025-05-05 Thread Baranov Victor via cfe-commits
@@ -0,0 +1,34 @@ +//===--- UseEnumClassCheck.cpp - clang-tidy ---===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apa

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

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

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

2025-05-05 Thread Baranov Victor via cfe-commits
@@ -0,0 +1,34 @@ +//===--- UseEnumClassCheck.cpp - clang-tidy ---===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apa

  1   2   3   4   5   6   >