[clang-tools-extra] [clang-tidy] Mark bunch of checks as C++-only (PR #155083)

2025-08-23 Thread Julian Schmidt via cfe-commits
https://github.com/5chmidti approved this pull request. https://github.com/llvm/llvm-project/pull/155083 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy] support query based custom check (PR #131804)

2025-08-07 Thread Julian Schmidt via cfe-commits
5chmidti wrote: I'll find some time for this check on the weekend https://github.com/llvm/llvm-project/pull/131804 ___ 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 'enable-check-profiling' with aggregated results to 'run-clang-tidy' (PR #151011)

2025-08-03 Thread Julian Schmidt via cfe-commits
https://github.com/5chmidti approved this pull request. https://github.com/llvm/llvm-project/pull/151011 ___ 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] Avoid matching nodes in system headers (PR #151035)

2025-08-02 Thread Julian Schmidt via cfe-commits
https://github.com/5chmidti approved this pull request. LGTM. This will be super nice to have, and should also help make clang-tidy checks in clangd more responsive (when using system includes) > @5chmidti Here goes 2 more seconds :) XD https://github.com/llvm/llvm-project/pull/151035 ___

[clang-tools-extra] [clang-tidy] Skip declarations in system headers in RenamerClangTidyC… (PR #151772)

2025-08-01 Thread Julian Schmidt via cfe-commits
https://github.com/5chmidti approved this pull request. https://github.com/llvm/llvm-project/pull/151772 ___ 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] Avoid matching nodes in system headers (PR #151035)

2025-07-28 Thread Julian Schmidt via cfe-commits
@@ -105,6 +105,10 @@ Improvements to clang-tidy now run checks in parallel by default using all available hardware threads. Both scripts display the number of threads being used in their output. +- :program:`clang-tidy` no longer attemps to match AST nodes from system hea

[clang] [clang-tools-extra] [clang-tidy] Avoid matching nodes in system headers (PR #151035)

2025-07-28 Thread Julian Schmidt via cfe-commits
@@ -135,10 +135,15 @@ class MatchFinder { llvm::StringMap &Records; }; +MatchFinderOptions() {} 5chmidti wrote: `MatchFinderOptions() = default;` (why add it in the first place? Having no ctor should be enough) https://github.com/llvm/llvm-pro

[clang] [clang-tools-extra] [clang-tidy] Avoid matching nodes in system headers (PR #151035)

2025-07-28 Thread Julian Schmidt via cfe-commits
https://github.com/5chmidti commented: Awesome to see this continuing. The changes also look quite clean and extendable to, e.g., modules, like you mentioned. The performance improvement is still incredible to see. Especially when considering library layering in user-code from external or inte

[clang] [clang-tools-extra] [clang-tidy] Avoid matching nodes in system headers (PR #151035)

2025-07-28 Thread Julian Schmidt via cfe-commits
https://github.com/5chmidti edited https://github.com/llvm/llvm-project/pull/151035 ___ 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-07-24 Thread Julian Schmidt via cfe-commits
=?utf-8?q?Balázs_Kéri?= , =?utf-8?q?Balázs_Kéri?= , =?utf-8?q?Balázs_Kéri?= , =?utf-8?q?Balázs_Kéri?= , =?utf-8?q?Balázs_Kéri?= , =?utf-8?q?Balázs_Kéri?= , =?utf-8?q?Balázs_Kéri?= , =?utf-8?q?Balázs_Kéri?= Message-ID: In-Reply-To: 5chmidti wrote: > Overall looks fine, the only thing is name. >

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

2025-07-24 Thread Julian Schmidt via cfe-commits
https://github.com/5chmidti 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] Ignore pure-virtual in portability-template... (PR #150290)

2025-07-23 Thread Julian Schmidt via cfe-commits
https://github.com/5chmidti approved this pull request. https://github.com/llvm/llvm-project/pull/150290 ___ 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 parallel execution by default in 'run-clang-tidy' and 'clang-tidy-diff' (PR #149739)

2025-07-23 Thread Julian Schmidt via cfe-commits
https://github.com/5chmidti approved this pull request. https://github.com/llvm/llvm-project/pull/149739 ___ 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 `IgnoreAliasing` option to `readability-qualified-auto check` (PR #147060)

2025-07-23 Thread Julian Schmidt via cfe-commits
5chmidti wrote: Please update your branch with main and resolve the conflicts 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 `IgnoreAliasing` option to `readability-qualified-auto check` (PR #147060)

2025-07-23 Thread Julian Schmidt via cfe-commits
@@ -96,3 +96,45 @@ 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-23 Thread Julian Schmidt via cfe-commits
https://github.com/5chmidti approved this pull request. LGTM 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 `IgnoreAliasing` option to `readability-qualified-auto check` (PR #147060)

2025-07-23 Thread Julian Schmidt via cfe-commits
https://github.com/5chmidti 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] Fix bugprone-tagged-union-member-count false-positive (PR #135831)

2025-07-23 Thread Julian Schmidt via cfe-commits
=?utf-8?b?R8OhYm9yIFTDs3RodsOhcmk=?=,=?utf-8?b?R8OhYm9yIFTDs3RodsOhcmk=?=, =?utf-8?b?R8OhYm9yIFTDs3RodsOhcmk=?=,=?utf-8?b?R8OhYm9yIFTDs3RodsOhcmk=?=, =?utf-8?b?R8OhYm9yIFTDs3RodsOhcmk=?= Message-ID: In-Reply-To: https://github.com/5chmidti approved this pull request. LGTM https://github.com/ll

[clang-tools-extra] [clang-tidy] Fix bugprone-tagged-union-member-count false-positive (PR #135831)

2025-07-23 Thread Julian Schmidt via cfe-commits
=?utf-8?b?R8OhYm9yIFTDs3RodsOhcmk=?=,=?utf-8?b?R8OhYm9yIFTDs3RodsOhcmk=?=, =?utf-8?b?R8OhYm9yIFTDs3RodsOhcmk=?=,=?utf-8?b?R8OhYm9yIFTDs3RodsOhcmk=?=, =?utf-8?b?R8OhYm9yIFTDs3RodsOhcmk=?= Message-ID: In-Reply-To: @@ -9,6 +9,8 @@ different from the number of data members inside th

[clang-tools-extra] [clang-tidy] Fix bugprone-tagged-union-member-count false-positive (PR #135831)

2025-07-23 Thread Julian Schmidt via cfe-commits
=?utf-8?b?R8OhYm9yIFTDs3RodsOhcmk=?=,=?utf-8?b?R8OhYm9yIFTDs3RodsOhcmk=?=, =?utf-8?b?R8OhYm9yIFTDs3RodsOhcmk=?=,=?utf-8?b?R8OhYm9yIFTDs3RodsOhcmk=?=, =?utf-8?b?R8OhYm9yIFTDs3RodsOhcmk=?Message-ID: In-Reply-To: https://github.com/5chmidti edited https://github.com/llvm/llvm-project/pull/135831 _

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

2025-07-19 Thread Julian Schmidt via cfe-commits
5chmidti wrote: > > Then I will split it up into {[11],[14, 17],[20],[23, 26]} > > BTW does this support C23? That would be nice to have too. I totally forgot to add that :) I'll take a look at the rules for it, but might only add it later https://github.com/llvm/llvm-project/pull/146553 ___

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

2025-07-19 Thread Julian Schmidt via cfe-commits
5chmidti wrote: > 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 now. I w

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

2025-07-19 Thread Julian Schmidt via cfe-commits
5chmidti wrote: Fixed multiple vars declared in one statement 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] [clang][docs] Add all clang-tools-extra to 'ClangTools.rst' (PR #148622)

2025-07-16 Thread Julian Schmidt via cfe-commits
@@ -89,14 +89,49 @@ 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-tools-extra] [clang-tidy] Make `bugprone-unhandled-self-assignment` check more general (PR #147066)

2025-07-14 Thread Julian Schmidt via cfe-commits
https://github.com/5chmidti approved this pull request. https://github.com/llvm/llvm-project/pull/147066 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

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

2025-07-14 Thread Julian Schmidt via cfe-commits
@@ -134,14 +136,27 @@ 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 `RespectOpaqueTypes` option to `readability-qualified-auto check` (PR #147060)

2025-07-14 Thread Julian Schmidt via cfe-commits
@@ -96,3 +96,23 @@ 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] Reland "[clang-tidy] Improve integer comparison by matching valid expressions outside implicitCastExpr for use-integer-sign-comparison" (PR #144240)

2025-07-13 Thread Julian Schmidt via cfe-commits
@@ -121,3 +121,100 @@ int AllComparisons() { return 0; } + +namespace PR127471 { +int getSignedValue(); +unsigned int getUnsignedValue(); + +void callExprTest() { + +if (getSignedValue() < getUnsignedValue()) +return; +// CHECK-MESSAGES: :[[

[clang-tools-extra] [clang-tidy] Fix bugprone-tagged-union-member-count false-positive (PR #135831)

2025-07-12 Thread Julian Schmidt via cfe-commits
=?utf-8?b?R8OhYm9yIFTDs3RodsOhcmk=?=,=?utf-8?b?R8OhYm9yIFTDs3RodsOhcmk=?=, =?utf-8?b?R8OhYm9yIFTDs3RodsOhcmk=?=,=?utf-8?b?R8OhYm9yIFTDs3RodsOhcmk=?= Message-ID: In-Reply-To: @@ -140,6 +140,12 @@ Changes in existing checks calls of ``std::string`` constructor with char pointer

[clang-tools-extra] [clang-tidy] Fix bugprone-tagged-union-member-count false-positive (PR #135831)

2025-07-12 Thread Julian Schmidt via cfe-commits
=?utf-8?b?R8OhYm9yIFTDs3RodsOhcmk=?=,=?utf-8?b?R8OhYm9yIFTDs3RodsOhcmk=?=, =?utf-8?b?R8OhYm9yIFTDs3RodsOhcmk=?=,=?utf-8?b?R8OhYm9yIFTDs3RodsOhcmk=?Message-ID: In-Reply-To: @@ -147,3 +148,16 @@ struct Name {\ // CHECK-MESSAGES: :[[@LINE+1]]:44: warning: tagged union has more d

[clang-tools-extra] [clang-tidy] Fix bugprone-tagged-union-member-count false-positive (PR #135831)

2025-07-12 Thread Julian Schmidt via cfe-commits
=?utf-8?b?R8OhYm9yIFTDs3RodsOhcmk=?=,=?utf-8?b?R8OhYm9yIFTDs3RodsOhcmk=?=, =?utf-8?b?R8OhYm9yIFTDs3RodsOhcmk=?=,=?utf-8?b?R8OhYm9yIFTDs3RodsOhcmk=?Message-ID: In-Reply-To: @@ -9,6 +9,9 @@ different from the number of data members inside the union. A struct or a class is conside

[clang-tools-extra] [clang-tidy] fix `bugprone-narrowing-conversions` false positive for conditional expression (PR #139474)

2025-07-12 Thread Julian Schmidt via cfe-commits
5chmidti wrote: Please add more tests: - one of the args being, e.g., `int`, since there should still be a warning - also add those same tests to the C++ tests to cover that they are being handled correctly in both languages https://github.com/llvm/llvm-proje

[clang-tools-extra] [clang-tidy] fix `bugprone-narrowing-conversions` false positive for conditional expression (PR #139474)

2025-07-12 Thread Julian Schmidt via cfe-commits
https://github.com/5chmidti edited https://github.com/llvm/llvm-project/pull/139474 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy] fix `bugprone-narrowing-conversions` false positive for conditional expression (PR #139474)

2025-07-12 Thread Julian Schmidt via cfe-commits
https://github.com/5chmidti edited https://github.com/llvm/llvm-project/pull/139474 ___ 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-12 Thread Julian Schmidt via cfe-commits
@@ -0,0 +1,254 @@ +//===--- 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-12 Thread Julian Schmidt via cfe-commits
@@ -0,0 +1,227 @@ +.. title:: clang-tidy - portability-avoid-platform-specific-fundamental-types + +portability-avoid-platform-specific-fundamental-types += + +Finds fundamental types (e.g. `int`, `float`) and recommends using ty

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

2025-07-12 Thread Julian Schmidt via cfe-commits
@@ -0,0 +1,254 @@ +//===--- 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-12 Thread Julian Schmidt via cfe-commits
@@ -0,0 +1,254 @@ +//===--- 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-12 Thread Julian Schmidt via cfe-commits
@@ -0,0 +1,227 @@ +.. title:: clang-tidy - portability-avoid-platform-specific-fundamental-types + +portability-avoid-platform-specific-fundamental-types += + +Finds fundamental types (e.g. `int`, `float`) and recommends using ty

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

2025-07-12 Thread Julian Schmidt 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 filtering of check options by enabled checks in '--dump-config' (PR #147142)

2025-07-12 Thread Julian Schmidt via cfe-commits
https://github.com/5chmidti approved this pull request. LGTM https://github.com/llvm/llvm-project/pull/147142 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

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

2025-07-12 Thread Julian Schmidt via cfe-commits
https://github.com/5chmidti edited https://github.com/llvm/llvm-project/pull/147142 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

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

2025-07-08 Thread Julian Schmidt via cfe-commits
https://github.com/5chmidti approved this pull request. https://github.com/llvm/llvm-project/pull/147553 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-tools-extra] [clang]: Propagate `*noreturn` attributes in `CFG` (PR #146355)

2025-07-07 Thread Julian Schmidt via cfe-commits
@@ -141,6 +141,42 @@ void nullable_value_after_swap(BloombergLP::bdlb::NullableValue &opt1, Bloo } } +void assertion_handler_imp() __attribute__((analyzer_noreturn)); + +void assertion_handler() { +do { + assertion_handler_imp(); +} while(0); +} + +void functi

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

2025-07-06 Thread Julian Schmidt via cfe-commits
Paul =?utf-8?q?Heidekr=C3=BCger?= , Paul =?utf-8?q?Heidekr=C3=BCger?= , Paul =?utf-8?q?Heidekr=C3=BCger?= , Paul =?utf-8?q?Heidekr=C3=BCger?= , Paul =?utf-8?q?Heidekr=C3=BCger?= , Paul =?utf-8?q?Heidekr=C3=BCger?= , Paul =?utf-8?q?Heidekr=C3=BCger?= , Paul =?utf-8?q?Heidekr=C3=BCger?= , Paul =?utf-

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

2025-07-06 Thread Julian Schmidt 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] Enforce SL.con.3: Add check to replace operator[] with at() [Cont.] (PR #95220)

2025-07-06 Thread Julian Schmidt 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-07-06 Thread Julian Schmidt 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-07-06 Thread Julian Schmidt 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] Add new check: `readability-use-concise-preprocessor-directives` (PR #146830)

2025-07-06 Thread Julian Schmidt via cfe-commits
https://github.com/5chmidti approved this pull request. LGTM minus the open conversation 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-commit

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

2025-07-06 Thread Julian Schmidt via cfe-commits
5chmidti wrote: The option name could also be something like `IgnoreAliasing` or something similar. You're also missing changes to the check docs itself. https://github.com/llvm/llvm-project/pull/147060 ___ cfe-commits mailing list cfe-commits@lists.l

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

2025-07-04 Thread Julian Schmidt via cfe-commits
5chmidti wrote: > > Have you looked at google-runtime-int? It should be doing the same thing > > (maybe small differences) > > I haven't before now. I still think a new check is necessary. > > `google-runtime-int` isn't as strict because it is coupled to the Google > coding guidelines. That

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

2025-07-04 Thread Julian Schmidt 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] Add new check: `modernize-use-concise-preprocessor-directives` (PR #146830)

2025-07-04 Thread Julian Schmidt via cfe-commits
@@ -0,0 +1,107 @@ +//===--- 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] [ASTMatchers][NFC] improve 'isInteger' docs to show matching of unsigned (PR #147012)

2025-07-04 Thread Julian Schmidt via cfe-commits
https://github.com/5chmidti approved this pull request. 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][NFC] fix compilation by disambiguating equality operator (PR #147048)

2025-07-04 Thread Julian Schmidt via cfe-commits
https://github.com/5chmidti approved this pull request. 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 Julian Schmidt via cfe-commits
5chmidti 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#u

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

2025-07-04 Thread Julian Schmidt via cfe-commits
https://github.com/5chmidti commented: Have you looked at google-runtime-int? It should be doing the same thing (maybe small differences) https://github.com/llvm/llvm-project/pull/146970 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://

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

2025-07-02 Thread Julian Schmidt via cfe-commits
5chmidti wrote: > Another interesting case, it seems somehow multiple constexprs got added, ex: > > ```c++ > template > constexpr constexpr constexpr constexpr constexpr constexpr constexpr > constexpr int numberOfSidesOfDimension(int dimension); > ``` > > This actually compiles, though with

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

2025-07-02 Thread Julian Schmidt via cfe-commits
5chmidti wrote: > Another compiler error after transformation: > > It made this constexpr: > > ```c++ > PUGI_IMPL_FN constexpr bool is_nan(double value) > { > #if defined(PUGI_IMPL_MSVC_CRT_VERSION) || defined(__BORLANDC__) > return !!_isnan(value); > #elif

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

2025-07-01 Thread Julian Schmidt via cfe-commits
@@ -0,0 +1,562 @@ +// RUN: %check_clang_tidy -std=c++11 -check-suffix=11 %s misc-use-constexpr %t -- -- -fno-delayed-template-parsing +// RUN: %check_clang_tidy -std=c++14 -check-suffix=11,14 %s misc-use-constexpr %t -- -- -fno-delayed-template-parsing +// RUN: %check_clang_tidy

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

2025-07-01 Thread Julian Schmidt via cfe-commits
5chmidti wrote: Sorry for the silly docs mistakes, btw. I've updated the docs, added replacement string options, and fixed the `const` keyword removal. https://github.com/llvm/llvm-project/pull/146553 ___ cfe-commits mailing list cfe-commits@lists.l

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

2025-07-01 Thread Julian Schmidt via cfe-commits
5chmidti wrote: Thanks for testing this on your codebase so fast as well. > I got some fixits that do not compile, e.g.: > > ``` > std::erase_if(numbers, [](int n) { > return n % 2 == 0; > }); > ``` > > is changed into > > ``` > std::erase_if(numbers, [](int nconstexpr ) { > return n % 2 == 0

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

2025-07-01 Thread Julian Schmidt via cfe-commits
5chmidti wrote: > I tried with [ITK](https://github.com/InsightSoftwareConsortium/ITK/) and the > resulting transformation did not compile. > > Many changes were of this form: > > ```diff > -const double Max = 1.0 - Min; > +constexpr double Max = 1.0 - Min; > ``` > > Which is

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

2025-07-01 Thread Julian Schmidt via cfe-commits
https://github.com/5chmidti 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 misc-constexpr check (PR #146553)

2025-07-01 Thread Julian Schmidt via cfe-commits
@@ -0,0 +1,562 @@ +// RUN: %check_clang_tidy -std=c++11 -check-suffix=11 %s misc-use-constexpr %t -- -- -fno-delayed-template-parsing +// RUN: %check_clang_tidy -std=c++14 -check-suffix=11,14 %s misc-use-constexpr %t -- -- -fno-delayed-template-parsing +// RUN: %check_clang_tidy

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

2025-07-01 Thread Julian Schmidt via cfe-commits
@@ -0,0 +1,562 @@ +// RUN: %check_clang_tidy -std=c++11 -check-suffix=11 %s misc-use-constexpr %t -- -- -fno-delayed-template-parsing +// RUN: %check_clang_tidy -std=c++14 -check-suffix=11,14 %s misc-use-constexpr %t -- -- -fno-delayed-template-parsing +// RUN: %check_clang_tidy

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

2025-07-01 Thread Julian Schmidt via cfe-commits
5chmidti wrote: > > misc-use-constexpr? :) > > modernize-use-constexpr? Hm. It is indeed also a modernization... +- on which to pick. Let's see what others think. On one hand, the modernize checks have - modernize-use-auto - modernize-use-nodiscard - modernize-use-noexcept - modernize-use-over

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

2025-07-01 Thread Julian Schmidt via cfe-commits
https://github.com/5chmidti updated https://github.com/llvm/llvm-project/pull/146553 >From 16d5a3fb942673d1fda0ef4b17363a0b5d634fbb Mon Sep 17 00:00:00 2001 From: Julian Schmidt Date: Fri, 6 Sep 2024 22:58:46 +0200 Subject: [PATCH] [clang-tidy] add misc-constexpr check This check finds all fun

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

2025-07-01 Thread Julian Schmidt via cfe-commits
https://github.com/5chmidti updated https://github.com/llvm/llvm-project/pull/146553 >From 8d354249e8c28fb2a83f90479cc74e41be2d58be Mon Sep 17 00:00:00 2001 From: Julian Schmidt Date: Fri, 6 Sep 2024 22:58:46 +0200 Subject: [PATCH] [clang-tidy] add misc-constexpr check This check finds all fun

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

2025-07-01 Thread Julian Schmidt via cfe-commits
https://github.com/5chmidti updated https://github.com/llvm/llvm-project/pull/146553 >From 2a50c3ef9aed91488a5650b8f3719fc338db7a49 Mon Sep 17 00:00:00 2001 From: Julian Schmidt Date: Fri, 6 Sep 2024 22:58:46 +0200 Subject: [PATCH] [clang-tidy] add misc-constexpr check This check finds all fun

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

2025-07-01 Thread Julian Schmidt via cfe-commits
5chmidti wrote: I ran this check on all of `clang/` and `clang-tools-extra/` and got no compilation errors from too aggressively changing things to `constexpr`. Some perf info from running the checks enabled in LLVM + this check: Running on: `clang/lib/Sema/SemaExprCXX.cpp` (1 diag): ```text =

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

2025-07-01 Thread Julian Schmidt via cfe-commits
https://github.com/5chmidti created https://github.com/llvm/llvm-project/pull/146553 This check finds all functions and variables that can be declared as `constexpr`, using the specified standard version to check if the requirements are met. Fixes #115622 >From 35a081fba2d15ee9f4ae825928e5411

[clang-tools-extra] [clang-tidy] add 'IgnoreMarcos' option to 'special-member-functions' check (PR #143550)

2025-06-23 Thread Julian Schmidt via cfe-commits
5chmidti wrote: > > Actually, the cxxRecordDecl might not be in a macro, but the special member > > functions are. > > The checker doc states: > `The check finds classes where some but not all of the special member > functions are defined.` > I think we only need to ignore if the whole class e

[clang-tools-extra] [clang-tidy] add 'IgnoreMarcos' option to 'avoid-goto' check (PR #143554)

2025-06-21 Thread Julian Schmidt via cfe-commits
https://github.com/5chmidti edited https://github.com/llvm/llvm-project/pull/143554 ___ 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 'IgnoreMarcos' option to 'avoid-goto' check (PR #143554)

2025-06-21 Thread Julian Schmidt via cfe-commits
https://github.com/5chmidti approved this pull request. LGTM minus comments https://github.com/llvm/llvm-project/pull/143554 ___ 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 'IgnoreMarcos' option to 'special-member-functions' check (PR #143550)

2025-06-21 Thread Julian Schmidt via cfe-commits
@@ -45,11 +53,12 @@ SpecialMemberFunctionsCheck::getCheckTraversalKind() const { } void SpecialMemberFunctionsCheck::registerMatchers(MatchFinder *Finder) { - auto IsNotImplicitOrDeleted = anyOf(unless(isImplicit()), isDeleted()); + const auto IsNotImplicitOrDeleted = anyOf(

[clang-tools-extra] [clang-tidy] add 'IgnoreMarcos' option to 'special-member-functions' check (PR #143550)

2025-06-21 Thread Julian Schmidt via cfe-commits
https://github.com/5chmidti deleted https://github.com/llvm/llvm-project/pull/143550 ___ 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 'IgnoreMarcos' option to 'avoid-goto' check (PR #143554)

2025-06-21 Thread Julian Schmidt via cfe-commits
@@ -50,3 +50,12 @@ Modern C++ needs ``goto`` only to jump out of nested loops. some_operation(); All other uses of ``goto`` are diagnosed in `C++`. + + +Options +--- + +.. option:: IgnoreMacros + + If set to `true`, the check will not warn if ``goto`` statement is plac

[clang-tools-extra] [clang-tidy] add 'IgnoreMarcos' option to 'special-member-functions' check (PR #143550)

2025-06-21 Thread Julian Schmidt via cfe-commits
5chmidti wrote: Actually, the cxxRecordDecl might not be in a macro, but the special member functions are. E.g.: ``` ` ` cpp #define DEF_COPY(name) \ name(const name&) = default; \ name& operator=(const name&) = default; ` ` ` https://github.com/llvm/llvm-project/pull/143550 __

[clang-tools-extra] [clang-tidy] add 'IgnoreMarcos' option to 'avoid-goto' check (PR #143554)

2025-06-21 Thread Julian Schmidt via cfe-commits
@@ -1,27 +1,34 @@ // RUN: %check_clang_tidy %s cppcoreguidelines-avoid-goto %t +// RUN: %check_clang_tidy -check-suffix=MACRO %s cppcoreguidelines-avoid-goto %t -- -config="{CheckOptions: { cppcoreguidelines-avoid-goto.IgnoreMacros: true }}" 5chmidti wrote: Yo

[clang-tools-extra] [clang-tidy] add 'IgnoreMarcos' option to 'special-member-functions' check (PR #143550)

2025-06-21 Thread Julian Schmidt via cfe-commits
https://github.com/5chmidti edited https://github.com/llvm/llvm-project/pull/143550 ___ 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 'IgnoreMarcos' option to 'special-member-functions' check (PR #143550)

2025-06-21 Thread Julian Schmidt via cfe-commits
https://github.com/5chmidti approved this pull request. LGTM but I'm +- on the default Let's see if others have a stronger opinion on the default --- Not directly part of this, but: I'd prefer to see a warning for expansions of macros defined inside the code base, but not from macros defined

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

2025-06-20 Thread Julian Schmidt via cfe-commits
https://github.com/5chmidti approved this pull request. Alright, that makes sense to me. LGTM minus open comments https://github.com/llvm/llvm-project/pull/142839 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/ma

[clang-tools-extra] [clang-tidy] Add `performance-explicit-move-constructor` check (PR #122599)

2025-06-20 Thread Julian Schmidt via cfe-commits
@@ -0,0 +1,32 @@ +.. title:: clang-tidy - performance-explicit-move-constructor + +performance-explicit-move-constructor += + +Warns when a class defines an explicit move constructor, which may cause +the copy constructor to get called instead.

[clang-tools-extra] [clang-tidy] Add `performance-explicit-move-constructor` check (PR #122599)

2025-06-20 Thread Julian Schmidt via cfe-commits
5chmidti wrote: > > but this check could check the signatures themselves to be in the expected > > form > > So warning for signatures like `foo(foo&) = default`? Looking at this again, maybe this shouldn't not that route. Other checks already capture some of those problems. What @PiotrZSL me

[clang-tools-extra] [clang-tidy] Add `performance-explicit-move-constructor` check (PR #122599)

2025-06-20 Thread Julian Schmidt via cfe-commits
@@ -0,0 +1,76 @@ +//===--- ExplicitMoveConstructorCheck.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 `performance-explicit-move-constructor` check (PR #122599)

2025-06-20 Thread Julian Schmidt via cfe-commits
@@ -0,0 +1,76 @@ +//===--- ExplicitMoveConstructorCheck.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 `performance-explicit-move-constructor` check (PR #122599)

2025-06-20 Thread Julian Schmidt via cfe-commits
@@ -0,0 +1,76 @@ +//===--- ExplicitMoveConstructorCheck.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 `llvm-prefer-static-over-anonymous-namespace` (PR #142839)

2025-06-20 Thread Julian Schmidt via cfe-commits
https://github.com/5chmidti commented: Generalizing this check to enforce either static or anonymous namespaces would be great, then it would not be specific to LLVM and projects using a similar style. So something like misc-static-or-anonymous-namespace. WDYT? https://github.com/llvm/llvm-pro

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

2025-06-20 Thread Julian Schmidt via cfe-commits
5chmidti wrote: It would be better to combine these files with a check suffix and two RUN lines so that you can check tru-negatives for the options as well. Depending on the options the matches should be a strict superset for cars or member functions, e.g. a

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

2025-06-20 Thread Julian Schmidt via cfe-commits
@@ -0,0 +1,73 @@ +.. title:: clang-tidy - llvm-prefer-static-over-anonymous-namespace + +llvm-prefer-static-over-anonymous-namespace +=== + +Finds function and variable declarations inside anonymous namespace and +suggests replacing them wit

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

2025-06-20 Thread Julian Schmidt via cfe-commits
https://github.com/5chmidti edited https://github.com/llvm/llvm-project/pull/142839 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy] Switch misc-confusable-identifiers check to a faster algorithm. (PR #130369)

2025-06-19 Thread Julian Schmidt via cfe-commits
https://github.com/5chmidti edited https://github.com/llvm/llvm-project/pull/130369 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy] Switch misc-confusable-identifiers check to a faster algorithm. (PR #130369)

2025-06-19 Thread Julian Schmidt via cfe-commits
@@ -181,42 +160,105 @@ void ConfusableIdentifierCheck::check( if (!ND) return; - IdentifierInfo *NDII = ND->getIdentifier(); + addDeclToCheck(ND, cast(ND->getDeclContext() +->getNonTransparentContext())); + + // Associate template p

[clang-tools-extra] [clang-tidy] Switch misc-confusable-identifiers check to a faster algorithm. (PR #130369)

2025-06-19 Thread Julian Schmidt via cfe-commits
@@ -181,42 +160,105 @@ void ConfusableIdentifierCheck::check( if (!ND) return; - IdentifierInfo *NDII = ND->getIdentifier(); + addDeclToCheck(ND, cast(ND->getDeclContext() +->getNonTransparentContext())); + + // Associate template p

[clang-tools-extra] [clang-tidy] Switch misc-confusable-identifiers check to a faster algorithm. (PR #130369)

2025-06-19 Thread Julian Schmidt via cfe-commits
https://github.com/5chmidti approved this pull request. LGTM. Thanks for the quite big performance improvement, and sorry this took a bit until it was reviewed. https://github.com/llvm/llvm-project/pull/130369 ___ cfe-commits mailing list cfe-commits@

[clang] [mutation analyzer] support mutation analysis for pointee (PR #118593)

2025-01-21 Thread Julian Schmidt via cfe-commits
@@ -654,6 +716,83 @@ ExprMutationAnalyzer::Analyzer::findFunctionArgMutation(const Expr *Exp) { return nullptr; } +const Stmt * +ExprMutationAnalyzer::Analyzer::findPointeeValueMutation(const Expr *Exp) { + const auto Matches = match( + stmt(forEachDescendant( +

[clang] [mutation analyzer] support mutation analysis for pointee (PR #118593)

2025-01-21 Thread Julian Schmidt via cfe-commits
https://github.com/5chmidti approved this pull request. https://github.com/llvm/llvm-project/pull/118593 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [mutation analyzer] support mutation analysis for pointee (PR #118593)

2025-01-21 Thread Julian Schmidt via cfe-commits
https://github.com/5chmidti commented: Looks good in general, could you add a small description to the pr? https://github.com/llvm/llvm-project/pull/118593 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/l

  1   2   3   4   5   6   7   8   9   10   >