[clang-tools-extra] [clang-tidy] Enable `modernize-return-braced-init-list`'s tests in C++11 (PR #158196)

2025-09-19 Thread Carlos Galvez via cfe-commits
carlosgalvezp wrote: Nah I don't think we should make it mandatory. There are checks that don't require any specific standard, there it would make sense to keep whatever the default is. I would say it makes sense to specify it in the test when the check also specifies it as requirement. htt

[clang-tools-extra] [clang-tidy] make `misc-const-correctness` work with `auto` variables and lambdas (PR #157319)

2025-09-17 Thread Carlos Galvez via cfe-commits
carlosgalvezp wrote: > I'm not so sure if we need to remove this option later given by default it > will be set to `true`. Keeping it available means it's possible to tweak it such that auto and non-auto variables are handled differently, but that's probably unwanted. We should make the API h

[clang-tools-extra] [clang-tools-extra][docs] Add "Potentially Breaking Changes" section to ReleaseNotes (PR #158434)

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

[clang-tools-extra] [clang-tidy] Enable `modernize-return-braced-init-list`'s tests in C++11 (PR #158196)

2025-09-17 Thread Carlos Galvez via cfe-commits
https://github.com/carlosgalvezp approved this pull request. https://github.com/llvm/llvm-project/pull/158196 ___ 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] Enable 'readability-simplify-boolean-expr' check (PR #158706)

2025-09-16 Thread Carlos Galvez via cfe-commits
carlosgalvezp wrote: > What do others think? I agree, I have somewhat mixed feelings about this rule. Also negating conditions to make them more optimal/short can also lead to worse readability. I believe this is alleviated by setting `SimplifyDeMorgan` to `false`. https://github.com/llvm/ll

[clang-tools-extra] [clang-tidy][NFC] Enable 'readability-named-parameter' check (PR #158774)

2025-09-16 Thread Carlos Galvez via cfe-commits
@@ -66,14 +66,14 @@ template <> struct MappingTraits { }; struct NOptionMap { - NOptionMap(IO &) {} - NOptionMap(IO &, const ClangTidyOptions::OptionMap &OptionMap) { + NOptionMap(IO & /*unused*/) {} carlosgalvezp wrote: Are these truly named `unused` in

[clang-tools-extra] [clang-tidy] Enable `modernize-return-braced-init-list`'s tests in C++11 (PR #158196)

2025-09-15 Thread Carlos Galvez via cfe-commits
carlosgalvezp wrote: > This could also backfire for users that use "old" c++11. Imagine if the > default standard is increased in `check_clang_tidy.py`, then the people who > develop checks (and write tests) will unintentionally use c++14 as the > default mode. Matchers written with c++14 in m

[clang-tools-extra] [clang-tidy] Enable `modernize-return-braced-init-list`'s tests in C++11 (PR #158196)

2025-09-13 Thread Carlos Galvez via cfe-commits
carlosgalvezp wrote: > It will be c++11-or-later by default: That's sounds very fragile, if the standard is important, the test should be explicit about it. Otherwise anyone can bump that standard in run-clang-tidy.py in the future to something else and suddenly this test no longer tests C+

[clang-tools-extra] [clang-tidy] Enable `modernize-return-braced-init-list`'s tests in C++11 (PR #158196)

2025-09-13 Thread Carlos Galvez via cfe-commits
https://github.com/carlosgalvezp commented: The change will make it test only in C++17, won't it? Don't we want c++11-or-later instead? https://github.com/llvm/llvm-project/pull/158196 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://li

[clang-tools-extra] [clang-tidy] Fixed typo for bugprone-easily-swappable-parameters clang-tidy check (PR #158282)

2025-09-13 Thread Carlos Galvez via cfe-commits
https://github.com/carlosgalvezp approved this pull request. LGTM, thank you! https://github.com/llvm/llvm-project/pull/158282 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [cland-tidy][NFC] Fixed documentation for modernize-make-shared check (PR #158421)

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

[clang-tools-extra] [cland-tidy][NFC] Fixed documentation for modernize-make-shared check (PR #158421)

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

[clang-tools-extra] [clang-tidy] Fixed typo for bugprone-easily-swappable-parameters clang-tidy check (PR #158282)

2025-09-13 Thread Carlos Galvez via cfe-commits
https://github.com/carlosgalvezp closed https://github.com/llvm/llvm-project/pull/158282 ___ 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 google-runtime-float Clang-Tidy check (PR #156763)

2025-09-12 Thread Carlos Galvez via cfe-commits
carlosgalvezp wrote: > I think this can go straight into `portability`. Also linking this recent > related PR: #146970. It could go there and then have an alias to `google` if wanted maybe? https://github.com/llvm/llvm-project/pull/156763 ___ cfe-co

[clang-tools-extra] [clang-tidy] Fixed typo for bugprone-easily-swappable-parameters clang-tidy check (PR #158282)

2025-09-12 Thread Carlos Galvez via cfe-commits
carlosgalvezp wrote: > Indeed, this would break the current configuration files. You mentioned the > release notes. Do I need to add anything to my PR regarding this? Yes, please edit the file clang-tools-extra/docs/ReleasesNotes.md and mention this change in "Improvements to existing checks".

[clang-tools-extra] [clang-tidy] Fixed typo for bugprone-easily-swappable-parameters clang-tidy check (PR #158282)

2025-09-12 Thread Carlos Galvez via cfe-commits
https://github.com/carlosgalvezp requested changes to this pull request. Need mention in the Release Notes. This is a breaking user-facing change, I have found at least 24 hits: https://sourcegraph.com/search?q=context:global+NamePrefixSuffixSilenceDissimilarityTreshold+file:.+%22.clang-tidy%22

[clang-tools-extra] [clang-tidy] make `misc-const-correctness` work with `auto` variables and lambdas (PR #157319)

2025-09-12 Thread Carlos Galvez via cfe-commits
carlosgalvezp wrote: That sounds good to me, we should document clearly that this is a temporary option (active warning by default) to ease migration, and will be removed in clang-tidy-24. The intention is for auto and non-auto variables to have the same treatment. https://github.com/llvm/llv

[clang-tools-extra] [clang-tidy] make `misc-const-correctness` work with `auto` variables and lambdas (PR #157319)

2025-09-08 Thread Carlos Galvez via cfe-commits
@@ -10,6 +10,12 @@ template void type_dependent_variables() { T value = 42; auto &ref = value; + // CHECK-MESSAGES:[[@LINE-1]]:3: warning: variable 'ref' of type 'int &' can be declared 'const' + // CHECK-FIXES: auto const&ref = value; carlosgalvezp wr

[clang-tools-extra] [clang-tidy] make `misc-const-correctness` work with `auto` variables and lambdas (PR #157319)

2025-09-08 Thread Carlos Galvez via cfe-commits
carlosgalvezp wrote: > and therefore doesn't need an option Yeah I don't have a strong opinion. I was considering it more from a bump perspective - when bumping clang-tidy this will lead to a lot of new hits, people may need to disable the entire check just to get it through. But maybe there

[clang-tools-extra] [clang-tidy] make `misc-const-correctness` work with `auto` variables and lambdas (PR #157319)

2025-09-08 Thread Carlos Galvez via cfe-commits
carlosgalvezp wrote: > There is though Maybe I was looking at an outdated version, sorry! Looks good. https://github.com/llvm/llvm-project/pull/157319 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/list

[clang-tools-extra] [clang-tidy] make `misc-const-correctness` work with `auto` variables and lambdas (PR #157319)

2025-09-07 Thread Carlos Galvez via cfe-commits
https://github.com/carlosgalvezp requested changes to this pull request. I notice now there's no update in Release Notes for this. I also agree with previous reviewers that adding an option would be helpful to ease in adopting to this new behavior. I would still make it on-by-default, though.

[clang-tools-extra] [clang-tidy] make `misc-const-correctness` work with `auto` variables and lambdas (PR #157319)

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

[clang-tools-extra] [clang-tidy] make `misc-const-correctness` work with `auto` variables and lambdas (PR #157319)

2025-09-07 Thread Carlos Galvez via cfe-commits
@@ -10,6 +10,12 @@ template void type_dependent_variables() { T value = 42; auto &ref = value; + // CHECK-MESSAGES:[[@LINE-1]]:3: warning: variable 'ref' of type 'int &' can be declared 'const' + // CHECK-FIXES: auto const&ref = value; + // + // FIXME: This is a fals

[clang-tools-extra] [clang-tidy] make `misc-const-correctness` work with `auto` variables and lambdas (PR #157319)

2025-09-07 Thread Carlos Galvez via cfe-commits
@@ -10,6 +10,12 @@ template void type_dependent_variables() { T value = 42; auto &ref = value; + // CHECK-MESSAGES:[[@LINE-1]]:3: warning: variable 'ref' of type 'int &' can be declared 'const' + // CHECK-FIXES: auto const&ref = value; carlosgalvezp wr

[clang-tools-extra] [clang-tidy] Rename 'cert-err34-c' to 'bugprone-unchecked-string-to-number-conversion' (PR #157285)

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

[clang-tools-extra] [clang-tidy] Remove 'clang-analyzer-*' checks from default checks. (PR #157306)

2025-09-07 Thread Carlos Galvez via cfe-commits
https://github.com/carlosgalvezp approved this pull request. LGTM, but I wonder if we need a 2-release cycle for this, after all people might silently lose an important part of clang-tidy coverage and the note in the release notes could be hard to spot in the middle of the other notes. Perhaps

[clang] [clang-tools-extra] [compiler-rt] [flang] [libcxx] [libcxxabi] [lld] [lldb] [llvm] [Inclusive Language] migrate "sanity" checks to "soundness" checks (PR #156995)

2025-09-07 Thread Carlos Galvez via cfe-commits
carlosgalvezp wrote: > I opened an RFC pitch thread on the forums. For easier access: https://discourse.llvm.org/t/rfc-inclusive-language-migrate-sanity-checks-to-soundness-checks https://github.com/llvm/llvm-project/pull/156995 ___ cfe-commits maili

[clang-tools-extra] [clang-tidy] Add new '-hide-progress' option to tidy-scripts for suppressing progress information (PR #154416)

2025-09-07 Thread Carlos Galvez via cfe-commits
https://github.com/carlosgalvezp approved this pull request. https://github.com/llvm/llvm-project/pull/154416 ___ 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 alias 'bugprone-unchecked-string-to-number-conversion' for 'cert-err34-c' (PR #157285)

2025-09-07 Thread Carlos Galvez via cfe-commits
carlosgalvezp wrote: Great initiative, thank you! I will review soon. The commit message title can be a bit misleading, I read it as "create a new alias in bugprone, which points to the cert check", but in reality the intention is the other way around, alias from bugprone to cert. https://gi

[clang-tools-extra] [clang-tidy] Remove global options IgnoreMacros and StrictMode (PR #157049)

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

[clang-tools-extra] [clang-tidy] Remove global options IgnoreMacros and StrictMode (PR #157049)

2025-09-06 Thread Carlos Galvez via cfe-commits
https://github.com/carlosgalvezp updated https://github.com/llvm/llvm-project/pull/157049 >From dc9f561223c1f1031196b34adaf30080130c6bc0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20G=C3=A1lvez?= Date: Fri, 5 Sep 2025 08:09:21 + Subject: [PATCH] [clang-tidy] Remove global options Ignor

[clang] [clang-tools-extra] [clang-tidy] Do not crash when an empty directory is used in the comp… (PR #156873)

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

[clang-tools-extra] [clang-tidy] Remove global options IgnoreMacros and StrictMode (PR #157049)

2025-09-05 Thread Carlos Galvez via cfe-commits
https://github.com/carlosgalvezp updated https://github.com/llvm/llvm-project/pull/157049 >From 6cb7d9b7a1c1ab17f8a6aa10414a5dbd06ee83ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20G=C3=A1lvez?= Date: Fri, 5 Sep 2025 08:09:21 + Subject: [PATCH 1/2] [clang-tidy] Remove global options I

[clang-tools-extra] [clang-tidy][NFC] Enable `readability-container-contains` check in clang-tidy config and apply fix-its (PR #157123)

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

[clang-tools-extra] [clang-tidy] Remove global options IgnoreMacros and StrictMode (PR #157049)

2025-09-05 Thread Carlos Galvez via cfe-commits
https://github.com/carlosgalvezp updated https://github.com/llvm/llvm-project/pull/157049 >From 6cb7d9b7a1c1ab17f8a6aa10414a5dbd06ee83ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20G=C3=A1lvez?= Date: Fri, 5 Sep 2025 08:09:21 + Subject: [PATCH] [clang-tidy] Remove global options Ignor

[clang-tools-extra] [Clang-Tidy] Add google-runtime-float Clang-Tidy check (PR #156763)

2025-09-04 Thread Carlos Galvez via cfe-commits
@@ -0,0 +1,38 @@ +// RUN: %check_clang_tidy %s google-runtime-float %t + +long double foo; +// CHECK-MESSAGES: :[[@LINE-1]]:1: warning: consider replacing 'long double' with a 64-bit or 128-bit float type [google-runtime-float] + +typedef long double MyLongDouble; +// CHECK-MESSA

[clang-tools-extra] [clang-tidy] Add new '-hide-progress' option to tidy-scripts for suppressing progress information (PR #154416)

2025-09-04 Thread Carlos Galvez via cfe-commits
@@ -258,6 +258,11 @@ def main(): help="Upgrades clang-tidy warnings to errors. Same format as '-checks'.", default="", ) +parser.add_argument( +"-hide-progress", carlosgalvezp wrote: Actually now that you mention it `-hide-prog

[clang-tools-extra] [clang-tidy] Add new '-hide-progress' option to tidy-scripts for suppressing progress information (PR #154416)

2025-09-04 Thread Carlos Galvez via cfe-commits
@@ -258,6 +258,11 @@ def main(): help="Upgrades clang-tidy warnings to errors. Same format as '-checks'.", default="", ) +parser.add_argument( +"-hide-progress", carlosgalvezp wrote: Ack! https://github.com/llvm/llvm-project/p

[clang-tools-extra] [Clang-Tidy] Add google-runtime-float Clang-Tidy check (PR #156763)

2025-09-04 Thread Carlos Galvez via cfe-commits
@@ -0,0 +1,10 @@ +.. title:: clang-tidy - google-runtime-float + +google-runtime-float + + +Finds uses of ``long double`` and suggests replacing them with 64-bit +or 128-bit floating-point types. carlosgalvezp wrote: What are 128-bit floating

[clang-tools-extra] [clang-tidy] Fix `readability-uppercase-literal-suffix` warning with hex literals (PR #156584)

2025-09-03 Thread Carlos Galvez via cfe-commits
https://github.com/carlosgalvezp commented: LGTM, I wonder why the `bB` was there in the first place. Binary numbers? https://github.com/llvm/llvm-project/pull/156584 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bi

[clang-tools-extra] [clang-tidy][NFC] Enable `readability-convert-member-functions-to-static` in the codebase (PR #156265)

2025-09-03 Thread Carlos Galvez via cfe-commits
carlosgalvezp wrote: Personally I don't really like this rule, especially in combination with `readability-static-accessed-through-instance`. Now we have a mix of static and non-static functions in the classes, even though they are always called on a concrete object. One could argue that those

[clang] [clang-tools-extra] [compiler-rt] [flang] [libc] [libcxx] [lldb] [llvm] [mlir] [openmp] Fix typos and spelling errors across codebase (PR #156270)

2025-09-01 Thread Carlos Galvez via cfe-commits
carlosgalvezp wrote: > we shouldn't discourage people from improving the codebase These are orthogonal issues. People are always welcome to improve the codebase, but small PRs are essential for a healthy codebase. And it will actually be **less* work for the author, because the patches will be

[clang-tools-extra] [clang-tidy][NFC] Add custom .clang-format with 'QualifierAlignment: Left' (PR #155852)

2025-08-28 Thread Carlos Galvez via cfe-commits
https://github.com/carlosgalvezp approved this pull request. LGTM! Worth keeping in mind that this new .clang-format file makes clang-tidy potentially disconnected from the rest of the repo, in case the top-level file were to introduce new options. But hopefully everything is baked into the "L

[clang-tools-extra] [clang-tidy] New bugprone-method-hiding check (PR #154746)

2025-08-26 Thread Carlos Galvez via cfe-commits
carlosgalvezp wrote: The check name is a bit too vague/general, I would call it `bugprone-derived-method-shadowing-base-method` or similar. You can easily apply the renaming with the `rename_check.py`. But let's wait until there's some consensus on this. https://github.com/llvm/llvm-project/p

[clang-tools-extra] [clang-tidy] Skip system macros in readability-identifier-naming check (PR #132016)

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

[clang-tools-extra] [clang-tidy] Skip system macros in readability-identifier-naming check (PR #132016)

2025-08-23 Thread Carlos Galvez via cfe-commits
carlosgalvezp wrote: Yes, the patch can be merged and gets rid of about half the remaining warnings in system headers! I've removed the condition about checking for the `SystemHeaders` flag, for consistency with similar code for ignoring the `Decl`s, which further simplifies the logic. https:

[clang-tools-extra] [clang-tidy] Skip system macros in readability-identifier-naming check (PR #132016)

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

[clang-tools-extra] [clang-tidy] Skip system macros in readability-identifier-naming check (PR #132016)

2025-08-23 Thread Carlos Galvez via cfe-commits
https://github.com/carlosgalvezp updated https://github.com/llvm/llvm-project/pull/132016 >From f57920884bdc225e453fd0d5508494c35d87b3c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20G=C3=A1lvez?= Date: Wed, 19 Mar 2025 12:28:49 + Subject: [PATCH] [clang-tidy] Skip system macros in rea

[clang-tools-extra] [clang-tidy] Skip system macros in readability-identifier-naming check (PR #132016)

2025-08-23 Thread Carlos Galvez via cfe-commits
carlosgalvezp wrote: Let me refresh my memory about this patch and come back :) https://github.com/llvm/llvm-project/pull/132016 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-tools-extra] [clang][AST][clang-tidy] Do not set a reduced traversal scope in ASTM… (PR #132725)

2025-08-23 Thread Carlos Galvez via cfe-commits
carlosgalvezp wrote: Yes, thank you, closing! https://github.com/llvm/llvm-project/pull/132725 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-tools-extra] [clang][AST][clang-tidy] Do not set a reduced traversal scope in ASTM… (PR #132725)

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

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

2025-08-23 Thread Carlos Galvez via cfe-commits
https://github.com/carlosgalvezp approved this pull request. LGTM 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] Add option to allow pre/post increment/decrement operator in cppcoreg… (PR #155015)

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

[clang-tools-extra] Add option to allow pre/post increment/decrement operator in cppcoreg… (PR #155015)

2025-08-22 Thread Carlos Galvez via cfe-commits
https://github.com/carlosgalvezp created https://github.com/llvm/llvm-project/pull/155015 …uidelines-pro-bounds-pointer-arithmetic Fixes #154907 >From c4f59473a6bac427e393cbc19aee9d485348acee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20G=C3=A1lvez?= Date: Fri, 22 Aug 2025 19:13:18 +

[clang-tools-extra] [clang-tidy][doc] Improve option docs for readability-identifier-naming (PR #154806)

2025-08-21 Thread Carlos Galvez via cfe-commits
https://github.com/carlosgalvezp created https://github.com/llvm/llvm-project/pull/154806 Currently it's hard to find the "general" options, since they are listed in the middle of the "specific" options. Split them into two categories so they are easier to find. This can help in adding a pote

[clang-tools-extra] [clang-tidy] New bugprone-method-hiding check (PR #154746)

2025-08-21 Thread Carlos Galvez via cfe-commits
@@ -4,6 +4,9 @@ // See https://llvm.org/LICENSE.txt for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // +// SPDX-FileCopyrightText: Portions Copyright 2025 Siemens and/or its affiliates +// May 2025 modified by Siemens and/or its affiliates b

[clang] Do not trigger -Wmissing-noreturn on lambdas prior to C++23 (PR #154545)

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

[clang] [Clang][X86] Replace F16C `vcvtph2ps/256` intrinsics with `(convert|shuffle)vector` builtins (PR #152911)

2025-08-20 Thread Carlos Galvez via cfe-commits
carlosgalvezp wrote: Thank you for the quick response! Will try that out. https://github.com/llvm/llvm-project/pull/152911 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][X86] Replace F16C `vcvtph2ps/256` intrinsics with `(convert|shuffle)vector` builtins (PR #152911)

2025-08-20 Thread Carlos Galvez via cfe-commits
carlosgalvezp wrote: Hi! It appears this commit breaks our code, with the error: ``` error: use of undeclared identifier '__builtin_ia32_vcvtph2ps256'; ``` I could not find any mention of this change in the Release Notes, nor documentation on how to migrate from it. Could that be added? http

[clang] Do not trigger -Wmissing-noreturn on lambdas prior to C++23 (PR #154545)

2025-08-20 Thread Carlos Galvez via cfe-commits
carlosgalvezp wrote: Thanks for the review! @zwuis Let me know if I've addressed your comments :) https://github.com/llvm/llvm-project/pull/154545 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/

[clang] Do not trigger -Wmissing-noreturn on lambdas prior to C++23 (PR #154545)

2025-08-20 Thread Carlos Galvez via cfe-commits
https://github.com/carlosgalvezp updated https://github.com/llvm/llvm-project/pull/154545 >From 0e006a3e28d4d3a6a0faeb88caab344e08fcde38 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20G=C3=A1lvez?= Date: Wed, 20 Aug 2025 13:46:58 + Subject: [PATCH] Do not trigger -Wmissing-noreturn on la

[clang] Do not trigger -Wmissing-noreturn on lambdas prior to C++23 (PR #154545)

2025-08-20 Thread Carlos Galvez via cfe-commits
https://github.com/carlosgalvezp created https://github.com/llvm/llvm-project/pull/154545 Fixes #154493 >From ad5814e0d775db9c455809bec7c2e80ab5c5cfc3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20G=C3=A1lvez?= Date: Wed, 20 Aug 2025 13:46:58 + Subject: [PATCH] Do not trigger -Wmissing

[clang] [clang-tools-extra] [clang] Improve nested name specifier AST representation (PR #147835)

2025-08-19 Thread Carlos Galvez via cfe-commits
carlosgalvezp wrote: FYI bisecting https://github.com/llvm/llvm-project/issues/153770 leads to this patch https://github.com/llvm/llvm-project/pull/147835 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/l

[clang-tools-extra] [clang-tidy] Add detection in container's method except `empty` in `readability-container-size-empty` (PR #154017)

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

[clang-tools-extra] [clang-tidy][docs] Add description of "clang-diagnostic-error" (PR #153870)

2025-08-17 Thread Carlos Galvez via cfe-commits
https://github.com/carlosgalvezp approved this pull request. LGTM, thank you! https://github.com/llvm/llvm-project/pull/153870 ___ 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 "-quiet" option by suppressing "xxx warnings generated" (PR #154012)

2025-08-17 Thread Carlos Galvez via cfe-commits
https://github.com/carlosgalvezp approved this pull request. LGTM, thanks for fixing! It might be worth double-checking the comment I wrote about this carets option (which I guess is equivalent to passing the command line flag): https://github.com/llvm/llvm-project/issues/47042#issuecomment-13

[clang-tools-extra] [clang-tidy] Improve "-quiet" option by suppressing "xxx warnings generated" (PR #154012)

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

[clang-tools-extra] [clang-tidy] Rename "clang-diagnostic-error" to "clang-compiler-error" (PR #153870)

2025-08-17 Thread Carlos Galvez via cfe-commits
carlosgalvezp wrote: This will be a breaking change for people who post-process the clang-tidy logs in some way and search for `clang-diagnostic-error`: https://sourcegraph.com/search?q=context:global+clang-diagnostic-error&patternType=keyword&sm=0 I see hits in scripts from "major" organisati

[clang-tools-extra] [clang-tidy][NFC] Remove py2 conditions from clang-tidy scripts (PR #154005)

2025-08-17 Thread Carlos Galvez via cfe-commits
https://github.com/carlosgalvezp approved this pull request. https://github.com/llvm/llvm-project/pull/154005 ___ 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 `cppcoreguidelines-prefer-member-initializer` false positive for inherited members (PR #153941)

2025-08-17 Thread Carlos Galvez via cfe-commits
https://github.com/carlosgalvezp closed https://github.com/llvm/llvm-project/pull/153941 ___ 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-17 Thread Carlos Galvez via cfe-commits
https://github.com/carlosgalvezp closed 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] Fix `cppcoreguidelines-prefer-member-initializer` false positive for inherited members (PR #153941)

2025-08-17 Thread Carlos Galvez via cfe-commits
@@ -650,3 +650,20 @@ struct InitFromBindingDecl { } }; } // namespace GH82970 + +namespace inherited_members { carlosgalvezp wrote: But like I said I don't have a strong opinion and it's definitely not a blocker :) https://github.com/llvm/llvm-project/pull

[clang-tools-extra] [clang-tidy] Fix `cppcoreguidelines-prefer-member-initializer` false positive for inherited members (PR #153941)

2025-08-17 Thread Carlos Galvez via cfe-commits
@@ -650,3 +650,20 @@ struct InitFromBindingDecl { } }; } // namespace GH82970 + +namespace inherited_members { carlosgalvezp wrote: Personally I would just remove the namespace altogether, most checks have tests for templates without handling them any diffe

[clang-tools-extra] [clang-tidy] Fix `cppcoreguidelines-prefer-member-initializer` false positive for inherited members (PR #153941)

2025-08-16 Thread Carlos Galvez via cfe-commits
https://github.com/carlosgalvezp edited https://github.com/llvm/llvm-project/pull/153941 ___ 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 `cppcoreguidelines-prefer-member-initializer` false positive for inherited members (PR #153941)

2025-08-16 Thread Carlos Galvez via cfe-commits
https://github.com/carlosgalvezp approved this pull request. LGTM, please fix the CI errors :) https://github.com/llvm/llvm-project/pull/153941 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe

[clang-tools-extra] [clang-tidy] Fix `cppcoreguidelines-prefer-member-initializer` false positive for inherited members (PR #153941)

2025-08-16 Thread Carlos Galvez via cfe-commits
@@ -650,3 +650,20 @@ struct InitFromBindingDecl { } }; } // namespace GH82970 + +namespace inherited_members { carlosgalvezp wrote: Nit: the issue is not just about inherited members, since that's working well before this patch. The key is the child class b

[clang-tools-extra] [clang-tidy] Fix `cppcoreguidelines-prefer-member-initializer` false positive for inherited members (PR #153941)

2025-08-16 Thread Carlos Galvez via cfe-commits
carlosgalvezp wrote: This should fix #104400 https://github.com/llvm/llvm-project/pull/153941 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy] Remove addition of emacs tag in checks headers (PR #153942)

2025-08-16 Thread Carlos Galvez via cfe-commits
https://github.com/carlosgalvezp approved this pull request. LGTM! I agree cleaning existing code shall be done in another PR, via some automated script. https://github.com/llvm/llvm-project/pull/153942 ___ cfe-commits mailing list cfe-commits@lists.l

[clang-tools-extra] [clang-tidy] Add check 'bugprone-cast-to-struct' (PR #153428)

2025-08-15 Thread Carlos Galvez via cfe-commits
carlosgalvezp wrote: > the planned follow-up is that the unfinished low-quality > alpha.core.CastToStruct check will be removed from the Clang Static Analyzer. Thanks for the clarification, it was indeed written `move` in the commit message. Sounds good to me! https://github.com/llvm/llvm-pro

[clang-tools-extra] [clang-tidy][docs] Add documentation for Clang-Tidy Automation (PR #153166)

2025-08-15 Thread Carlos Galvez via cfe-commits
carlosgalvezp wrote: > You need to have `Sphinx` and build `docs-clang-tools-html` target in CMake > (possibly using `ninja docs-clang-tools-html`). > https://clang.llvm.org/extra/clang-tidy/Contributing.html#documenting-your-check I believe you also need to enable these CMake flags: ``` -DLL

[clang-tools-extra] [clang-tidy] Add check 'bugprone-cast-to-struct' (PR #153428)

2025-08-14 Thread Carlos Galvez via cfe-commits
https://github.com/carlosgalvezp edited https://github.com/llvm/llvm-project/pull/153428 ___ 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 check 'bugprone-cast-to-struct' (PR #153428)

2025-08-14 Thread Carlos Galvez via cfe-commits
@@ -0,0 +1,54 @@ +.. title:: clang-tidy - bugprone-cast-to-struct + +bugprone-cast-to-struct +=== + +Finds casts from pointers to struct or scalar type to pointers to struct type. + +Casts between pointers to different structs can be unsafe because it is possi

[clang-tools-extra] [clang-tidy][doc] Improve documentation of the -line-filter flag (PR #153372)

2025-08-13 Thread Carlos Galvez via cfe-commits
https://github.com/carlosgalvezp closed https://github.com/llvm/llvm-project/pull/153372 ___ 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-10 Thread Carlos Galvez via cfe-commits
carlosgalvezp wrote: I will leave the patch open one more week before landing in case there's more feedback, thank you! https://github.com/llvm/llvm-project/pull/151035 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi

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

2025-08-10 Thread Carlos Galvez via cfe-commits
https://github.com/carlosgalvezp deleted 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-tools-extra] [clang-tidy][NFC] Do less unnecessary work in `NoLintDirectiveHandler` (PR #147553)

2025-08-10 Thread Carlos Galvez via cfe-commits
@@ -31,8 +31,6 @@ class NoLintDirectiveHandler { public: NoLintDirectiveHandler(); ~NoLintDirectiveHandler(); carlosgalvezp wrote: > It's = default; anyway. Then it should just be removed? Rule of 0. https://github.com/llvm/llvm-project/pull/147553 _

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

2025-08-09 Thread Carlos Galvez via cfe-commits
carlosgalvezp wrote: Friendly ping @steakhal @Xazax-hun , let me know if I've answered your questions/comments. https://github.com/llvm/llvm-project/pull/151035 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/m

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

2025-08-09 Thread Carlos Galvez via cfe-commits
https://github.com/carlosgalvezp updated https://github.com/llvm/llvm-project/pull/151035 >From 511308493d8eb6612f6e6413919c7eaa19596820 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20G=C3=A1lvez?= Date: Thu, 24 Jul 2025 21:10:43 + Subject: [PATCH] [clang-tidy] Avoid matching nodes in sy

[clang-tools-extra] [clang-tidy] Print type information to performance-unnecessary-* checks (PR #152101)

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

[clang-tools-extra] [clang-tidy] Print type information to performance-unnecessary-* checks (PR #152101)

2025-08-05 Thread Carlos Galvez via cfe-commits
https://github.com/carlosgalvezp created https://github.com/llvm/llvm-project/pull/152101 Useful when the check warns on template functions to know which type it's complaining about. Otherwise, since the instantiation stack is not printed, it's very hard to tell. >From fc1f9ac108af0721f5fb3f2

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

2025-08-03 Thread Carlos Galvez via cfe-commits
https://github.com/carlosgalvezp updated https://github.com/llvm/llvm-project/pull/151035 >From ba0f486d6509c4227dfd3fdd66f0514534230186 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20G=C3=A1lvez?= Date: Thu, 24 Jul 2025 21:10:43 + Subject: [PATCH] [clang-tidy] Avoid matching nodes in sy

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

2025-08-03 Thread Carlos Galvez via cfe-commits
carlosgalvezp wrote: > In one of the files we check. Would we still get warnings for UserCode? Yes, we would. For example, a simple: ``` int x = 0; assert(reinterpret_cast(x) == nullptr); ``` Triggers `cppcoreguidelines-pro-type-reinterpret-cast` for the use of `reinterpret_cast`, even if it'

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

2025-08-03 Thread Carlos Galvez via cfe-commits
https://github.com/carlosgalvezp updated https://github.com/llvm/llvm-project/pull/151035 >From 638b35e0f66f216cf29b67834f212f56f09acd7a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20G=C3=A1lvez?= Date: Thu, 24 Jul 2025 21:10:43 + Subject: [PATCH] [clang-tidy] Avoid matching nodes in sy

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

2025-08-03 Thread Carlos Galvez via cfe-commits
@@ -1336,6 +1336,44 @@ class MatchASTVisitor : public RecursiveASTVisitor, return false; } + template static SourceLocation getNodeLocation(const T &Node) { +return Node.getBeginLoc(); + } + + static SourceLocation getNodeLocation(const QualType &Node) { return

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

2025-08-03 Thread Carlos Galvez via cfe-commits
https://github.com/carlosgalvezp updated https://github.com/llvm/llvm-project/pull/151035 >From 89a2228e6599b5d1dbd0b734403b317076a93669 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20G=C3=A1lvez?= Date: Thu, 24 Jul 2025 21:10:43 + Subject: [PATCH] [clang-tidy] Avoid matching nodes in sy

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

2025-08-03 Thread Carlos Galvez via cfe-commits
@@ -1336,6 +1336,44 @@ class MatchASTVisitor : public RecursiveASTVisitor, return false; } + template static SourceLocation getNodeLocation(const T &Node) { +return Node.getBeginLoc(); + } + + static SourceLocation getNodeLocation(const QualType &Node) { return

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

2025-08-03 Thread Carlos Galvez via cfe-commits
@@ -1336,6 +1336,44 @@ class MatchASTVisitor : public RecursiveASTVisitor, return false; } + template static SourceLocation getNodeLocation(const T &Node) { +return Node.getBeginLoc(); + } + + static SourceLocation getNodeLocation(const QualType &Node) { return

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

2025-08-03 Thread Carlos Galvez via cfe-commits
@@ -1507,11 +1544,17 @@ bool MatchASTVisitor::TraverseStmt(Stmt *StmtNode, DataRecursionQueue *Queue) { } bool MatchASTVisitor::TraverseType(QualType TypeNode) { + if (shouldSkipNode(TypeNode)) carlosgalvezp wrote: My goal was to establish a somewhat consis

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

2025-08-03 Thread Carlos Galvez 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 analyze code from system headers

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

2025-08-03 Thread Carlos Galvez via cfe-commits
carlosgalvezp wrote: > what is the expected behavior for code expanded from macros defined in system > header? As it is right now, we do not perform any expansion of the `SourceLocation` before checking if it is in a system header, so the behavior is that macros coming from system headers won

  1   2   3   4   5   6   7   8   >