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

2025-07-12 Thread Carlos Galvez via cfe-commits
https://github.com/carlosgalvezp approved this pull request. https://github.com/llvm/llvm-project/pull/148384 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

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

2025-07-12 Thread Carlos Galvez via cfe-commits
https://github.com/carlosgalvezp approved this pull request. https://github.com/llvm/llvm-project/pull/148357 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

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

2025-07-12 Thread Carlos Galvez via cfe-commits
https://github.com/carlosgalvezp approved this pull request. https://github.com/llvm/llvm-project/pull/148352 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

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

2025-07-11 Thread Carlos Galvez via cfe-commits
https://github.com/carlosgalvezp approved this pull request. https://github.com/llvm/llvm-project/pull/147793 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

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

2025-07-11 Thread Carlos Galvez via cfe-commits
carlosgalvezp wrote: > I will add it in a separate PR. Don't feel right to make kind-of unrelated > changes after most of the people gave their consent. Ok! https://github.com/llvm/llvm-project/pull/147793 ___ cfe-commits mailing list cfe-commits@li

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

2025-07-10 Thread Carlos Galvez via cfe-commits
carlosgalvezp wrote: Thank you for driving this, LGTM! One last thing I'm missing: can you update the clang-tidy contributors guide, to explain that we expect people to run clang-tidy as well (and what command to run)? Since it's not currently enforced in CI. https://github.com/llvm/llvm-pro

