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

2025-07-05 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-05 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-05 Thread Baranov Victor via cfe-commits
@@ -0,0 +1,138 @@ +// RUN: %check_clang_tidy -std=c++98 -check-suffixes=,CXX %s readability-use-concise-preprocessor-directives %t +// RUN: %check_clang_tidy -std=c++11 -check-suffixes=,CXX %s readability-use-concise-preprocessor-directives %t +// RUN: %check_clang_tidy -std=c++

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

2025-07-05 Thread Baranov Victor via cfe-commits
@@ -0,0 +1,138 @@ +// RUN: %check_clang_tidy -std=c++98 -check-suffixes=,CXX %s readability-use-concise-preprocessor-directives %t +// RUN: %check_clang_tidy -std=c++11 -check-suffixes=,CXX %s readability-use-concise-preprocessor-directives %t +// RUN: %check_clang_tidy -std=c++

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

2025-07-05 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 new check: `readability-use-concise-preprocessor-directives` (PR #146830)

2025-07-05 Thread Baranov Victor via cfe-commits
@@ -0,0 +1,138 @@ +// RUN: %check_clang_tidy -std=c++98 -check-suffixes=,CXX %s readability-use-concise-preprocessor-directives %t +// RUN: %check_clang_tidy -std=c++11 -check-suffixes=,CXX %s readability-use-concise-preprocessor-directives %t +// RUN: %check_clang_tidy -std=c++

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

2025-07-05 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 misc-bool-bitwise-operation check (PR #142324)

2025-07-05 Thread Baranov Victor via cfe-commits
vbvictor wrote: I believe all PiotrZSL's comments are correctly resolved, and we could merge it next week if there would be no more reviews. One nit from me: since we don't match template functions, we could add `Limitations` section in check docs to avoid potential confusion and false-negativ

[clang-tools-extra] [clangd] Extend call hierarchy for enum constants (PR #147042)

2025-07-05 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor edited https://github.com/llvm/llvm-project/pull/147042 ___ 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
vbvictor wrote: > IMO this should just go into LLVM 20, it's a trivial fix. I don't oppose, then just note that we don't have much time till 20th final release. https://github.com/llvm/llvm-project/pull/147048 ___ cfe-commits mailing list cfe-commi

[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: Please remove other recursive traits as well, `variant_alternative` is also one of them. https

[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] [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-tools-extra] [clang-tidy] Improve `bugprone-exception-escape`: add stacktrace of escaped exception (PR #134375)

2025-07-14 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor edited 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] [clang-tidy] Improve `bugprone-exception-escape`: add stacktrace of escaped exception (PR #134375)

2025-07-14 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor closed 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] [clang-tidy] do not diagnose array types within implicit instantiations of a template (PR #132924)

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

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

2025-07-14 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor commented: Tests lgtm, minor comments on code. Please rebase on fresh main https://github.com/llvm/llvm-project/pull/132924 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listi

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

2025-07-14 Thread Baranov Victor via cfe-commits
@@ -66,22 +89,45 @@ void AvoidCArraysCheck::registerMatchers(MatchFinder *Finder) { hasParent(varDecl(isExternC())), hasParent(fieldDecl( hasParent(recordDecl(isExternCContext(), -

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

2025-07-14 Thread Baranov Victor via cfe-commits
@@ -66,22 +89,45 @@ void AvoidCArraysCheck::registerMatchers(MatchFinder *Finder) { hasParent(varDecl(isExternC())), hasParent(fieldDecl( hasParent(recordDecl(isExternCContext(), -

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

2025-07-14 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor edited 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] [clang-tidy] Update `confusables.txt` in `misc-confusable-identifiers` (PR #148399)

2025-07-14 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor closed https://github.com/llvm/llvm-project/pull/148399 ___ 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] Do less unnecessary work in `NoLintDirectiveHandler` (PR #147553)

2025-07-14 Thread Baranov Victor via cfe-commits
@@ -93,15 +92,17 @@ class NoLintToken { // The location of the first character, "N", in "NOLINT". size_t Pos; + // A glob of the checks this NOLINT token disables. + std::unique_ptr ChecksGlob; vbvictor wrote: Do we need to put it in `public`? https://

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

2025-07-14 Thread Baranov Victor via cfe-commits
@@ -349,46 +369,21 @@ bool NoLintDirectiveHandler::Impl::diagHasNoLint( return false; // Do we have cached NOLINT block locations for this file? - if (Cache.count(*FileName) == 0) + if (!Cache.contains(*FileName)) // Warning: heavy operation - need to read entire

[clang] [clang][docs] Add all clang-tools-extra (PR #148622)

2025-07-14 Thread Baranov Victor via cfe-commits
@@ -97,6 +97,41 @@ linter tool. It provides an extensible framework for building compiler-based static analyses detecting and fixing bug-prone patterns, performance, portability and maintainability issues. +``clang-include-fixer`` +--- + +`clang-include-fi

[clang] [clang][docs] Add all clang-tools-extra (PR #148622)

2025-07-14 Thread Baranov Victor via cfe-commits
@@ -97,6 +97,41 @@ linter tool. It provides an extensible framework for building compiler-based static analyses detecting and fixing bug-prone patterns, performance, portability and maintainability issues. +``clang-include-fixer`` +--- + +`clang-include-fi

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

2025-07-15 Thread Baranov Victor via cfe-commits
@@ -134,14 +136,26 @@ void QualifiedAutoCheck::registerMatchers(MatchFinder *Finder) { auto IsBoundToType = refersToType(equalsBoundNode("type")); auto UnlessFunctionType = unless(hasUnqualifiedDesugaredType(functionType())); - auto IsAutoDeducedToPointer = [](const std

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

2025-07-15 Thread Baranov Victor via cfe-commits
@@ -96,3 +96,49 @@ Note in the LLVM alias, the default value is `false`. matched against only the type name (i.e. ``Type``). E.g. to suppress reports for ``std::array`` iterators use `std::array<.*>::(const_)?iterator` string. The default is an empty string. + +.. option:

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

2025-07-15 Thread Baranov Victor via cfe-commits
@@ -96,3 +96,49 @@ Note in the LLVM alias, the default value is `false`. matched against only the type name (i.e. ``Type``). E.g. to suppress reports for ``std::array`` iterators use `std::array<.*>::(const_)?iterator` string. The default is an empty string. + +.. option:

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

2025-07-15 Thread Baranov Victor via cfe-commits
@@ -96,3 +96,49 @@ Note in the LLVM alias, the default value is `false`. matched against only the type name (i.e. ``Type``). E.g. to suppress reports for ``std::array`` iterators use `std::array<.*>::(const_)?iterator` string. The default is an empty string. + +.. option:

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

2025-07-15 Thread Baranov Victor via cfe-commits
@@ -96,3 +96,49 @@ Note in the LLVM alias, the default value is `false`. matched against only the type name (i.e. ``Type``). E.g. to suppress reports for ``std::array`` iterators use `std::array<.*>::(const_)?iterator` string. The default is an empty string. + +.. option:

[clang] [clang][docs] Add all clang-tools-extra (PR #148622)

2025-07-15 Thread Baranov Victor via cfe-commits
@@ -89,14 +89,53 @@ they'll be tracked here. The focus of this documentation is on the scope and features of the tools for other tool developers; each tool should provide its own user-focused documentation. -``clang-tidy`` +``Clang-Doc`` +- + +`Clang-Doc

[clang] [clang][docs] Add all clang-tools-extra (PR #148622)

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

[clang] [clang-tools-extra] [clang-tidy] bugprone-infinite-loop: Add support for tuple structured bindings (PR #147410)

2025-07-16 Thread Baranov Victor via cfe-commits
vbvictor wrote: Thank you for the PR! Did you try to address this issue https://github.com/llvm/llvm-project/issues/138842? There is an ongoing PR https://github.com/llvm/llvm-project/pull/144213 that essentially tries to handle the same case with structured bindings. To be fair with everyone,

[clang-tools-extra] [clang-tidy] Add MLIR check for old op builder usage. (PR #149148)

2025-07-16 Thread Baranov Victor via cfe-commits
vbvictor wrote: I think we should go through an RFC before creating a new module. TBH, I don't think we need a new module for MLIR in upstream since it is not a widely known thing in C++ community. Would it be viable for MLIR folks to use [plugins](https://clang.llvm.org/extra/clang-tidy/Contr

[clang-tools-extra] [clang-tidy] Add MLIR check for old op builder usage. (PR #149148)

2025-07-17 Thread Baranov Victor via cfe-commits
vbvictor wrote: Yes, Tobias didn't have time to make a PR with cleaning release notes. https://discord.com/channels/636084430946959380/654052269301694465/1394963436538040421. At this time of the week, I can't either:( We shouldn't merge anything before release n

[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-07-18 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor edited 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-07-18 Thread Baranov Victor via cfe-commits
@@ -0,0 +1,471 @@ +// RUN: %check_clang_tidy -std=c++17-or-later %s modernize-use-scoped-lock %t -- -- -isystem %clang_tidy_headers -fno-delayed-template-parsing + +#include + +void Positive() { + std::mutex m; + { +std::lock_guard l(m); +// CHECK-MESSAGES: :[[@LINE-1]

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

2025-07-18 Thread Baranov Victor via cfe-commits
@@ -0,0 +1,471 @@ +// RUN: %check_clang_tidy -std=c++17-or-later %s modernize-use-scoped-lock %t -- -- -isystem %clang_tidy_headers -fno-delayed-template-parsing + +#include + +void Positive() { + std::mutex m; + { +std::lock_guard l(m); +// CHECK-MESSAGES: :[[@LINE-1]

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

2025-07-18 Thread Baranov Victor via cfe-commits
@@ -0,0 +1,311 @@ +//===--- UseScopedLockCheck.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 modernize-use-constexpr check (PR #146553)

2025-07-17 Thread Baranov Victor via cfe-commits
@@ -0,0 +1,972 @@ +//===--- 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 modernize-use-constexpr check (PR #146553)

2025-07-17 Thread Baranov Victor via cfe-commits
@@ -0,0 +1,972 @@ +//===--- 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 modernize-use-constexpr check (PR #146553)

2025-07-17 Thread Baranov Victor via cfe-commits
@@ -0,0 +1,972 @@ +//===--- 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 modernize-use-constexpr check (PR #146553)

2025-07-17 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor commented: Gave this a very rought look, so only a couple of general questions/suggestions. Could we do something with methods that repeat in some of the visitors, e.g. `bool TraverseType(QualType QT)` and others. Maybe macros..? I can't think of a better idea right

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

2025-07-17 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor edited 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 modernize-use-constexpr check (PR #146553)

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

<    8   9   10   11   12   13   14   >