[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] [ASTMatchers][NFC] improve 'isInteger' docs to show matching of unsigned (PR #147012)

2025-07-04 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor closed https://github.com/llvm/llvm-project/pull/147012 ___ 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 +155,10 @@ static const llvm::StringSet<> TypeTraits = { "result_of", "invoke_result", "type_identity", +"compare_three_way_result", +"common_comparison_category", vbvictor wrote: This also has variadic templates https://github.c

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

2025-07-04 Thread Baranov Victor via cfe-commits
@@ -38,3 +38,10 @@ Options #define IS_SIGNED(T) std::is_signed::value Defaults to `false`. + +Limitations +--- + +Does not currently diagnose uses of ``std::chrono::is_clock``, +``std::chrono::treat_as_floating_point``, ``std::tuple_element``, +or ``std::variant

[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. 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] filter check options by enabled checks in '--dump-config' (PR #147142)

2025-07-06 Thread Baranov Victor via cfe-commits
@@ -503,6 +503,21 @@ getCheckNames(const ClangTidyOptions &Options, return Factory.getCheckNames(); } +void filterCheckOptions(ClangTidyOptions &Options, +const std::vector &EnabledChecks) { + StringSet<> EnabledChecksSet(llvm::from_range, EnabledChe

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

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

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

2025-07-06 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor edited 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] Fix false positives with template in `misc-unconventional-assign-operator` check (PR #143292)

2025-07-06 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor closed https://github.com/llvm/llvm-project/pull/143292 ___ 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-06 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor approved this pull request. LGTM, we'd wait a couple of days before merge in case someone else wants to review it too. https://github.com/llvm/llvm-project/pull/147074 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

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

2025-07-06 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor edited https://github.com/llvm/llvm-project/pull/146970 ___ 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-06 Thread Baranov Victor via cfe-commits
@@ -0,0 +1,104 @@ +// RUN: %check_clang_tidy %s portability-avoid-platform-specific-fundamental-types %t -- -config="{CheckOptions: [{key: portability-avoid-platform-specific-fundamental-types.WarnOnInts, value: false}, {key: portability-avoid-platform-specific-fundamental-ty

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

2025-07-06 Thread Baranov Victor via cfe-commits
@@ -0,0 +1,52 @@ +//==-- AvoidPlatformSpecificFundamentalTypesCheck.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 portability-avoid-platform-specific-fundamental-types (PR #146970)

2025-07-06 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] Add portability-avoid-platform-specific-fundamental-types (PR #146970)

2025-07-06 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor commented: Please remove unnecessary comments that tell the same as code itself, speaking mostly about `registerMatchers`. https://github.com/llvm/llvm-project/pull/146970 ___ cfe-commits mailing list cfe-commits@lists.llvm

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

2025-07-06 Thread Baranov Victor via cfe-commits
@@ -0,0 +1,43 @@ +//===--- AvoidPlatformSpecificFundamentalTypesCheck.h - clang-tidy ---*- C++ +//-*-===// vbvictor wrote: Please format this as one-line https://github.com/llvm/llvm-project/pull/146970 ___ cfe-co

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

2025-07-06 Thread Baranov Victor via cfe-commits
@@ -0,0 +1,69 @@ +// RUN: %check_clang_tidy %s portability-avoid-platform-specific-fundamental-types %t -- -config="{CheckOptions: [{key: portability-avoid-platform-specific-fundamental-types.WarnOnInts, value: false}, {key: portability-avoid-platform-specific-fundamental-typ

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

2025-07-06 Thread Baranov Victor via cfe-commits
@@ -0,0 +1,43 @@ +//===--- AvoidPlatformSpecificFundamentalTypesCheck.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-Ide

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

2025-07-06 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] Add portability-avoid-platform-specific-fundamental-types (PR #146970)

2025-07-06 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] Add portability-avoid-platform-specific-fundamental-types (PR #146970)

2025-07-06 Thread Baranov Victor via cfe-commits
@@ -0,0 +1,121 @@ +//===--- 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-Ide

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

2025-07-06 Thread Baranov Victor via cfe-commits
@@ -0,0 +1,147 @@ +// RUN: %check_clang_tidy %s portability-avoid-platform-specific-fundamental-types %t -- -config="{CheckOptions: [{key: portability-avoid-platform-specific-fundamental-types.WarnOnChars, value: false}, {key: portability-avoid-platform-specific-fundamental-t

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

2025-07-06 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] Add portability-avoid-platform-specific-fundamental-types (PR #146970)

2025-07-06 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor edited https://github.com/llvm/llvm-project/pull/146970 ___ 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-06 Thread Baranov Victor via cfe-commits
@@ -0,0 +1,111 @@ +//===--- UseConcisePreprocessorDirectivesCheck.cpp - clang-tidy ---===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Ap

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

2025-07-06 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor edited 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] added `RespectOpaqueTypes` option to `readability-qualified-auto check` (PR #147060)

2025-07-06 Thread Baranov Victor via cfe-commits
vbvictor wrote: I like `IgnoreAliasing`. That is what user most likely understand with ease. `SugaredTypes` is more clang developer-ish indeed. https://github.com/llvm/llvm-project/pull/147060 ___ cfe-commits mailing list cfe-commits@lists.llvm.org ht

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

2025-07-06 Thread Baranov Victor via cfe-commits
@@ -0,0 +1,40 @@ +//===--- UseConcisePreprocessorDirectivesCheck.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 portability-avoid-platform-specific-fundamental-types (PR #146970)

2025-07-06 Thread Baranov Victor via cfe-commits
@@ -0,0 +1,52 @@ +//==-- AvoidPlatformSpecificFundamentalTypesCheck.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 portability-avoid-platform-specific-fundamental-types (PR #146970)

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

[clang-tools-extra] [clang-tidy] Fix false positive for cppcoreguidelines-pro-bounds-pointer-arithmetic (PR #127394)

2025-07-02 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor closed https://github.com/llvm/llvm-project/pull/127394 ___ 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-constexpr check (PR #146553)

2025-07-01 Thread Baranov Victor via cfe-commits
vbvictor wrote: I'm +1 on the `modernize-use-constexpr`. https://github.com/llvm/llvm-project/pull/146553 ___ 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-constexpr check (PR #146553)

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

[clang-tools-extra] [clang-tidy] add misc-constexpr check (PR #146553)

2025-07-01 Thread Baranov Victor via cfe-commits
@@ -19,6 +19,7 @@ set_target_properties(genconfusable PROPERTIES FOLDER "Clang Tools Extra/Sourceg add_clang_library(clangTidyMiscModule STATIC ConstCorrectnessCheck.cpp + UseConstexprCheck.cpp vbvictor wrote: Please fix ordering https://github.com/llvm/

[clang-tools-extra] [clang-tidy] add misc-constexpr check (PR #146553)

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

[clang-tools-extra] [clang-tidy] add misc-constexpr check (PR #146553)

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

[clang-tools-extra] [clang-tidy] add misc-constexpr check (PR #146553)

2025-07-01 Thread Baranov Victor via cfe-commits
@@ -43,6 +44,7 @@ class MiscModule : public ClangTidyModule { "misc-confusable-identifiers"); CheckFactories.registerCheck( "misc-const-correctness"); +CheckFactories.registerCheck("misc-use-constexpr"); vbvictor wrote: ditto https://g

[clang-tools-extra] [clang-tidy] add misc-constexpr check (PR #146553)

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

[clang-tools-extra] [clang-tidy] add misc-constexpr check (PR #146553)

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

[clang-tools-extra] [clang-tidy] add misc-constexpr check (PR #146553)

2025-07-01 Thread Baranov Victor via cfe-commits
@@ -270,6 +270,10 @@ Changes in existing checks excluding variables with ``thread_local`` storage class specifier from being matched. +- Added :doc:`modernize-use-constexpr vbvictor wrote: This should be placed under "New checks" section https://github.c

[clang-tools-extra] [clang-tidy] add misc-constexpr check (PR #146553)

2025-07-01 Thread Baranov Victor via cfe-commits
@@ -270,6 +270,10 @@ Changes in existing checks excluding variables with ``thread_local`` storage class specifier from being matched. +- Added :doc:`modernize-use-constexpr vbvictor wrote: Also, synced with first sentence in docs. https://github.com/llvm

[clang-tools-extra] [clang-tidy] Fix false positive for cppcoreguidelines-pro-bounds-pointer-arithmetic (PR #127394)

2025-07-02 Thread Baranov Victor via cfe-commits
vbvictor wrote: "Checking for the ability to merge automatically..." was for the past 6 hours, could you please rebase on fresh main again, maybe some conflicts cause it. https://github.com/llvm/llvm-project/pull/127394 ___ cfe-commits mailing list cf

[clang-tools-extra] [clang-tidy] Add flag to specify an alternative to std::forward (PR #138755)

2025-06-30 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor approved this pull request. LGTM, can merge it after CI pass https://github.com/llvm/llvm-project/pull/138755 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commit

[clang-tools-extra] [clang-tidy] Add flag to specify an alternative to std::move in cppcoreguidelines-rvalue-reference-param-not-moved (PR #138757)

2025-06-30 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor closed https://github.com/llvm/llvm-project/pull/138757 ___ 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 flag to specify an alternative to std::move in cppcoreguidelines-rvalue-reference-param-not-moved (PR #138757)

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

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

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

[clang-tools-extra] [clang-tidy] Add flag to specify an alternative to std::forward (PR #138755)

2025-06-30 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor closed https://github.com/llvm/llvm-project/pull/138755 ___ 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 flag to specify an alternative to std::move in cppcoreguidelines-rvalue-reference-param-not-moved (PR #138757)

2025-06-30 Thread Baranov Victor via cfe-commits
vbvictor wrote: Please fix merge conflicts that occurred after merge of `std::forward` PR https://github.com/llvm/llvm-project/pull/138757 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commi

[clang-tools-extra] [clang-tidy] Improve `bugprone-infinite-loop` check by adding handing for structured bindings (PR #144213)

2025-06-26 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor approved this pull request. LGTM, but I'd like to wait for a second reviewer for some time to double-check if some tests are missing https://github.com/llvm/llvm-project/pull/144213 ___ cfe-commits mailing list cfe-commits@

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

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

[clang] [clang][analyzer] Fix the false positive ArgInitializedness warning on unnamed bit-field (PR #145066)

2025-06-27 Thread Baranov Victor via cfe-commits
@@ -2122,8 +2122,21 @@ SVal RegionStoreManager::getBindingForField(RegionBindingsConstRef B, if (const std::optional &V = B.getDirectBinding(R)) return *V; - // If the containing record was initialized, try to get its constant value. + // UnnamedBitField is always Und

[clang] [clang][analyzer] Fix the false positive ArgInitializedness warning on unnamed bit-field (PR #145066)

2025-06-27 Thread Baranov Victor via cfe-commits
@@ -253,6 +253,9 @@ class FindUninitializedField { const RecordDecl *RD = RT->getDecl()->getDefinition(); assert(RD && "Referred record has no definition"); for (const auto *I : RD->fields()) { +if (I->isUnnamedBitField()) { + continue; +

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

2025-06-27 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor updated https://github.com/llvm/llvm-project/pull/142839 >From 06824612e08a578dab8a0c23957624b3f5ac Mon Sep 17 00:00:00 2001 From: Victor Baranov Date: Wed, 4 Jun 2025 22:29:51 +0300 Subject: [PATCH 1/2] [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-06-27 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor updated https://github.com/llvm/llvm-project/pull/142839 >From 06824612e08a578dab8a0c23957624b3f5ac 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] Add bugprone-move-shared-pointer-contents check. (PR #67467)

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

[clang-tools-extra] [clang-tidy] Add bugprone-move-shared-pointer-contents check. (PR #67467)

2025-07-01 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor edited https://github.com/llvm/llvm-project/pull/67467 ___ 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-06-29 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor closed 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] [Clang] Fix '-Wformat-overflow' FP when floats had field-width and plus prefix (PR #144274)

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

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

2025-06-29 Thread Baranov Victor via cfe-commits
vbvictor wrote: Ping 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] Fix false positives in `readability-redundant-inline-specifier` (PR #135391)

2025-06-27 Thread Baranov Victor via cfe-commits
=?utf-8?q?Bj=C3=B6rn?= Svensson , =?utf-8?q?Bj=C3=B6rn?= Svensson Message-ID: In-Reply-To: https://github.com/vbvictor approved this pull request. https://github.com/llvm/llvm-project/pull/135391 ___ cfe-commits mailing list cfe-commits@lists.llvm.o

[clang-tools-extra] [clang-tidy] Fix false positives in `readability-redundant-inline-specifier` (PR #135391)

2025-06-27 Thread Baranov Victor via cfe-commits
=?utf-8?q?Björn?= Svensson , =?utf-8?q?Björn?= Svensson Message-ID: In-Reply-To: https://github.com/vbvictor closed https://github.com/llvm/llvm-project/pull/135391 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bi

[clang] [clang][analyzer] Fix the false positive ArgInitializedness warning on unnamed bit-field (PR #145066)

2025-06-27 Thread Baranov Victor via cfe-commits
vbvictor wrote: I restarted the job, there is already an issue for such fail https://github.com/llvm/llvm-project/issues/145703 https://github.com/llvm/llvm-project/pull/145066 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm

[clang-tools-extra] [clang-tidy] Fix false positive for cppcoreguidelines-pro-bounds-pointer-arithmetic (PR #127394)

2025-06-29 Thread Baranov Victor via cfe-commits
@@ -0,0 +1,19 @@ +// RUN: %check_clang_tidy %s cppcoreguidelines-pro-bounds-pointer-arithmetic %t vbvictor wrote: I think it's better to write this test in the existing main test file than to create new test files for specific issues. After N months/years, it wi

[clang-tools-extra] [clang-tidy] Fix false positive for cppcoreguidelines-pro-bounds-pointer-arithmetic (PR #127394)

2025-06-29 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor approved this pull request. LGTM with nit. Please rebase on fresh main and I think we can merge it, unless @carlosgalvezp has something against. https://github.com/llvm/llvm-project/pull/127394 ___ cfe-commits mailing list

[clang-tools-extra] [clang-tidy] Add flag to specify an alternative to std::forward (PR #138755)

2025-06-29 Thread Baranov Victor via cfe-commits
vbvictor wrote: > I have the issue where I want to test the custom_move and I need check to > pass only for -check-suffix=,MOVEFUNCTION and fail for everything else, since > it still expects ::std::move. I am not sure how to write this. You can create a separate file `missing-std-forward-custo

[clang-tools-extra] [clang-tidy] Fix false positive for cppcoreguidelines-pro-bounds-pointer-arithmetic (PR #127394)

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

[clang-tools-extra] [clangd][NFC] added const and constexpr (PR #143193)

2025-07-04 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor edited https://github.com/llvm/llvm-project/pull/143193 ___ 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] [clang-tools-extra] [clang-tidy] EndSourceFile() for preprocessor before diagnostic client (PR #145784)

2025-07-02 Thread Baranov Victor via cfe-commits
@@ -292,6 +292,21 @@ class ClangTidyDiagnosticConsumer : public DiagnosticConsumer { void HandleDiagnostic(DiagnosticsEngine::Level DiagLevel, const Diagnostic &Info) override; + void BeginSourceFile(const LangOptions &LangOpts, vbv

[clang] [analyzer] Fix crash on compound literals with bitfields in unions (PR #146418)

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

[clang-tools-extra] [clangd][NFC] added const and constexpr to HeaderSourceSwitch (PR #143193)

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

[clang-tools-extra] [clangd][NFC] added const and constexpr (PR #143193)

2025-07-04 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor edited https://github.com/llvm/llvm-project/pull/143193 ___ 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
vbvictor wrote: > That's probably happening due to incomplete C++20 support in either Clang 14 > or the GNU libstdc++ 12. Current standard that LLVM use is c++17. But we generally should support compilers at [least 3 years of compilers](https://llvm.org/docs/DeveloperPolicy.html#updating-tool

[clang-tools-extra] [clang-tidy][NFC] 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][NFC] 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] [clangd][NFC] added const and constexpr (PR #143193)

2025-07-04 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor commented: Patch LGTM, but it may have to be approved by one of clangd's maintainers that I added. You should also add `NFC` in the title if you have non-functional changes. https://github.com/llvm/llvm-project/pull/143193 ___

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

2025-07-04 Thread Baranov Victor via cfe-commits
vbvictor wrote: I wonder did you find this somehow automatically or manually? 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] 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

<    6   7   8   9   10   11   12   13   >