[clang-tools-extra] Add clang tidy check performance constexpr non static in scope (PR #147809)

2025-07-10 Thread Carlos Galvez via cfe-commits
carlosgalvezp wrote: > bellow specific size Like I mentioned in the other patch I think this is brittle and leads to poor UX, because you add 1 field to a struct in a header file and suddenly you have to change all clients. I'd be preferred to have the user specify which types to warn on. Ma

[clang-tools-extra] Add clang tidy check performance constexpr non static in scope (PR #147809)

2025-07-10 Thread Carlos Galvez via cfe-commits
carlosgalvezp wrote: @PiotrZSL Here's some examples discussing the performance implications https://youtu.be/IDQ0ng8RIqs?si=fDUuTFK9GiGCB-Po https://github.com/llvm/llvm-project/pull/147809 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https

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

2025-07-10 Thread Carlos Galvez via cfe-commits
https://github.com/carlosgalvezp approved this pull request. https://github.com/llvm/llvm-project/pull/142839 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

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

2025-07-10 Thread Carlos Galvez via cfe-commits
carlosgalvezp wrote: I agree with the sentiment that it would be good to have one single check enforcing either one style or the other, possibly a "readability" type of check. Then llvm could be an alias with the proper config. I suppose this patch does not impede further refactoring if we wa

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

2025-07-10 Thread Carlos Galvez via cfe-commits
https://github.com/carlosgalvezp approved this pull request. LGTM! https://github.com/llvm/llvm-project/pull/146830 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

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

2025-07-10 Thread Carlos Galvez via cfe-commits
https://github.com/carlosgalvezp approved this pull request. LGTM! https://github.com/llvm/llvm-project/pull/147793 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

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

2025-07-04 Thread Carlos Galvez via cfe-commits
carlosgalvezp wrote: +1 to moving to `readability`. What's the behavior when you have: ```cpp #if defined(foo) && defined(bar) ``` ? I don't believe I saw a test for this use case. As a user I would probably prefer to keep it as is instead of having one `ifdef` and one `if defined`. Perhaps

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

2025-07-04 Thread Carlos Galvez via cfe-commits
carlosgalvezp wrote: Check makes sense to me! As a first iteration it's fine without autofix but I can imagine it will be hard for a codebase to enable this check given the large amount of things to fix. Maybe users can specify a mapping of wanted types via an option? https://github.com/llvm/

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

2025-07-01 Thread Carlos Galvez via cfe-commits
carlosgalvezp wrote: I'm ok with modernize-use-constexpr as well! 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 Carlos Galvez via cfe-commits
carlosgalvezp wrote: misc-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] Fix false positive for cppcoreguidelines-pro-bounds-pointer-arithmetic (PR #127394)

2025-06-30 Thread Carlos Galvez via cfe-commits
https://github.com/carlosgalvezp 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] [clang-tidy] Fix false positive for cppcoreguidelines-pro-bounds-pointer-arithmetic (PR #127394)

2025-06-30 Thread Carlos Galvez via cfe-commits
@@ -87,3 +87,25 @@ void okay() { for(int ii : a) ; // OK, pointer arithmetic generated by compiler } + +namespace issue126424 { carlosgalvezp wrote: Nit: typically we can it "gh126424". https://github.com/llvm/llvm-project/pull/127394 ___

[clang] [clang-tools-extra] [clang-tidy] [Modules] Skip checking decls in clang-tidy (PR #145630)

2025-06-25 Thread Carlos Galvez via cfe-commits
carlosgalvezp wrote: I think this patch can be orthogonal to the system headers one, the original one from @njames93 contained similar logic I believe (but I chose to not include it for simplicity). It's probably good to apply this change now before modules become mainstream and we have debt

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

2025-06-23 Thread Carlos Galvez via cfe-commits
https://github.com/carlosgalvezp approved this pull request. LGTM, don't have strong opinions on the default. https://github.com/llvm/llvm-project/pull/143550 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailma

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

2025-06-22 Thread Carlos Galvez via cfe-commits
@@ -18,6 +18,12 @@ using namespace clang::ast_matchers; namespace clang::tidy::cppcoreguidelines { +namespace { +AST_MATCHER(CXXRecordDecl, isInMacro) { carlosgalvezp wrote: (For another commit) This comes up often, maybe we can create an AST matcher for th

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

2025-06-18 Thread Carlos Galvez via cfe-commits
https://github.com/carlosgalvezp approved this pull request. LGTM! 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] Add check 'cppcoreguidelines-use-enum-class' (PR #138282)

2025-06-18 Thread Carlos Galvez via cfe-commits
https://github.com/carlosgalvezp closed https://github.com/llvm/llvm-project/pull/138282 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy][performance-unnecessary-value-param] Avoid in coroutines (PR #140912)

2025-06-15 Thread Carlos Galvez via cfe-commits
@@ -265,6 +265,8 @@ Changes in existing checks ` check performance by tolerating fix-it breaking compilation when functions is used as pointers to avoid matching usage of functions within the current compilation unit. + Added an option `IsAllowedInCoroutines` with the de

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

2025-06-15 Thread Carlos Galvez 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 both label and ``goto`` +

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

2025-06-15 Thread Carlos Galvez via cfe-commits
https://github.com/carlosgalvezp approved this pull request. LGTM, thank you! Perhaps wait a couple days in case there's anything left from other reviewers. https://github.com/llvm/llvm-project/pull/138282 ___ cfe-commits mailing list cfe-commits@list

[clang-tools-extra] [clang-tidy][NFC] run clang-format over clang-tidy checks and tool code. (PR #143324)

2025-06-09 Thread Carlos Galvez via cfe-commits
https://github.com/carlosgalvezp approved this pull request. LGTM! https://github.com/llvm/llvm-project/pull/143324 ___ 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] run clang-format over clang-tidy checks and tool code. (PR #143324)

2025-06-09 Thread Carlos Galvez via cfe-commits
carlosgalvezp wrote: > Maybe same should be doe for Clang-Tidy? It should already be in place, but like stated above, sometimes the CI checks don't run automatically, it requires a maintainer to click a button to trigger them. I don't know why this is, maybe based on CI load, but good to keep

[clang-tools-extra] [clang-tidy][NFC] run clang-format over 'cert', 'cppcore', 'fuchsia',… (PR #143316)

2025-06-08 Thread Carlos Galvez via cfe-commits
https://github.com/carlosgalvezp approved this pull request. LGTM https://github.com/llvm/llvm-project/pull/143316 ___ 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] run clang-format over 'android', 'boost' and 'bugprone' checks (PR #143315)

2025-06-08 Thread Carlos Galvez via cfe-commits
https://github.com/carlosgalvezp approved this pull request. LGTM https://github.com/llvm/llvm-project/pull/143315 ___ 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] run clang-format over `abseil` and `altera` checks. (PR #143314)

2025-06-08 Thread Carlos Galvez via cfe-commits
https://github.com/carlosgalvezp approved this pull request. LGTM. Personally I think it would have been fine to do it all in one patch, less commits to add to the git-blame-ignore later. But it's ok! https://github.com/llvm/llvm-project/pull/143314 _

[clang-tools-extra] added option `google-readability-namespace-comments.AllowNoNamespaceComments` (PR #124265)

2025-06-08 Thread Carlos Galvez via cfe-commits
carlosgalvezp wrote: Thanks for fixing quickly! https://github.com/llvm/llvm-project/pull/124265 ___ 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 formatting of `namespace-comment-check` (PR #143305)

2025-06-08 Thread Carlos Galvez via cfe-commits
https://github.com/carlosgalvezp closed https://github.com/llvm/llvm-project/pull/143305 ___ 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 formatting of `namespace-comment-check` (PR #143305)

2025-06-08 Thread Carlos Galvez via cfe-commits
https://github.com/carlosgalvezp approved this pull request. https://github.com/llvm/llvm-project/pull/143305 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] added option `google-readability-namespace-comments.AllowNoNamespaceComments` (PR #124265)

2025-06-08 Thread Carlos Galvez via cfe-commits
carlosgalvezp wrote: What I saw is that some checks don't run automatically, but must be manually triggered (I guess by a maintainer). I did click on the button to run them and immediately after you merged the patch, good syncing :) I understand this might be done to save CI resources, but cla

[clang-tools-extra] added option `google-readability-namespace-comments.AllowNoNamespaceComments` (PR #124265)

2025-06-08 Thread Carlos Galvez via cfe-commits
carlosgalvezp wrote: @vbvictor it seems this was merged before the CI checks finished running, next time please wait for that ;) Could you or @thorsten-klein fix the broken autoformatter? https://github.com/llvm/llvm-project/pull/124265 ___ cfe-commi

[clang-tools-extra] [clang-tidy] Fix false positives with deducing this in `readability-convert-member-functions-to-static` check (PR #141391)

2025-06-07 Thread Carlos Galvez via cfe-commits
https://github.com/carlosgalvezp approved this pull request. LGTM! https://github.com/llvm/llvm-project/pull/141391 ___ 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 option to disable bugprone-multi-level-pointer-conversion in C code (PR #141209)

2025-06-07 Thread Carlos Galvez via cfe-commits
https://github.com/carlosgalvezp closed https://github.com/llvm/llvm-project/pull/141209 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tools-extra] Use llvm::any_of (NFC) (PR #143281)

2025-06-07 Thread Carlos Galvez via cfe-commits
https://github.com/carlosgalvezp approved this pull request. https://github.com/llvm/llvm-project/pull/143281 ___ 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 option to disable bugprone-multi-level-pointer-conversion in C code (PR #141209)

2025-06-07 Thread Carlos Galvez via cfe-commits
carlosgalvezp wrote: Went for adding an option instead! https://github.com/llvm/llvm-project/pull/141209 ___ 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 option to disable bugprone-multi-level-pointer-conversion in C code (PR #141209)

2025-06-07 Thread Carlos Galvez via cfe-commits
https://github.com/carlosgalvezp updated https://github.com/llvm/llvm-project/pull/141209 >From 3e9f3b2d01343be72c1da3a4dafe9fc2f23c2e63 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20G=C3=A1lvez?= Date: Fri, 23 May 2025 07:45:04 + Subject: [PATCH] [clang-tidy] Add option to disable bug

[clang-tools-extra] [clang-tidy] Add option to disable bugprone-multi-level-pointer-conversion in C code (PR #141209)

2025-06-07 Thread Carlos Galvez via cfe-commits
https://github.com/carlosgalvezp edited https://github.com/llvm/llvm-project/pull/141209 ___ 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 option to disable bugprone-multi-level-pointer-conversion in C code (PR #141209)

2025-06-07 Thread Carlos Galvez via cfe-commits
https://github.com/carlosgalvezp edited https://github.com/llvm/llvm-project/pull/141209 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy] Disable bugprone-multi-level-pointer-conversion in C code (PR #141209)

2025-06-07 Thread Carlos Galvez via cfe-commits
https://github.com/carlosgalvezp updated https://github.com/llvm/llvm-project/pull/141209 >From 4de236aac2c75c1c092ac6b46591839678114365 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20G=C3=A1lvez?= Date: Fri, 23 May 2025 07:45:04 + Subject: [PATCH] [clang-tidy] Add option to disable bug

[clang-tools-extra] [clang-tidy] Add performance-bool-bitwise-operation check (PR #142324)

2025-06-06 Thread Carlos Galvez via cfe-commits
carlosgalvezp wrote: > The check can recognize side effects. Ok, that's great! Did you have a chance to run the test on a large codebase (e.g. the llvm-project) and see if we get any FPs in this regard? > if the check does more than one thing (readability, performance) we should > place it u

[clang-tools-extra] [clang-tidy] [NFC] Potential dereference of nullptr. (PR #143145)

2025-06-06 Thread Carlos Galvez via cfe-commits
https://github.com/carlosgalvezp approved this pull request. I think this is the correct thing to do. It's a programming error if these pointers are null, and so assertions are the correct tool for this. Other checks do `if (const auto* Found = ...)`, but that's not correct, since it silences

[clang-tools-extra] [clang-tidy] Add performance-bool-bitwise-operation check (PR #142324)

2025-06-06 Thread Carlos Galvez via cfe-commits
carlosgalvezp wrote: > takes less time than evaluating both operands. Actually, another reason for *not* putting this in `performance` is that the changes made by this check may lead to non-functional changes in the code. If the RHS operand is a function that has side effects, this check will

[clang-tools-extra] added option `google-readability-namespace-comments.AllowNoNamespaceComments` (PR #124265)

2025-06-05 Thread Carlos Galvez via cfe-commits
https://github.com/carlosgalvezp approved this pull request. LGTM! https://github.com/llvm/llvm-project/pull/124265 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] added option `google-readability-namespace-comments.AllowNoNamespaceComments` (PR #124265)

2025-06-05 Thread Carlos Galvez via cfe-commits
@@ -0,0 +1,19 @@ +// RUN: %check_clang_tidy %s google-readability-namespace-comments %t -std=c++20 \ +// RUN: '-config={CheckOptions: { \ +// RUN: google-readability-namespace-comments.AllowOmittingNamespaceComments: true, \ +// RUN: google-readability-namespace-commen

[clang-tools-extra] added option `google-readability-namespace-comments.AllowNoNamespaceComments` (PR #124265)

2025-06-05 Thread Carlos Galvez via cfe-commits
carlosgalvezp wrote: Please call it "nested-namespaces" instead of "c++17". https://github.com/llvm/llvm-project/pull/124265 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailm

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

2025-06-04 Thread Carlos Galvez via cfe-commits
carlosgalvezp wrote: Also, please rebase (there are some merge conflicts), and also mark conversations as resolved (I see there's a few remaining) https://github.com/llvm/llvm-project/pull/138282 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

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

2025-06-04 Thread Carlos Galvez via cfe-commits
https://github.com/carlosgalvezp commented: LGTM, with some small comments :) https://github.com/llvm/llvm-project/pull/138282 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

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

2025-06-04 Thread Carlos Galvez via cfe-commits
@@ -0,0 +1,50 @@ +// RUN: %check_clang_tidy -std=c++11-or-later %s cppcoreguidelines-use-enum-class %t + +enum E {}; +// CHECK-MESSAGES: :[[@LINE-1]]:6: warning: enum 'E' is unscoped, use 'enum class' instead + +enum class EC {}; + +struct S { + enum E {}; + // CHECK-MESSAGES:

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

2025-06-04 Thread Carlos Galvez via cfe-commits
@@ -0,0 +1,18 @@ +// RUN: %check_clang_tidy -std=c++11-or-later %s cppcoreguidelines-use-enum-class %t -- \ carlosgalvezp wrote: I believe it should be possible to merge these two test files, and provide a specific CHECK-MESSAGES-FULL (or similar) that only war

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

2025-06-04 Thread Carlos Galvez via cfe-commits
@@ -0,0 +1,18 @@ +// RUN: %check_clang_tidy -std=c++11-or-later %s cppcoreguidelines-use-enum-class %t -- \ +// RUN: -config="{CheckOptions: {cppcoreguidelines-use-enum-class.IgnoreUnscopedEnumsInClasses: true}}" -- + +enum E {}; +// CHECK-MESSAGES: :[[@LINE-1]]:6: warning: en

[clang-tools-extra] [clang-tidy] NFCI: remove non-functional matcher from SizeofExpressionCheck (PR #142654)

2025-06-03 Thread Carlos Galvez via cfe-commits
https://github.com/carlosgalvezp approved this pull request. LGTM, if all tests pass then this must be dead code! Thanks for cleaning up. https://github.com/llvm/llvm-project/pull/142654 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://l

[clang-tools-extra] [clang-tidy] Add performance-bool-bitwise-operation check (PR #142324)

2025-06-02 Thread Carlos Galvez via cfe-commits
carlosgalvezp wrote: Personally I don't think this is a `performance` check. Boolean operators are for bools; bitwise operators are for ints. I would put this in `readability` or `misc` instead. https://github.com/llvm/llvm-project/pull/142324 ___ cf

[clang-tools-extra] [clang-tidy] Return error code on config parse error (PR #136167)

2025-05-26 Thread Carlos Galvez via cfe-commits
@@ -46,20 +46,20 @@ TEST(ClangTidyOptionsProvider, InMemoryFileSystems) { FileOptionsProvider FileOpt({}, {}, {}, FileSystem); - ClangTidyOptions File1Options = + llvm::ErrorOr File1Options = FileOpt.getOptions("ProjectRoot/SubDir1/File.cpp"); - ClangTidyOptions F

[clang-tools-extra] [clang-tidy] Return error code on config parse error (PR #136167)

2025-05-26 Thread Carlos Galvez via cfe-commits
https://github.com/carlosgalvezp edited https://github.com/llvm/llvm-project/pull/136167 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy] Return error code on config parse error (PR #136167)

2025-05-26 Thread Carlos Galvez via cfe-commits
@@ -46,20 +46,65 @@ TEST(ClangTidyOptionsProvider, InMemoryFileSystems) { FileOptionsProvider FileOpt({}, {}, {}, FileSystem); - ClangTidyOptions File1Options = + llvm::ErrorOr File1Options = FileOpt.getOptions("ProjectRoot/SubDir1/File.cpp"); - ClangTidyOptions F

[clang-tools-extra] [clang-tidy] Return error code on config parse error (PR #136167)

2025-05-26 Thread Carlos Galvez via cfe-commits
@@ -265,8 +265,16 @@ const ClangTidyOptions &ClangTidyContext::getOptions() const { ClangTidyOptions ClangTidyContext::getOptionsForFile(StringRef File) const { // Merge options on top of getDefaults() as a safeguard against options with // unset values. - return ClangTid

[clang-tools-extra] [clang-tidy] Return error code on config parse error (PR #136167)

2025-05-26 Thread Carlos Galvez via cfe-commits
@@ -46,20 +46,65 @@ TEST(ClangTidyOptionsProvider, InMemoryFileSystems) { FileOptionsProvider FileOpt({}, {}, {}, FileSystem); - ClangTidyOptions File1Options = + llvm::ErrorOr File1Options = FileOpt.getOptions("ProjectRoot/SubDir1/File.cpp"); - ClangTidyOptions F

[clang-tools-extra] [clang-tidy] Disable bugprone-multi-level-pointer-conversion in C code (PR #141209)

2025-05-23 Thread Carlos Galvez via cfe-commits
carlosgalvezp wrote: You can check the discussion in the linked issue. The argument is that these casts are idiomatic in C, and does not make sense to pollute the code with casts. There's no other safer alternative either. > then probably they should just disable a check There doesn't appear

[clang-tools-extra] [clang-tidy] Disable bugprone-multi-level-pointer-conversion in C code (PR #141209)

2025-05-23 Thread Carlos Galvez via cfe-commits
https://github.com/carlosgalvezp created https://github.com/llvm/llvm-project/pull/141209 It is deemed more of an annoyance than a help, since the patterns the check warns about are quite common and idiomatic in C, and there are no good alternatives. Thus, enable the check only for C++, where

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

2025-05-21 Thread Carlos Galvez via cfe-commits
https://github.com/carlosgalvezp approved this pull request. LGTM! https://github.com/llvm/llvm-project/pull/140759 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

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

2025-05-21 Thread Carlos Galvez via cfe-commits
@@ -113,7 +113,7 @@ struct UnqualNameVisitor : public RecursiveASTVisitor { }; } // namespace -constexpr llvm::StringLiteral Message = +constexpr llvm::StringLiteral MessageFunction = carlosgalvezp wrote: Ok! I think this change would have been better to do

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

2025-05-21 Thread Carlos Galvez via cfe-commits
https://github.com/carlosgalvezp closed https://github.com/llvm/llvm-project/pull/140753 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

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

2025-05-20 Thread Carlos Galvez via cfe-commits
https://github.com/carlosgalvezp approved this pull request. LGTM! https://github.com/llvm/llvm-project/pull/140753 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy] Return error code on config parse error (PR #136167)

2025-05-20 Thread Carlos Galvez via cfe-commits
carlosgalvezp wrote: Apologies for the delay, I will review during this week! https://github.com/llvm/llvm-project/pull/136167 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

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

2025-05-20 Thread Carlos Galvez via cfe-commits
@@ -383,6 +382,10 @@ void UseTrailingReturnTypeCheck::keepSpecifiers( } } +UseTrailingReturnTypeCheck::UseTrailingReturnTypeCheck( carlosgalvezp wrote: Nit: typically we keep these in the header in this case, since it's just 1 more line in the header, comp

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

2025-05-20 Thread Carlos Galvez via cfe-commits
@@ -113,7 +113,7 @@ struct UnqualNameVisitor : public RecursiveASTVisitor { }; } // namespace -constexpr llvm::StringLiteral Message = +constexpr llvm::StringLiteral MessageFunction = carlosgalvezp wrote: Nit: I think the name was clearer before. I read this

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

2025-05-20 Thread Carlos Galvez via cfe-commits
carlosgalvezp wrote: Thanks, I didn't notice they were the same. In that case they should be removed and have nothing. Optionally one can add a human-readable comment like "Should not trigger here" or something, but it's not necessary. https://github.com/llvm/llvm-project/pull/140753 _

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

2025-05-20 Thread Carlos Galvez via cfe-commits
carlosgalvezp wrote: Also, CHECK-MESSAGES-NOT is discouraged, since the testing framework already checked that no other output is produced by default. https://github.com/llvm/llvm-project/pull/140753 ___ cfe-commits mailing list cfe-commits@lists.llvm

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

2025-05-20 Thread Carlos Galvez via cfe-commits
https://github.com/carlosgalvezp requested changes to this pull request. Why are the fixes being removed? CHECK-FIXES is not equivalent to CHECK-MESSAGES-NOT https://github.com/llvm/llvm-project/pull/140753 ___ cfe-commits mailing list cfe-commits@lis

[clang-tools-extra] [clang-tidy] Do not flag strerror in concurrency-mt-unsafe (PR #140520)

2025-05-19 Thread Carlos Galvez via cfe-commits
https://github.com/carlosgalvezp closed https://github.com/llvm/llvm-project/pull/140520 ___ 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 flag strerror in concurrency-mt-unsafe (PR #140520)

2025-05-19 Thread Carlos Galvez via cfe-commits
https://github.com/carlosgalvezp updated https://github.com/llvm/llvm-project/pull/140520 >From 35769db674fc2ebe7c0dda9ed329806b8b059414 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20G=C3=A1lvez?= Date: Mon, 19 May 2025 09:35:30 + Subject: [PATCH 1/2] [clang-tidy] Do not flag strerror i

[clang-tools-extra] [clang-tidy] Do not flag strerror in concurrency-mt-unsafe (PR #140520)

2025-05-19 Thread Carlos Galvez via cfe-commits
https://github.com/carlosgalvezp created https://github.com/llvm/llvm-project/pull/140520 The docs of the check state: > Glibc’s list is compiled from GNU web documentation with a search for MT-Safe > tag And strerror fulfills exactly that: https://www.gnu.org/software/libc/manual/html_node/

[clang-tools-extra] [CLANGD] [NFC] Fix proposed by sanitizer. (PR #140116)

2025-05-16 Thread Carlos Galvez via cfe-commits
https://github.com/carlosgalvezp approved this pull request. LGTM. In the future, please provide more details about exactly which tool you are using, which you call "sanitizer". For example, what is the name of the tool? "sanitizers" are tools to detect issues at runtime; here you are using a

[clang-tools-extra] [Clang-Tidy][NFC] Simplify check cppcoreguidelines-missing-std-forward (PR #138504)

2025-05-06 Thread Carlos Galvez via cfe-commits
https://github.com/carlosgalvezp approved this pull request. https://github.com/llvm/llvm-project/pull/138504 ___ 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] Simplify check cppcoreguidelines-missing-std-forward (PR #138504)

2025-05-06 Thread Carlos Galvez via cfe-commits
carlosgalvezp wrote: > because the cases handled by it are covered by CaptureByRefExplicit. Strange, can you explain why that's the case? Are we missing tests? https://github.com/llvm/llvm-project/pull/138504 ___ cfe-commits mailing list cfe-commits@l

[clang-tools-extra] [clang-tidy][NFC][doc] fix typos in docs. (PR #138305)

2025-05-02 Thread Carlos Galvez via cfe-commits
https://github.com/carlosgalvezp closed https://github.com/llvm/llvm-project/pull/138305 ___ 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][doc] fix typos in docs. (PR #138305)

2025-05-02 Thread Carlos Galvez via cfe-commits
https://github.com/carlosgalvezp approved this pull request. https://github.com/llvm/llvm-project/pull/138305 ___ 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-04-30 Thread Carlos Galvez via cfe-commits
@@ -106,6 +106,10 @@ Changes in existing checks ` check to allow specifying additional C++ member functions to match. +- Improved :doc:`cppcoreguidelines-pro-bounds-pointer-arithmetic + ` check by + fix false positives related to operator overloading and templates. -

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

2025-04-30 Thread Carlos Galvez via cfe-commits
https://github.com/carlosgalvezp 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] [clang-tidy] Fix false positive for cppcoreguidelines-pro-bounds-pointer-arithmetic (PR #127394)

2025-04-30 Thread Carlos Galvez via cfe-commits
https://github.com/carlosgalvezp 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] [clang-tidy] Fix false positive for cppcoreguidelines-pro-bounds-pointer-arithmetic (PR #127394)

2025-04-30 Thread Carlos Galvez via cfe-commits
carlosgalvezp wrote: LGTM in general, but won't this fail with a std::map, since the key is an integer? Please rebase on top of latest main and resolve conflicts. https://github.com/llvm/llvm-project/pull/127394 ___ cfe-commits mailing list cfe-commi

[clang-tools-extra] [clang-tidy] Return error code on config parse error (PR #136167)

2025-04-29 Thread Carlos Galvez via cfe-commits
https://github.com/carlosgalvezp requested changes to this pull request. Please document the change in the Release Notes https://github.com/llvm/llvm-project/pull/136167 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi

[clang-tools-extra] [clang-tidy] Return error code on config parse error (PR #136167)

2025-04-29 Thread Carlos Galvez via cfe-commits
@@ -46,20 +46,20 @@ TEST(ClangTidyOptionsProvider, InMemoryFileSystems) { FileOptionsProvider FileOpt({}, {}, {}, FileSystem); - ClangTidyOptions File1Options = + llvm::ErrorOr File1Options = FileOpt.getOptions("ProjectRoot/SubDir1/File.cpp"); - ClangTidyOptions F

[clang-tools-extra] [clang-tidy] Return error code on config parse error (PR #136167)

2025-04-29 Thread Carlos Galvez via cfe-commits
@@ -624,21 +623,29 @@ int clangTidyMain(int argc, const char **argv) { } SmallString<256> FilePath = makeAbsolute(FileName); - ClangTidyOptions EffectiveOptions = OptionsProvider->getOptions(FilePath); + llvm::ErrorOr EffectiveOptions = + OptionsProvider->getOptions

[clang-tools-extra] [clang-tidy] Return error code on config parse error (PR #136167)

2025-04-29 Thread Carlos Galvez via cfe-commits
@@ -370,8 +369,8 @@ static void printStats(const ClangTidyStats &Stats) { } } -static std::unique_ptr createOptionsProvider( - llvm::IntrusiveRefCntPtr FS) { +static std::unique_ptr +createOptionsProvider(llvm::IntrusiveRefCntPtr FS) { carlosgalvezp wrote:

[clang-tools-extra] [clang-tidy] Return error code on config parse error (PR #136167)

2025-04-29 Thread Carlos Galvez via cfe-commits
@@ -337,8 +337,7 @@ Allow empty enabled checks. This suppresses the "no checks enabled" error when disabling all of the checks. )"), - cl::init(false), - cl::cat(ClangTidyCategory)); +

[clang-tools-extra] [clang-tidy] Return error code on config parse error (PR #136167)

2025-04-29 Thread Carlos Galvez via cfe-commits
@@ -266,7 +266,7 @@ ClangTidyOptions ClangTidyContext::getOptionsForFile(StringRef File) const { // Merge options on top of getDefaults() as a safeguard against options with // unset values. return ClangTidyOptions::getDefaults().merge( - OptionsProvider->getOptions

[clang-tools-extra] [clang-tidy] Do not pass any file when listing checks in run_clang_ti… (PR #137286)

2025-04-29 Thread Carlos Galvez via cfe-commits
carlosgalvezp wrote: /cherry-pick 014ab736dc741f24c007f9861e24b31faba0e1e7 https://github.com/llvm/llvm-project/pull/137286 ___ 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 pass any file when listing checks in run_clang_ti… (PR #137286)

2025-04-29 Thread Carlos Galvez via cfe-commits
https://github.com/carlosgalvezp milestoned https://github.com/llvm/llvm-project/pull/137286 ___ 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 pass any file when listing checks in run_clang_ti… (PR #137286)

2025-04-29 Thread Carlos Galvez via cfe-commits
carlosgalvezp wrote: /cherry-pick [014ab73](https://github.com/llvm/llvm-project/commit/014ab736dc741f24c007f9861e24b31faba0e1e7) https://github.com/llvm/llvm-project/pull/137286 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.ll

[clang-tools-extra] [clang-tidy] Do not pass any file when listing checks in run_clang_ti… (PR #137286)

2025-04-29 Thread Carlos Galvez via cfe-commits
https://github.com/carlosgalvezp closed https://github.com/llvm/llvm-project/pull/137286 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy] Avoid diagnosing std::array initializations for modernize-use-designated-initializers (PR #134774)

2025-04-28 Thread Carlos Galvez via cfe-commits
https://github.com/carlosgalvezp closed https://github.com/llvm/llvm-project/pull/134774 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy] Avoid diagnosing std::array initializations for modernize-use-designated-initializers (PR #134774)

2025-04-28 Thread Carlos Galvez via cfe-commits
carlosgalvezp wrote: @RiverDave Do you have permissions to land the PR, or shall I do it for you? https://github.com/llvm/llvm-project/pull/134774 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/c

[clang-tools-extra] [clang-tidy] Avoid diagnosing std::array initializations for modernize-use-designated-initializers (PR #134774)

2025-04-28 Thread Carlos Galvez via cfe-commits
carlosgalvezp wrote: > It can also happen in user defined class. Yes. But it's unclear what the behavior of the check should be. For `std::array`, it's clear, because one must not touch the internal element. For a user-defined type, "it depends" on how the user wants to design their struct.

[clang-tools-extra] [clang-tidy] Avoid diagnosing std::array initializations for modernize-use-designated-initializers (PR #134774)

2025-04-28 Thread Carlos Galvez via cfe-commits
https://github.com/carlosgalvezp approved this pull request. LGTM! https://github.com/llvm/llvm-project/pull/134774 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

  1   2   3   4   5   6   >