[clang-tools-extra] [clang-tidy] Fix handling of members in readability-redundant-member-init (PR #93217)

2024-05-23 Thread Julian Schmidt via cfe-commits
@@ -387,6 +387,11 @@ Changes in existing checks ` check to properly emit warnings for static data member with an in-class initializer. +- Improved :doc:`readability-redundant-member-init + ` check to avoid + false-positives when type of the member does not match type of

[clang-tools-extra] [clang-tidy] Fix handling of members in readability-redundant-member-init (PR #93217)

2024-05-23 Thread Julian Schmidt via cfe-commits
https://github.com/5chmidti approved this pull request. LGTM, with a release note nit. https://github.com/llvm/llvm-project/pull/93217 ___ 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 handling of members in readability-redundant-member-init (PR #93217)

2024-05-23 Thread Julian Schmidt via cfe-commits
https://github.com/5chmidti edited https://github.com/llvm/llvm-project/pull/93217 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy] Optimize realpath in readability-identifier-naming (PR #92659)

2024-05-23 Thread Julian Schmidt via cfe-commits
https://github.com/5chmidti approved this pull request. This halves the time clang-tidy takes to run this check on `IdentifierNamingCheck.cpp` for me :) Maybe add a release note? https://github.com/llvm/llvm-project/pull/92659 ___ cfe-commits

[clang-tools-extra] [clang-tidy] Correcting issues in `readability-implicit-bool-conversion` on C23 (PR #92241)

2024-05-16 Thread Julian Schmidt via cfe-commits
=?utf-8?q?Björn?= Svensson , =?utf-8?q?Björn?= Svensson Message-ID: In-Reply-To: @@ -96,8 +96,8 @@ The rules for generating fix-it hints are: - ``if (!pointer)`` is changed to ``if (pointer == nullptr)``, - in case of conversions from bool to other built-in types, an

[clang-tools-extra] [clang-tidy] Correcting issues in `readability-implicit-bool-conversion` on C23 (PR #92241)

2024-05-16 Thread Julian Schmidt via cfe-commits
=?utf-8?q?Björn?= Svensson , =?utf-8?q?Björn?= Svensson Message-ID: In-Reply-To: @@ -368,7 +368,8 @@ Changes in existing checks - Improved :doc:`readability-implicit-bool-conversion ` check to provide valid fix suggestions for ``static_cast`` without a preceding space

[clang-tools-extra] [clang-tidy] Correcting issues in `readability-implicit-bool-conversion` on C23 (PR #92241)

2024-05-16 Thread Julian Schmidt via cfe-commits
=?utf-8?q?Bj=C3=B6rn?= Svensson , =?utf-8?q?Bj=C3=B6rn?= Svensson Message-ID: In-Reply-To: https://github.com/5chmidti approved this pull request. LGTM, just two nits w.r.t documentation wording https://github.com/llvm/llvm-project/pull/92241 ___

[clang-tools-extra] [clang-tidy] Correcting issues in `readability-implicit-bool-conversion` on C23 (PR #92241)

2024-05-16 Thread Julian Schmidt via cfe-commits
=?utf-8?q?Björn?= Svensson , =?utf-8?q?Björn?= Svensson Message-ID: In-Reply-To: https://github.com/5chmidti edited https://github.com/llvm/llvm-project/pull/92241 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang-tools-extra] [clang-tidy] Rename out-of-line function definitions (PR #91954)

2024-05-16 Thread Julian Schmidt via cfe-commits
https://github.com/5chmidti approved this pull request. https://github.com/llvm/llvm-project/pull/91954 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-tools-extra] [llvm] Add ``ignoringParenImpCasts`` in arguments of hasArgument (PR #89553)

2024-05-15 Thread Julian Schmidt via cfe-commits
5chmidti wrote: Somehow I couldn't link that issue the normal way through the `Development` entry on the side, so I eddited in a `Fixed` message into the initial comment. https://github.com/llvm/llvm-project/pull/89553 ___ cfe-commits mailing list

[clang] [clang-tools-extra] [llvm] Add ``ignoringParenImpCasts`` in arguments of hasArgument (PR #89553)

2024-05-15 Thread Julian Schmidt via cfe-commits
https://github.com/5chmidti edited https://github.com/llvm/llvm-project/pull/89553 ___ 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 crash due to assumed callee in min-max-use-initializer-list (PR #91992)

2024-05-15 Thread Julian Schmidt via cfe-commits
https://github.com/5chmidti closed https://github.com/llvm/llvm-project/pull/91992 ___ 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 crash due to assumed callee in min-max-use-initializer-list (PR #91992)

2024-05-15 Thread Julian Schmidt via cfe-commits
https://github.com/5chmidti edited https://github.com/llvm/llvm-project/pull/91992 ___ 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] replace comparison of begin and end iterators with range empty (PR #91994)

2024-05-15 Thread Julian Schmidt via cfe-commits
https://github.com/5chmidti closed https://github.com/llvm/llvm-project/pull/91994 ___ 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 crash in modernize-use-constraints (PR #92019)

2024-05-14 Thread Julian Schmidt via cfe-commits
https://github.com/5chmidti approved this pull request. https://github.com/llvm/llvm-project/pull/92019 ___ 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] replace comparison of begin and end iterators with range empty (PR #91994)

2024-05-13 Thread Julian Schmidt via cfe-commits
5chmidti wrote: (The commit was a bit older, where I still used the private email, fixed by recommitting with the public one) https://github.com/llvm/llvm-project/pull/91994 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang-tools-extra] [clang-tidy][NFC] replace comparison of begin and end iterators with range empty (PR #91994)

2024-05-13 Thread Julian Schmidt via cfe-commits
https://github.com/5chmidti updated https://github.com/llvm/llvm-project/pull/91994 >From a73f5a9cb3127893dd65ba2040634a5f9f6924b0 Mon Sep 17 00:00:00 2001 From: Julian Schmidt Date: Mon, 13 May 2024 18:53:25 +0200 Subject: [PATCH] [clang-tidy][NFC] replace comparison of begin and end

[clang-tools-extra] [clang-tidy][NFC] replace comparison of begin and end iterators with range empty (PR #91994)

2024-05-13 Thread Julian Schmidt via cfe-commits
https://github.com/5chmidti edited https://github.com/llvm/llvm-project/pull/91994 ___ 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] replace comparison of begin and end iterators with range empty (PR #91994)

2024-05-13 Thread Julian Schmidt via cfe-commits
https://github.com/5chmidti created https://github.com/llvm/llvm-project/pull/91994 Improves readability by changing comparisons of `*begin` and `*end` iterators into `.empty()` on their range. >From a2cf452b69c9a4ad173db34ed9098a76d65187da Mon Sep 17 00:00:00 2001 From: Julian Schmidt

[clang-tools-extra] [clang-tidy] fix crash due to assumed callee in min-max-use-initializer-list (PR #91992)

2024-05-13 Thread Julian Schmidt via cfe-commits
5chmidti wrote: I have a few small changes to `findArgs` that I have not committed, which would change the `if`'s to check the exact number of args that are expected, instead of `< 3` and `else` (+change from iterators to `getArg(n)`). Should I add them as well?

[clang-tools-extra] [clang-tidy] fix crash due to assumed callee in min-max-use-initializer-list (PR #91992)

2024-05-13 Thread Julian Schmidt via cfe-commits
5chmidti wrote: CC @sopyb I was already looking into it ^^ https://github.com/llvm/llvm-project/pull/91992 ___ 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 crash due to assumed callee in min-max-use-initializer-list (PR #91992)

2024-05-13 Thread Julian Schmidt via cfe-commits
https://github.com/5chmidti edited https://github.com/llvm/llvm-project/pull/91992 ___ 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 crash due to assumed callee in min-max-use-initializer-list (PR #91992)

2024-05-13 Thread Julian Schmidt via cfe-commits
https://github.com/5chmidti created https://github.com/llvm/llvm-project/pull/91992 Previously, the call to `findArgs` for a `CallExpr` inside of a `min` or `max` call would call `findArgs` before checking if the argument is a call to `min` or `max`, which is what `findArgs` is expecting. The

[clang-tools-extra] [clang-tidy] Add `bugprone-virtual-arithmetic` check (PR #91951)

2024-05-13 Thread Julian Schmidt via cfe-commits
https://github.com/5chmidti edited https://github.com/llvm/llvm-project/pull/91951 ___ 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 `bugprone-virtual-arithmetic` check (PR #91951)

2024-05-13 Thread Julian Schmidt via cfe-commits
https://github.com/5chmidti edited https://github.com/llvm/llvm-project/pull/91951 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy] Ignore `if consteval` in else-after-return (PR #91588)

2024-05-13 Thread Julian Schmidt via cfe-commits
https://github.com/5chmidti approved this pull request. https://github.com/llvm/llvm-project/pull/91588 ___ 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 `bugprone-virtual-arithmetic` check (PR #91951)

2024-05-13 Thread Julian Schmidt via cfe-commits
@@ -0,0 +1,30 @@ +//===--- VirtualArithmeticCheck.h - clang-tidy---*- C++ -*-===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier:

[clang-tools-extra] [clang-tidy] Add `bugprone-virtual-arithmetic` check (PR #91951)

2024-05-13 Thread Julian Schmidt via cfe-commits
@@ -0,0 +1,59 @@ +// RUN: %check_clang_tidy %s bugprone-virtual-arithmetic %t + +class Base { +public: + virtual ~Base() {} +}; + +class Derived : public Base {}; + +void operators() { + Base *b = new Derived[10]; + + b += 1; + // CHECK-MESSAGES: :[[@LINE-1]]:3: warning:

[clang-tools-extra] [clang-tidy] Add `bugprone-virtual-arithmetic` check (PR #91951)

2024-05-13 Thread Julian Schmidt via cfe-commits
@@ -0,0 +1,30 @@ +//===--- VirtualArithmeticCheck.h - clang-tidy---*- C++ -*-===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier:

[clang-tools-extra] [clang-tidy] Add `bugprone-virtual-arithmetic` check (PR #91951)

2024-05-13 Thread Julian Schmidt via cfe-commits
@@ -0,0 +1,49 @@ +//===--- VirtualArithmeticCheck.cpp - clang-tidy---===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier:

[clang-tools-extra] [clang-tidy] Add `bugprone-virtual-arithmetic` check (PR #91951)

2024-05-13 Thread Julian Schmidt via cfe-commits
@@ -0,0 +1,49 @@ +//===--- VirtualArithmeticCheck.cpp - clang-tidy---===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier:

[clang-tools-extra] [clang-tidy] Add `bugprone-virtual-arithmetic` check (PR #91951)

2024-05-13 Thread Julian Schmidt via cfe-commits
@@ -0,0 +1,50 @@ +.. title:: clang-tidy - bugprone-virtual-arithmetic + +bugprone-virtual-arithmetic +=== + +Warn if pointer arithmetic is performed on a class that declares a +virtual function. + +Pointer arithmetic on polymorphic objects where the

[clang-tools-extra] [clang-tidy] Add `bugprone-virtual-arithmetic` check (PR #91951)

2024-05-13 Thread Julian Schmidt via cfe-commits
https://github.com/5chmidti requested changes to this pull request. Needs some small changes before landing. It's a good check to have, thanks. https://github.com/llvm/llvm-project/pull/91951 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang-tools-extra] [clang-tidy] Add `bugprone-virtual-arithmetic` check (PR #91951)

2024-05-13 Thread Julian Schmidt via cfe-commits
https://github.com/5chmidti edited https://github.com/llvm/llvm-project/pull/91951 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [WIP][clang-tidy] Ignore `if consteval` in else-after-return (PR #91588)

2024-05-12 Thread Julian Schmidt via cfe-commits
@@ -0,0 +1,17 @@ +// RUN: %check_clang_tidy -std=c++20 %s readability-else-after-return %t 5chmidti wrote: While `consteval` was added in C++20, `if consteval` is a C++23 feature. Please use `-std=c++23`

[clang-tools-extra] [WIP][clang-tidy] Ignore `if consteval` in else-after-return (PR #91588)

2024-05-12 Thread Julian Schmidt via cfe-commits
https://github.com/5chmidti commented: Please add an entry to the release notes here: https://github.com/llvm/llvm-project/blob/502e77df1fc4aa859db6709e14e93af6207e4dc4/clang-tools-extra/docs/ReleaseNotes.rst?plain=1#L176 do note that the entries are sorted by their check names. Otherwise

[clang-tools-extra] [WIP][clang-tidy] Ignore `if consteval` in else-after-return (PR #91588)

2024-05-12 Thread Julian Schmidt via cfe-commits
https://github.com/5chmidti edited https://github.com/llvm/llvm-project/pull/91588 ___ 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 exclude headers from clang-tidy analysis (PR #91400)

2024-05-11 Thread Julian Schmidt via cfe-commits
https://github.com/5chmidti approved this pull request. https://github.com/llvm/llvm-project/pull/91400 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy] support expect no diagnosis test (PR #91293)

2024-05-10 Thread Julian Schmidt via cfe-commits
@@ -226,6 +236,10 @@ def run_clang_tidy(self): print("--") return clang_tidy_output +def check_no_diagnosis(self, clang_tidy_output): +if clang_tidy_output != "": +

[clang-tools-extra] [clang-tidy] use llvm::any_of refactor getAnalyzerCheckersAndPackages [NFC] (PR #91713)

2024-05-10 Thread Julian Schmidt via cfe-commits
https://github.com/5chmidti approved this pull request. https://github.com/llvm/llvm-project/pull/91713 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy] support expect no diagnosis test (PR #91293)

2024-05-10 Thread Julian Schmidt via cfe-commits
@@ -226,6 +236,10 @@ def run_clang_tidy(self): print("--") return clang_tidy_output +def check_no_diagnosis(self, clang_tidy_output): +if clang_tidy_output != "": +

[clang-tools-extra] [clang-tidy] Ignore unevaluated context in bugprone-optional-value-conversion (PR #90410)

2024-05-09 Thread Julian Schmidt via cfe-commits
https://github.com/5chmidti approved this pull request. https://github.com/llvm/llvm-project/pull/90410 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy] Ignore unevaluated context in bugprone-optional-value-conversion (PR #90410)

2024-05-09 Thread Julian Schmidt via cfe-commits
5chmidti wrote: > And in example that you provided there is no issue. Alright, at least not a bugrprone issue. And the argument for a readability issue (which is the direction I initially was going) would probably end in someone saying `we use this to diagnose compile errors earlier, not

[clang-tools-extra] Add option to exclude headers from clang-tidy analysis (PR #91400)

2024-05-09 Thread Julian Schmidt via cfe-commits
https://github.com/5chmidti edited https://github.com/llvm/llvm-project/pull/91400 ___ 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 exclude headers from clang-tidy analysis (PR #91400)

2024-05-09 Thread Julian Schmidt via cfe-commits
@@ -311,7 +311,12 @@ ClangTidyDiagnosticConsumer::ClangTidyDiagnosticConsumer( : Context(Ctx), ExternalDiagEngine(ExternalDiagEngine), RemoveIncompatibleErrors(RemoveIncompatibleErrors), GetFixesFromNotes(GetFixesFromNotes), -

[clang-tools-extra] [clang-tidy] support expect no diagnosis test (PR #91293)

2024-05-09 Thread Julian Schmidt via cfe-commits
@@ -226,6 +226,11 @@ def run_clang_tidy(self): print("--") return clang_tidy_output +def check_no_diagnosis(self, clang_tidy_output): +print(clang_tidy_output) +if

[clang-tools-extra] [clang-tidy] support expect no diagnosis test (PR #91293)

2024-05-09 Thread Julian Schmidt via cfe-commits
@@ -172,12 +173,11 @@ def get_prefixes(self): ) if not has_check_fix and not has_check_message and not has_check_note: -sys.exit( -"%s, %s or %s not found in the input" -% (self.fixes.prefix,

[clang-tools-extra] [clang-tidy] support expect no diagnosis test (PR #91293)

2024-05-09 Thread Julian Schmidt via cfe-commits
https://github.com/5chmidti approved this pull request. Overall LGTM, just two small nits. W.r.t flag or no flag: This seems to be so rarely used (judging from the single test file that needed modification), that not having the flag is fine IMO. A check writer doesn't have to know about this

[clang-tools-extra] [clang-tidy] support expect no diagnosis test (PR #91293)

2024-05-09 Thread Julian Schmidt via cfe-commits
https://github.com/5chmidti edited https://github.com/llvm/llvm-project/pull/91293 ___ 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 exclude headers from clang-tidy analysis (PR #91400)

2024-05-09 Thread Julian Schmidt via cfe-commits
@@ -311,7 +311,12 @@ ClangTidyDiagnosticConsumer::ClangTidyDiagnosticConsumer( : Context(Ctx), ExternalDiagEngine(ExternalDiagEngine), RemoveIncompatibleErrors(RemoveIncompatibleErrors), GetFixesFromNotes(GetFixesFromNotes), -

[clang-tools-extra] [NFC][clang-tidy]increase stability for bugprone-return-const-ref-from-parameter (PR #91160)

2024-05-06 Thread Julian Schmidt via cfe-commits
https://github.com/5chmidti approved this pull request. Is there something specific you hit (test-case)? Either way, it's good to check https://github.com/llvm/llvm-project/pull/91160 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang-tools-extra] [clang-tidy] new check misc-use-internal-linkage (PR #90830)

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

[clang-tools-extra] [clang-tidy] new check misc-use-internal-linkage (PR #90830)

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

[clang-tools-extra] [clang-tidy] new check misc-use-internal-linkage (PR #90830)

2024-05-05 Thread Julian Schmidt via cfe-commits
@@ -0,0 +1,79 @@ +//===--- UseInternalLinkageCheck.cpp - clang-tidy--===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier:

[clang-tools-extra] [clang-tidy] new check misc-use-internal-linkage (PR #90830)

2024-05-05 Thread Julian Schmidt via cfe-commits
https://github.com/5chmidti commented: Regarding unit build: `google-global-names-in-headers` is one of the checks that check file extensions:

[clang-tools-extra] [clang-tidy] new check misc-use-internal-linkage (PR #90830)

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

[clang-tools-extra] [clang-tidy] new check misc-use-internal-linkage (PR #90830)

2024-05-05 Thread Julian Schmidt via cfe-commits
@@ -0,0 +1,79 @@ +//===--- UseInternalLinkageCheck.cpp - clang-tidy--===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier:

[clang-tools-extra] [clang-tidy] new check misc-use-internal-linkage (PR #90830)

2024-05-05 Thread Julian Schmidt via cfe-commits
@@ -0,0 +1,79 @@ +//===--- UseInternalLinkageCheck.cpp - clang-tidy--===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier:

[clang-tools-extra] [clang-tidy][docs] Fix modernize-use-std-print docs (PR #91069)

2024-05-05 Thread Julian Schmidt via cfe-commits
https://github.com/5chmidti closed https://github.com/llvm/llvm-project/pull/91069 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy] fix false-positives for templates in `bugprone-return-const-ref-from-parameter` (PR #90273)

2024-05-05 Thread Julian Schmidt via cfe-commits
https://github.com/5chmidti closed https://github.com/llvm/llvm-project/pull/90273 ___ 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 modernize-use-std-print diagnostic (PR #91071)

2024-05-04 Thread Julian Schmidt via cfe-commits
https://github.com/5chmidti approved this pull request. LGTM, thanks https://github.com/llvm/llvm-project/pull/91071 ___ 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] Fix modernize-use-std-print docs (PR #91069)

2024-05-04 Thread Julian Schmidt via cfe-commits
https://github.com/5chmidti approved this pull request. LGTM, thanks https://github.com/llvm/llvm-project/pull/91069 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy] Add modernize-use-std-format check (PR #90397)

2024-05-03 Thread Julian Schmidt via cfe-commits
https://github.com/5chmidti edited https://github.com/llvm/llvm-project/pull/90397 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy] Add modernize-use-std-format check (PR #90397)

2024-05-03 Thread Julian Schmidt via cfe-commits
https://github.com/5chmidti approved this pull request. Just nits, otherwise LGTM! https://github.com/llvm/llvm-project/pull/90397 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy] Add modernize-use-std-format check (PR #90397)

2024-05-03 Thread Julian Schmidt via cfe-commits
@@ -0,0 +1,107 @@ +//===--- UseStdFormatCheck.cpp - clang-tidy ---===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier:

[clang-tools-extra] [clang-tidy] Add modernize-use-std-format check (PR #90397)

2024-05-03 Thread Julian Schmidt via cfe-commits
@@ -0,0 +1,84 @@ +.. title:: clang-tidy - modernize-use-std-format + +modernize-use-std-format + + +Converts calls to ``absl::StrFormat``, or other functions via +configuration options, to C++20's ``std::format``, or another function +via a configuration

[clang-tools-extra] [clang-tidy] Add modernize-use-std-format check (PR #90397)

2024-05-03 Thread Julian Schmidt via cfe-commits
5chmidti wrote: Should the check options use the simpler format? E.g. ``` CheckOptions: modernize-use-std-format.StrFormatLikeFunctions: 'unqualified_strprintf;::strprintf; mynamespace::strprintf2' ``` https://github.com/llvm/llvm-project/pull/90397

[clang-tools-extra] [clang-tidy] Add modernize-use-std-format check (PR #90397)

2024-05-03 Thread Julian Schmidt via cfe-commits
https://github.com/5chmidti edited https://github.com/llvm/llvm-project/pull/90397 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy] Add modernize-use-std-format check (PR #90397)

2024-05-03 Thread Julian Schmidt via cfe-commits
@@ -0,0 +1,107 @@ +//===--- UseStdFormatCheck.cpp - clang-tidy ---===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier:

[clang-tools-extra] [clangd] use existing functions for code locations in the scopify enum tweak (PR #88737)

2024-05-03 Thread Julian Schmidt via cfe-commits
https://github.com/5chmidti closed https://github.com/llvm/llvm-project/pull/88737 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clangd] use existing functions for code locations in the scopify enum tweak (PR #88737)

2024-05-03 Thread Julian Schmidt via cfe-commits
https://github.com/5chmidti edited https://github.com/llvm/llvm-project/pull/88737 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy] fix false-positives for templates in `bugprone-return-const-ref-from-parameter` (PR #90273)

2024-05-02 Thread Julian Schmidt via cfe-commits
https://github.com/5chmidti updated https://github.com/llvm/llvm-project/pull/90273 >From 9b5bf4e1d53b3a55f9290199aeccb02c20a1e2cc Mon Sep 17 00:00:00 2001 From: Julian Schmidt Date: Fri, 26 Apr 2024 22:49:38 +0200 Subject: [PATCH 1/2] [clang-tidy] fix false-positives for templates in

[clang-tools-extra] [clangd] Remove potential prefix from enum value names (PR #83412)

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

[clang-tools-extra] [clangd] Remove potential prefix from enum value names (PR #83412)

2024-05-01 Thread Julian Schmidt via cfe-commits
https://github.com/5chmidti commented: When the enumerators start with the enum name, but the names contain a `_` as a separator, then applying this tweak will result in `_`-prefixed enumerators. Can you please handle that case as well and remove the `_`? Otherwise, this looks good to me

[clang-tools-extra] [clang-tidy] Handle implicit casts in hicpp-signed-bitwise for IgnorePositiveIntegerLiterals (PR #90621)

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

[clang-tools-extra] [clang-tidy] Handle expr with side-effects in readability-static-accessed-through-instance (PR #90736)

2024-05-01 Thread Julian Schmidt via cfe-commits
@@ -380,3 +387,20 @@ namespace PR51861 { // CHECK-FIXES: {{^}}PR51861::Foo::getBar();{{$}} } } + +namespace PR75163 { 5chmidti wrote: Nit: `GH` instead of `PR`? https://github.com/llvm/llvm-project/pull/90736

[clang-tools-extra] [clang-tidy] Handle expr with side-effects in readability-static-accessed-through-instance (PR #90736)

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

[clang-tools-extra] [clang-tidy] Handle expr with side-effects in readability-static-accessed-through-instance (PR #90736)

2024-05-01 Thread Julian Schmidt via cfe-commits
https://github.com/5chmidti edited https://github.com/llvm/llvm-project/pull/90736 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy] Relax readability-const-return-type (PR #90560)

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

[clang-tools-extra] [clang-tidy] Ignore casts from void to void in bugprone-casting-through-void (PR #90566)

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

[clang-tools-extra] [clang-tidy] Ignore unevaluated context in bugprone-optional-value-conversion (PR #90410)

2024-05-01 Thread Julian Schmidt via cfe-commits
https://github.com/5chmidti commented: Do we maybe want to explicitly match `decltype`, `sizeof`, `static_cast` etc. instead of `typeLoc`? Because I don't think we would want to ignore https://godbolt.org/z/r3bK961do ```c++ #include constexpr std::optional foo() { return 42; } constexpr int

[clang] [clang-tools-extra] [llvm] Add ``ignoringParenImpCasts`` in arguments of hasArgument (PR #89553)

2024-05-01 Thread Julian Schmidt via cfe-commits
https://github.com/5chmidti edited https://github.com/llvm/llvm-project/pull/89553 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-tools-extra] [llvm] Add ``ignoringParenImpCasts`` in arguments of hasArgument (PR #89553)

2024-05-01 Thread Julian Schmidt via cfe-commits
@@ -164,26 +164,32 @@ TEST_P(ASTMatchersTest, AllOf) { "void g(int x) { struct T t; f(x, , 3, 4); }"; EXPECT_TRUE(matches( Program, callExpr(allOf(callee(functionDecl(hasName("f"))), - hasArgument(0,

[clang] [clang-tools-extra] [llvm] Add ``ignoringParenImpCasts`` in arguments of hasArgument (PR #89553)

2024-05-01 Thread Julian Schmidt via cfe-commits
@@ -44,9 +44,10 @@ void StringFindStartswithCheck::registerMatchers(MatchFinder *Finder) { callee(cxxMethodDecl(hasName("find")).bind("findfun")), on(hasType(StringType)), // ... with some search expression ... - hasArgument(0, expr().bind("needle")), +

[clang] [clang-tools-extra] [llvm] Add ``ignoringParenImpCasts`` in arguments of hasArgument (PR #89553)

2024-05-01 Thread Julian Schmidt via cfe-commits
@@ -97,11 +97,12 @@ AST_MATCHER_FUNCTION_P(StatementMatcher, isConstRefReturningMethodCall, hasCanonicalType(recordType(hasDeclaration(namedDecl( unless(matchers::matchesAnyListedName(ExcludedContainerTypes)); - return expr( -

[clang] [clang-tools-extra] [llvm] Add ``ignoringParenImpCasts`` in arguments of hasArgument (PR #89553)

2024-05-01 Thread Julian Schmidt via cfe-commits
@@ -46,20 +46,20 @@ void SlicingCheck::registerMatchers(MatchFinder *Finder) { isBaseInitializer(), withInitializer(equalsBoundNode("Call")); // Assignment slicing: "a = b;" and "a = std::move(b);" variants. - const auto SlicesObjectInAssignment = -

[clang] [clang-tools-extra] [llvm] Add ``ignoringParenImpCasts`` in arguments of hasArgument (PR #89553)

2024-05-01 Thread Julian Schmidt via cfe-commits
@@ -30,9 +30,9 @@ void UpgradeDurationConversionsCheck::registerMatchers(MatchFinder *Finder) { Finder->addMatcher( cxxOperatorCallExpr( argumentCountIs(2), - hasArgument( - 0, expr(hasType(cxxRecordDecl(hasName("::absl::Duration"),

[clang] [clang-tools-extra] [llvm] Add ``ignoringParenImpCasts`` in arguments of hasArgument (PR #89553)

2024-05-01 Thread Julian Schmidt via cfe-commits
@@ -82,8 +82,8 @@ void StringConstructorCheck::registerMatchers(MatchFinder *Finder) { Finder->addMatcher( cxxConstructExpr( hasDeclaration(cxxMethodDecl(hasName("basic_string"))), - hasArgument(0, hasType(qualType(isInteger(, -

[clang] [clang-tools-extra] [llvm] Add ``ignoringParenImpCasts`` in arguments of hasArgument (PR #89553)

2024-05-01 Thread Julian Schmidt via cfe-commits
@@ -102,8 +103,8 @@ void StringConstructorCheck::registerMatchers(MatchFinder *Finder) { cxxConstructExpr( hasDeclaration(cxxConstructorDecl(ofClass( cxxRecordDecl(hasAnyName(removeNamespaces(StringNames)), - hasArgument(0,

[clang] [clang-tools-extra] [llvm] Add ``ignoringParenImpCasts`` in arguments of hasArgument (PR #89553)

2024-05-01 Thread Julian Schmidt via cfe-commits
@@ -75,9 +76,10 @@ void UpgradeDurationConversionsCheck::registerMatchers(MatchFinder *Finder) { hasParent(functionTemplateDecl()), unless(hasTemplateArgument(0, refersToType(builtinType(,

[clang] [clang-tools-extra] [llvm] Add ``ignoringParenImpCasts`` in arguments of hasArgument (PR #89553)

2024-05-01 Thread Julian Schmidt via cfe-commits
5chmidti wrote: Please remove the formatting changes https://github.com/llvm/llvm-project/pull/89553 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-tools-extra] [llvm] Add ``ignoringParenImpCasts`` in arguments of hasArgument (PR #89553)

2024-05-01 Thread Julian Schmidt via cfe-commits
@@ -62,9 +63,9 @@ void UpgradeDurationConversionsCheck::registerMatchers(MatchFinder *Finder) { unless(hasTemplateArgument(0, refersToType(builtinType(, hasAnyName("::absl::operator*", "::absl::operator/"))),

[clang] [clang-tools-extra] [llvm] Add ``ignoringParenImpCasts`` in arguments of hasArgument (PR #89553)

2024-05-01 Thread Julian Schmidt via cfe-commits
@@ -22,9 +22,10 @@ void DurationDivisionCheck::registerMatchers(MatchFinder *Finder) { traverse(TK_AsIs, implicitCastExpr( hasSourceExpression(ignoringParenCasts( -

[clang] [clang-tools-extra] [llvm] Add ``ignoringParenImpCasts`` in arguments of hasArgument (PR #89553)

2024-05-01 Thread Julian Schmidt via cfe-commits
@@ -41,14 +41,17 @@ void StringLiteralWithEmbeddedNulCheck::registerMatchers(MatchFinder *Finder) { hasDeclaration(cxxMethodDecl(hasName("basic_string", // If present, the second argument is the alloc object which must not // be present

[clang] [clang-tools-extra] [llvm] Add ``ignoringParenImpCasts`` in arguments of hasArgument (PR #89553)

2024-05-01 Thread Julian Schmidt via cfe-commits
@@ -36,19 +36,21 @@ void DurationUnnecessaryConversionCheck::registerMatchers(MatchFinder *Finder) { // e.g. `absl::ToDoubleSeconds(dur)`. auto InverseFunctionMatcher = callExpr( callee(functionDecl(hasAnyName(FloatConversion, IntegerConversion))), -

[clang] [clang-tools-extra] [llvm] Add ``ignoringParenImpCasts`` in arguments of hasArgument (PR #89553)

2024-05-01 Thread Julian Schmidt via cfe-commits
@@ -98,16 +100,18 @@ void UpgradeDurationConversionsCheck::registerMatchers(MatchFinder *Finder) { // `absl::Hours(x)` // where `x` is not of a built-in type. Finder->addMatcher( - traverse(TK_AsIs, implicitCastExpr( -

[clang] [clang-tools-extra] [llvm] Add ``ignoringParenImpCasts`` in arguments of hasArgument (PR #89553)

2024-05-01 Thread Julian Schmidt via cfe-commits
@@ -74,7 +74,7 @@ RewriteRuleWith StringviewNullptrCheckImpl() { auto BasicStringViewConstructingFromNullExpr = cxxConstructExpr( HasBasicStringViewType, argumentCountIs(1), - hasAnyArgument(/* `hasArgument` would skip over parens */ anyOf( +

[clang] [clang-tools-extra] [llvm] Add ``ignoringParenImpCasts`` in arguments of hasArgument (PR #89553)

2024-05-01 Thread Julian Schmidt via cfe-commits
@@ -54,9 +54,10 @@ makeRewriteRule(ArrayRef StringLikeClassNames, hasParameter( 0, parmVarDecl(anyOf(hasType(StringType), hasType(CharStarType), hasType(CharType)), - on(hasType(StringType)), hasArgument(0,

[clang] [clang-tools-extra] [llvm] Add ``ignoringParenImpCasts`` in arguments of hasArgument (PR #89553)

2024-05-01 Thread Julian Schmidt via cfe-commits
@@ -49,7 +49,8 @@ void UpgradeDurationConversionsCheck::registerMatchers(MatchFinder *Finder) { hasParent(functionTemplateDecl()), unless(hasTemplateArgument(0, refersToType(builtinType(, hasAnyName("operator*=", "operator/="))),

[clang] [clang-tools-extra] [llvm] Add ``ignoringParenImpCasts`` in arguments of hasArgument (PR #89553)

2024-05-01 Thread Julian Schmidt via cfe-commits
@@ -62,9 +63,9 @@ void StringFindStartswithCheck::registerMatchers(MatchFinder *Finder) { callee(cxxMethodDecl(hasName("rfind")).bind("findfun")), on(hasType(StringType)), // ... with some search expression ... - hasArgument(0, expr().bind("needle")), +

  1   2   3   4   5   >