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
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
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
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
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
@@ -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
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
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+
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
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
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
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
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
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
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".
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
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
@@ -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
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
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
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.
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
@@ -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
@@ -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
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
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
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
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
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
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
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
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
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
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
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
@@ -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
@@ -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
@@ -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
@@ -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
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
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
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
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
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
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
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:
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
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
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
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
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
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
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
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 +
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
@@ -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
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
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
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
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/
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
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
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
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
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
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
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
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
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
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
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
@@ -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
@@ -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
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
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
@@ -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
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
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
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
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
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
@@ -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
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
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
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
@@ -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
_
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
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
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
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
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
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'
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
@@ -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
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
@@ -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
@@ -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
@@ -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
@@ -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
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 - 100 of 727 matches
Mail list logo