[clang-tools-extra] [tidy] add new check bugprone-return-const-ref-from-parameter (PR #89497)

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

[clang-tools-extra] Add ignoring paren imp casts in has any argument (PR #89509)

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

[clang-tools-extra] Extend support for specifying languages and version in add_new_check.py (PR #100129)

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

[clang-tools-extra] Create a new check to look for mis-use in calls that take iterators (PR #99917)

2024-07-26 Thread Julian Schmidt via cfe-commits
@@ -98,6 +98,12 @@ Improvements to clang-tidy New checks ^^ +- New :doc:`bugprone-incorrect-iterators + ` check. + + Detects calls to iterator algorithms where they are called with potentially + invalid arguments. 5chmidti wrote: `where they` -> `t

[clang-tools-extra] Create a new check to look for mis-use in calls that take iterators (PR #99917)

2024-07-26 Thread Julian Schmidt via cfe-commits
https://github.com/5chmidti commented: Some initial thoughts, and at first glance, this looks nice. Because we are early in the release cycle, there will be enough time to address the fixme's. (I haven't run the check against some code bases as I am not at my main machine for another week.) h

[clang-tools-extra] Create a new check to look for mis-use in calls that take iterators (PR #99917)

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

[clang-tools-extra] Create a new check to look for mis-use in calls that take iterators (PR #99917)

2024-07-26 Thread Julian Schmidt via cfe-commits
@@ -0,0 +1,122 @@ +.. title:: clang-tidy - bugprone-incorrect-iterators + +bugprone-incorrect-iterators + + +Detects calls to iterator algorithms where they are called with potentially +invalid arguments. + +Different ranges + + +Looks f

[clang-tools-extra] Create a new check to look for mis-use in calls that take iterators (PR #99917)

2024-07-26 Thread Julian Schmidt via cfe-commits
@@ -0,0 +1,122 @@ +.. title:: clang-tidy - bugprone-incorrect-iterators + +bugprone-incorrect-iterators + + +Detects calls to iterator algorithms where they are called with potentially +invalid arguments. + +Different ranges + + +Looks f

[clang-tools-extra] Create a new check to look for mis-use in calls that take iterators (PR #99917)

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

[clang-tools-extra] Create a new check to look for mis-use in calls that take iterators (PR #99917)

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

[clang-tools-extra] Create a new check to look for mis-use in calls that take iterators (PR #99917)

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

[clang-tools-extra] Create a new check to look for mis-use in calls that take iterators (PR #99917)

2024-07-26 Thread Julian Schmidt via cfe-commits
@@ -0,0 +1,122 @@ +.. title:: clang-tidy - bugprone-incorrect-iterators + +bugprone-incorrect-iterators + + +Detects calls to iterator algorithms where they are called with potentially +invalid arguments. + +Different ranges + + +Looks f

[clang-tools-extra] Create a new check to look for mis-use in calls that take iterators (PR #99917)

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

[clang-tools-extra] Create a new check to look for mis-use in calls that take iterators (PR #99917)

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

[clang-tools-extra] [clang-tidy] Only expand macros in modernize-use-std-format/print (PR #97911)

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

[clang-tools-extra] [clang-tidy] Only expand macros in modernize-use-std-format/print (PR #97911)

2024-07-26 Thread Julian Schmidt via cfe-commits
https://github.com/5chmidti commented: It'll be 1 week+ before I am back at my main machine to take a better look at the macro question. Maybe this can just be landed, without that distinction. https://github.com/llvm/llvm-project/pull/97911 ___ cfe-c

[clang-tools-extra] [clang-tidy] Only expand macros in modernize-use-std-format/print (PR #97911)

2024-07-26 Thread Julian Schmidt via cfe-commits
@@ -42,9 +42,9 @@ The check doesn't do a bad job, but it's not perfect. In particular: - At the point that the check runs, the AST contains a single ``StringLiteral`` for the format string where escapes have been expanded. - The check tries to put the escapes back, they ma

[clang-tools-extra] [clang-tidy] Only expand macros in modernize-use-std-format/print (PR #97911)

2024-07-28 Thread Julian Schmidt via cfe-commits
https://github.com/5chmidti approved this pull request. Looks good from my side https://github.com/llvm/llvm-project/pull/97911 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] Create a new check to look for mis-use in calls that take iterators (PR #99917)

2024-07-29 Thread Julian Schmidt via cfe-commits
5chmidti wrote: The `++` and `--` operators could be mis-used as well, similar to `+` and `-`. And there are some control statements with a single statement that has a compound statement around it, please remove those. Checking the log, it looks like the check works well. I know that TBB has

[clang-tools-extra] Create a new check to look for mis-use in calls that take iterators (PR #99917)

2024-07-29 Thread Julian Schmidt via cfe-commits
https://github.com/5chmidti approved this pull request. LGTM (- single statement compound statements), but wait for another review please https://github.com/llvm/llvm-project/pull/99917 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://l

[clang] [clang-tools-extra] [clang-tidy] Fix false in unnecessary-value-param inside templates (PR #98488)

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

[clang-tools-extra] Ensure functions are anchored in the global namespace (PR #99084)

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

[clang-tools-extra] [clang-tidy] Only expand macros in modernize-use-std-format/print (PR #97911)

2024-07-17 Thread Julian Schmidt via cfe-commits
@@ -230,6 +241,50 @@ FormatStringConverter::FormatStringConverter(ASTContext *ContextIn, finalizeFormatText(); } +std::optional +FormatStringConverter::formatStringContainsUnreplaceableMacro( 5chmidti wrote: > getting the macro name for the function call a

[clang-tools-extra] [clang-tidy] Only expand macros in modernize-use-std-format/print (PR #97911)

2024-07-17 Thread Julian Schmidt via cfe-commits
@@ -34,13 +41,10 @@ The check doesn't do a bad job, but it's not perfect. In particular: possible. - At the point that the check runs, the AST contains a single - ``StringLiteral`` for the format string and any macro expansion, token - pasting, adjacent string literal con

[clang-tools-extra] [clang-tidy] Only expand macros in modernize-use-std-format/print (PR #97911)

2024-07-17 Thread Julian Schmidt via cfe-commits
@@ -24,8 +24,15 @@ into: std::println(stderr, "The {} is {:3}", description, value); If the `ReplacementPrintFunction` or `ReplacementPrintlnFunction` options -are left, or assigned to their default values then this check is only -enabled with `-std=c++23` or later. +are lef

[clang-tools-extra] [clang-tidy][cppcoreguidelines-missing-std-forward] Do not warn when the parameter is used in a `static_cast`. (PR #99477)

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

[clang-tools-extra] [clang-tidy][cppcoreguidelines-missing-std-forward] Do not warn when the parameter is used in a `static_cast`. (PR #99477)

2024-07-18 Thread Julian Schmidt via cfe-commits
https://github.com/5chmidti commented: I agree that this should be off by default or the guidelines have to be amended if this is to be on by default. It sounds to me like the enforcement of the rule does not account for having a forwarding reference as a parameter and using it instead of for

[clang-tools-extra] [clang-tidy][cppcoreguidelines-missing-std-forward] Do not warn when the parameter is used in a `static_cast`. (PR #99477)

2024-07-18 Thread Julian Schmidt via cfe-commits
@@ -129,15 +129,19 @@ void MissingStdForwardCheck::registerMatchers(MatchFinder *Finder) { unless(anyOf(hasAncestor(typeLoc()), hasAncestor(expr(hasUnevaluatedContext()); + auto StaticCast = cxxStaticCastExpr( + hasSourceExpression(declRefEx

[clang-tools-extra] [clang-tidy][NFC] Fix gsl::not_null template parameter (PR #99472)

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

[clang-tools-extra] [clang-tidy][cppcoreguidelines-missing-std-forward] Do not warn when the parameter is used in a `static_cast`. (PR #99477)

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

[clang-tools-extra] [clang-tidy][cppcoreguidelines-missing-std-forward] Do not warn when the parameter is used in a `static_cast`. (PR #99477)

2024-07-20 Thread Julian Schmidt via cfe-commits
https://github.com/5chmidti commented: In your documentation, you say that this change allows for the use of a `static_cast` to use the parameter as an l-value reference. But your pr title and description sound like any reference category is allowed. I think only the l-value reference part is

[clang-tools-extra] [clang-tidy][cppcoreguidelines-missing-std-forward] Do not warn when the parameter is used in a `static_cast`. (PR #99477)

2024-07-20 Thread Julian Schmidt via cfe-commits
@@ -129,15 +129,19 @@ void MissingStdForwardCheck::registerMatchers(MatchFinder *Finder) { unless(anyOf(hasAncestor(typeLoc()), hasAncestor(expr(hasUnevaluatedContext()); + auto StaticCast = cxxStaticCastExpr( + hasSourceExpression(declRefEx

[clang-tools-extra] [clang-tidy] Add modernize-use-cpp-style-comments check (PR #99713)

2024-07-20 Thread Julian Schmidt via cfe-commits
@@ -172,6 +172,11 @@ New checks Detects variables and functions that can be marked as static or moved into an anonymous namespace to enforce internal linkage. +- New :doc:`modernize-use-cpp-style-comments 5chmidti wrote: Please sort this release note corr

[clang-tools-extra] [clang-tidy] Add new check bugprone-tagged-union-member-count (PR #89925)

2024-07-20 Thread Julian Schmidt via cfe-commits
=?utf-8?b?R8OhYm9yIFTDs3RodsOhcmk=?= , =?utf-8?b?R8OhYm9yIFTDs3RodsOhcmk=?= Message-ID: In-Reply-To: @@ -0,0 +1,182 @@ +//===--- TaggedUnionMemberCountCheck.cpp - clang-tidy -===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM E

[clang-tools-extra] [clang-tidy] Add new check bugprone-tagged-union-member-count (PR #89925)

2024-07-20 Thread Julian Schmidt via cfe-commits
___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy] Add new check bugprone-tagged-union-member-count (PR #89925)

2024-07-20 Thread Julian Schmidt via cfe-commits
___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy] Add new check bugprone-tagged-union-member-count (PR #89925)

2024-07-20 Thread Julian Schmidt via cfe-commits
=?utf-8?b?R8OhYm9yIFTDs3RodsOhcmk=?= , =?utf-8?b?R8OhYm9yIFTDs3RodsOhcmk=?= Message-ID: In-Reply-To: @@ -0,0 +1,182 @@ +//===--- TaggedUnionMemberCountCheck.cpp - clang-tidy -===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM E

[clang-tools-extra] [clang-tidy] Add new check bugprone-tagged-union-member-count (PR #89925)

2024-07-20 Thread Julian Schmidt via cfe-commits
=?utf-8?b?R8OhYm9yIFTDs3RodsOhcmk=?= , =?utf-8?b?R8OhYm9yIFTDs3RodsOhcmk=?= Message-ID: In-Reply-To: @@ -0,0 +1,182 @@ +//===--- TaggedUnionMemberCountCheck.cpp - clang-tidy -===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM E

[clang-tools-extra] [clang-tidy] Add new check bugprone-tagged-union-member-count (PR #89925)

2024-07-20 Thread Julian Schmidt via cfe-commits
=?utf-8?b?R8OhYm9yIFTDs3RodsOhcmk=?= , =?utf-8?b?R8OhYm9yIFTDs3RodsOhcmk=?= Message-ID: In-Reply-To: @@ -0,0 +1,182 @@ +//===--- TaggedUnionMemberCountCheck.cpp - clang-tidy -===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM E

[clang-tools-extra] [clang-tidy] Add new check bugprone-tagged-union-member-count (PR #89925)

2024-07-20 Thread Julian Schmidt via cfe-commits
___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy] Add new check bugprone-tagged-union-member-count (PR #89925)

2024-07-20 Thread Julian Schmidt via cfe-commits
___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy] Add new check bugprone-tagged-union-member-count (PR #89925)

2024-07-20 Thread Julian Schmidt via cfe-commits
=?utf-8?b?R8OhYm9yIFTDs3RodsOhcmk=?= , =?utf-8?b?R8OhYm9yIFTDs3RodsOhcmk=?= Message-ID: In-Reply-To: @@ -0,0 +1,182 @@ +//===--- TaggedUnionMemberCountCheck.cpp - clang-tidy -===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM E

[clang-tools-extra] [clang-tidy] Add new check bugprone-tagged-union-member-count (PR #89925)

2024-07-20 Thread Julian Schmidt via cfe-commits
___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy] Add new check bugprone-tagged-union-member-count (PR #89925)

2024-07-20 Thread Julian Schmidt via cfe-commits
=?utf-8?b?R8OhYm9yIFTDs3RodsOhcmk=?= , =?utf-8?b?R8OhYm9yIFTDs3RodsOhcmk=?= Message-ID: In-Reply-To: @@ -0,0 +1,182 @@ +//===--- TaggedUnionMemberCountCheck.cpp - clang-tidy -===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM E

[clang-tools-extra] [clang-tidy] Add new check bugprone-tagged-union-member-count (PR #89925)

2024-07-20 Thread Julian Schmidt via cfe-commits
=?utf-8?b?R8OhYm9yIFTDs3RodsOhcmk=?= , =?utf-8?b?R8OhYm9yIFTDs3RodsOhcmk=?= Message-ID: In-Reply-To: 5chmidti wrote: I'm not sure that we need to test `.m` and `.mm` files https://github.com/llvm/llvm-project/pull/89925 __

[clang-tools-extra] [clang-tidy] Add new check bugprone-tagged-union-member-count (PR #89925)

2024-07-20 Thread Julian Schmidt via cfe-commits
=?utf-8?b?R8OhYm9yIFTDs3RodsOhcmk=?= , =?utf-8?b?R8OhYm9yIFTDs3RodsOhcmk=?= Message-ID: In-Reply-To: @@ -0,0 +1,182 @@ +//===--- TaggedUnionMemberCountCheck.cpp - clang-tidy -===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM E

[clang-tools-extra] [clang-tidy] Add new check bugprone-tagged-union-member-count (PR #89925)

2024-07-20 Thread Julian Schmidt via cfe-commits
=?utf-8?b?R8OhYm9yIFTDs3RodsOhcmk=?= , =?utf-8?b?R8OhYm9yIFTDs3RodsOhcmk=?= Message-ID: In-Reply-To: @@ -0,0 +1,68 @@ +// RUN: %check_clang_tidy -std=c++98-or-later %s bugprone-tagged-union-member-count %t \ +// RUN: -config='{CheckOptions: { \ +// RUN: bugprone-tagged

[clang-tools-extra] [clang-tidy] Add new check bugprone-tagged-union-member-count (PR #89925)

2024-07-20 Thread Julian Schmidt via cfe-commits
=?utf-8?b?R8OhYm9yIFTDs3RodsOhcmk=?= , =?utf-8?b?R8OhYm9yIFTDs3RodsOhcmk=?= Message-ID: In-Reply-To: 5chmidti wrote: Please add testcases with a template that is not instantiated and the enum and union types are not template type parameters: ```c++ template

[clang-tools-extra] [clang-tidy] Add new check bugprone-tagged-union-member-count (PR #89925)

2024-07-20 Thread Julian Schmidt via cfe-commits
___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [run-clang-tidy.py] Refactor, add progress indicator, add type hints (PR #89490)

2024-07-21 Thread Julian Schmidt via cfe-commits
https://github.com/5chmidti approved this pull request. Stopping the execution is now graceful on my machine as well, thanks. https://github.com/llvm/llvm-project/pull/89490 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org

[clang-tools-extra] [clang-tidy] Ensure nullable variable is not accessed without validity test (PR #90173)

2024-04-26 Thread Julian Schmidt via cfe-commits
https://github.com/5chmidti approved this pull request. https://github.com/llvm/llvm-project/pull/90173 ___ 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-04-26 Thread Julian Schmidt via cfe-commits
https://github.com/5chmidti created https://github.com/llvm/llvm-project/pull/90273 In the AST for function templates, the return will be a DeclRefExpr, even if the return type differs from that of the returned variable. Protect against false-positives by constraining the canonical return type t

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

2024-04-26 Thread Julian Schmidt via cfe-commits
5chmidti wrote: @HerrCai0907 I was looking at false positives for templates regarding this check and ended up implementing the fix. https://github.com/llvm/llvm-project/pull/90273 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.

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

2024-04-26 Thread Julian Schmidt via cfe-commits
5chmidti wrote: The false positives that are fixed by implementing this fix are in lines: 98, 101, 110, 113. The other tests are for completeness. https://github.com/llvm/llvm-project/pull/90273 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

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

2024-04-26 Thread Julian Schmidt via cfe-commits
5chmidti wrote: Do we add `improvement` documentation for checks that landed in the same release cycle? https://github.com/llvm/llvm-project/pull/90273 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/list

[clang-tools-extra] [clang-tidy] fix false-negative for macros in `readability-math-missing-parentheses` (PR #90279)

2024-04-26 Thread Julian Schmidt via cfe-commits
https://github.com/5chmidti created https://github.com/llvm/llvm-project/pull/90279 When a binary operator is the last operand of a macro, the end location that is past the `BinaryOperator` will be inside the macro and therefore an invalid location to insert a `FixIt` into, which is why the chec

[clang-tools-extra] [clang-tidy] fix false-negative for macros in `readability-math-missing-parentheses` (PR #90279)

2024-04-26 Thread Julian Schmidt via cfe-commits
5chmidti wrote: CC @11happy (couldn't add you as a reviewer) https://github.com/llvm/llvm-project/pull/90279 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][test] add TestLanguage.def to specify all tested language versions (PR #94243)

2024-08-29 Thread Julian Schmidt via cfe-commits
https://github.com/5chmidti updated https://github.com/llvm/llvm-project/pull/94243 >From 1ef1bc0bfebca8ca114a57ea2d5016418e36446d Mon Sep 17 00:00:00 2001 From: Julian Schmidt Date: Sat, 1 Jun 2024 17:38:37 +0200 Subject: [PATCH 1/4] [clang][test] add TestLanguage.def to specify all tested la

[clang] [clang][test] add TestLanguage.def to specify all tested language versions (PR #94243)

2024-08-29 Thread Julian Schmidt via cfe-commits
https://github.com/5chmidti updated https://github.com/llvm/llvm-project/pull/94243 >From 1ef1bc0bfebca8ca114a57ea2d5016418e36446d Mon Sep 17 00:00:00 2001 From: Julian Schmidt Date: Sat, 1 Jun 2024 17:38:37 +0200 Subject: [PATCH 1/5] [clang][test] add TestLanguage.def to specify all tested la

[clang] [clang][test] add TestLanguage.def to specify all tested language versions (PR #94243)

2024-08-29 Thread Julian Schmidt via cfe-commits
https://github.com/5chmidti updated https://github.com/llvm/llvm-project/pull/94243 >From 1ef1bc0bfebca8ca114a57ea2d5016418e36446d Mon Sep 17 00:00:00 2001 From: Julian Schmidt Date: Sat, 1 Jun 2024 17:38:37 +0200 Subject: [PATCH 1/7] [clang][test] add TestLanguage.def to specify all tested la

[clang-tools-extra] [clang-tidy] Add user-defined functions to `bugprone-unsafe-functions` check (PR #106350)

2024-08-29 Thread Julian Schmidt via cfe-commits
https://github.com/5chmidti edited https://github.com/llvm/llvm-project/pull/106350 ___ 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 user-defined functions to `bugprone-unsafe-functions` check (PR #106350)

2024-08-29 Thread Julian Schmidt via cfe-commits
@@ -86,6 +123,22 @@ Options this option enables. Default is `true`. +.. option:: ReportDefaultFunctions + +When `true`, the check reports the default set of functions. +Default is `true`. + +.. option:: CustomNormalFunctions + +A comma-separated list of regul

[clang-tools-extra] [clang-tidy] Add user-defined functions to `bugprone-unsafe-functions` check (PR #106350)

2024-08-29 Thread Julian Schmidt via cfe-commits
@@ -186,16 +298,62 @@ void UnsafeFunctionsCheck::check(const MatchFinder::MatchResult &Result) { const auto *FuncDecl = cast(DeclRef->getDecl()); assert(DeclRef && FuncDecl && "No valid matched node in check()"); + // Only one of these are matched at a time. const aut

[clang-tools-extra] [clang-tidy] Add user-defined functions to `bugprone-unsafe-functions` check (PR #106350)

2024-08-29 Thread Julian Schmidt via cfe-commits
@@ -127,57 +139,157 @@ static bool isAnnexKAvailable(std::optional &CacheVar, Preprocessor *PP, return CacheVar.value(); } +static std::vector +ParseCheckedFunctions(StringRef Option, StringRef OptionName, 5chmidti wrote: nit: Function names start with low

[clang-tools-extra] [clang-tidy] Add user-defined functions to `bugprone-unsafe-functions` check (PR #106350)

2024-08-29 Thread Julian Schmidt via cfe-commits
https://github.com/5chmidti commented: Just some small things https://github.com/llvm/llvm-project/pull/106350 ___ 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 user-defined functions to `bugprone-unsafe-functions` check (PR #106350)

2024-08-29 Thread Julian Schmidt via cfe-commits
@@ -186,16 +298,62 @@ void UnsafeFunctionsCheck::check(const MatchFinder::MatchResult &Result) { const auto *FuncDecl = cast(DeclRef->getDecl()); assert(DeclRef && FuncDecl && "No valid matched node in check()"); + // Only one of these are matched at a time. const aut

[clang-tools-extra] [clang-tidy] Add user-defined functions to `bugprone-unsafe-functions` check (PR #106350)

2024-08-29 Thread Julian Schmidt via cfe-commits
@@ -127,57 +139,157 @@ static bool isAnnexKAvailable(std::optional &CacheVar, Preprocessor *PP, return CacheVar.value(); } +static std::vector +ParseCheckedFunctions(StringRef Option, StringRef OptionName, + ClangTidyContext *Context) { + std::vector F

[clang-tools-extra] Update clang tidy Contributing guide (PR #106672)

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

[clang-tools-extra] Update clang tidy Contributing guide (PR #106672)

2024-08-30 Thread Julian Schmidt via cfe-commits
https://github.com/5chmidti commented: Thanks for clearing things up in the docs https://github.com/llvm/llvm-project/pull/106672 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] Update clang tidy Contributing guide (PR #106672)

2024-08-30 Thread Julian Schmidt via cfe-commits
@@ -664,6 +679,17 @@ compiled against the version of clang-tidy that will be loading the plugin. The plugins can use threads, TLS, or any other facilities available to in-tree code which is accessible from the external headers. +Note that testing checks out of tree might invo

[clang-tools-extra] Update clang tidy Contributing guide (PR #106672)

2024-08-30 Thread Julian Schmidt via cfe-commits
@@ -336,13 +337,24 @@ a starting point for your test cases. A rough outline of the process looks like The quickest way to prototype your matcher is to use :program:`clang-query` to interactively build up your matcher. For complicated matchers, build up a matching expression

[clang-tools-extra] Update clang tidy Contributing guide (PR #106672)

2024-08-30 Thread Julian Schmidt via cfe-commits
@@ -690,8 +716,8 @@ warnings and errors. The script provides multiple configuration flags. that the file names are matched against. ``run-clang-tidy.py clang-tidy/.*Check\.cpp`` will only analyze clang-tidy checks. It may also be necessary to restrict the header files th

[clang-tools-extra] Add clang-tidy external examples (PR #106675)

2024-08-30 Thread Julian Schmidt via cfe-commits
https://github.com/5chmidti commented: Great idea to add this. Although, we should be careful to not end up with abandoned projects. I sampled three from the page in Clang, and they had their last activity at around ~10 years. At that point, API's have changed. Either way, adding external exam

[clang-tools-extra] Add clang-tidy external examples (PR #106675)

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

[clang-tools-extra] Add clang-tidy external examples (PR #106675)

2024-08-30 Thread Julian Schmidt via cfe-commits
@@ -0,0 +1,31 @@ +=== +External Clang-Tidy Examples +=== + +Introduction + + +This page provides examples of what people have done with clang-tidy that +might serve as useful guides (or starting points) to develop your own check

[clang-tools-extra] Update clang tidy Contributing guide (PR #106672)

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

[clang-tools-extra] Add clang-tidy external examples (PR #106675)

2024-08-30 Thread Julian Schmidt via cfe-commits
@@ -5,21 +5,22 @@ External Clang-Tidy Examples Introduction -This page provides examples of what people have done with clang-tidy that +This page provides examples of what people have done with `clang-tidy`` that might serve as useful guides (or starting points

[clang-tools-extra] Add clang-tidy external examples (PR #106675)

2024-08-30 Thread Julian Schmidt via cfe-commits
@@ -5,21 +5,22 @@ External Clang-Tidy Examples Introduction -This page provides examples of what people have done with clang-tidy that +This page provides examples of what people have done with `clang-tidy`` that 5chmidti wrote: unintended doub

[clang-tools-extra] [NFC][clang-tidy] reword diagnostic note in definitions-in-headers (PR #106862)

2024-08-31 Thread Julian Schmidt via cfe-commits
https://github.com/5chmidti updated https://github.com/llvm/llvm-project/pull/106862 >From 46704590d3a90518c7b58ce03ac29c3e65c26676 Mon Sep 17 00:00:00 2001 From: Julian Schmidt Date: Sat, 31 Aug 2024 18:44:37 +0200 Subject: [PATCH 1/3] [NFC][clang-tidy] reword diagnostic note in definitions-i

[clang-tools-extra] [NFC][clang-tidy] fix tests of deleted functions for missing-std-forward (PR #106861)

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

[clang-tools-extra] [NFC][clang-tidy] reword diagnostic note in definitions-in-headers (PR #106862)

2024-08-31 Thread Julian Schmidt via cfe-commits
https://github.com/5chmidti updated https://github.com/llvm/llvm-project/pull/106862 >From 46704590d3a90518c7b58ce03ac29c3e65c26676 Mon Sep 17 00:00:00 2001 From: Julian Schmidt Date: Sat, 31 Aug 2024 18:44:37 +0200 Subject: [PATCH 1/2] [NFC][clang-tidy] reword diagnostic note in definitions-i

[clang-tools-extra] [NFC][clang-tidy] reword diagnostic note in definitions-in-headers (PR #106862)

2024-08-31 Thread Julian Schmidt via cfe-commits
https://github.com/5chmidti created https://github.com/llvm/llvm-project/pull/106862 `make as inline` made little sense here, so I changed the `make` to `mark` and added `the definition` as well. >From 46704590d3a90518c7b58ce03ac29c3e65c26676 Mon Sep 17 00:00:00 2001 From: Julian Schmidt Date

[clang-tools-extra] [clang-tidy] Add type annotations to add_new_check.py, fix minor bug (PR #106801)

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

[clang-tools-extra] [clang-tidy] Suggest using reinterpret_cast in bugprone-casting-thro… (PR #106784)

2024-08-31 Thread Julian Schmidt via cfe-commits
https://github.com/5chmidti approved this pull request. https://github.com/llvm/llvm-project/pull/106784 ___ 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 type annotations to add_new_check.py, fix minor bug (PR #106801)

2024-08-31 Thread Julian Schmidt via cfe-commits
@@ -754,7 +765,7 @@ def main(): language_restrict = ( f"%(lang)s.{cpp_language_to_requirements.get(args.standard, 'CPlusPlus')}" ) -elif language in ["objc", "objc++"]: +else: # "objc" or "objc++" language_restrict = "%(lang)s.ObjC

[clang-tools-extra] [clang-tidy] fix nullptr dereference in bugprone-forwarding-reference (PR #106856)

2024-08-31 Thread Julian Schmidt via cfe-commits
https://github.com/5chmidti edited https://github.com/llvm/llvm-project/pull/106856 ___ 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 nullptr dereference in bugprone-forwarding-reference (PR #106856)

2024-08-31 Thread Julian Schmidt via cfe-commits
https://github.com/5chmidti created https://github.com/llvm/llvm-project/pull/106856 Previously, when checking if a `TemplateSpecializationType` is either `enable_if` or `enable_if_t`, the AST matcher would call `getTemplateName`, `getASTemplateDecl` and `getTemplatedDecl` in succession to check

[clang-tools-extra] [clang-tidy] Add type annotations to add_new_check.py, fix minor bug (PR #106801)

2024-08-31 Thread Julian Schmidt via cfe-commits
@@ -8,21 +8,19 @@ # # ===---===# -from __future__ import print_function -from __future__ import unicode_literals - import argparse import io import itertools import os import re import sys import textw

[clang-tools-extra] [clang-tidy] fix nullptr dereference in bugprone-forwarding-reference (PR #106856)

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

[clang-tools-extra] [NFC][clang-tidy] reword diagnostic note in definitions-in-headers (PR #106862)

2024-08-31 Thread Julian Schmidt via cfe-commits
5chmidti wrote: I don't think this would need a release note, but it is user-facing. WDYT? https://github.com/llvm/llvm-project/pull/106862 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-comm

[clang-tools-extra] [NFC][clang-tidy] fix tests of deleted functions for missing-std-forward (PR #106861)

2024-08-31 Thread Julian Schmidt via cfe-commits
https://github.com/5chmidti created https://github.com/llvm/llvm-project/pull/106861 Since #87832, unnamed identifiers are excluded from being diagnosed. As a result, the tests that were supposed to test that deleted functions are correctly ignored are ignored because of the unnamed identifiers

[clang] [clang][test] add TestLanguage.def to specify all tested language versions (PR #94243)

2024-07-12 Thread Julian Schmidt via cfe-commits
https://github.com/5chmidti updated https://github.com/llvm/llvm-project/pull/94243 >From e1a2f731a24840c4c922ead50393ad9ccf342d8c Mon Sep 17 00:00:00 2001 From: Julian Schmidt Date: Sat, 1 Jun 2024 17:38:37 +0200 Subject: [PATCH 1/3] [clang][test] add TestLanguage.def to specify all tested la

[clang] [clang][test] add TestLanguage.def to specify all tested language versions (PR #94243)

2024-07-12 Thread Julian Schmidt via cfe-commits
@@ -0,0 +1,39 @@ + +//===-- TestLanguage.def - Language Versions for Testing *- 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: A

[clang] [clang][test] add TestLanguage.def to specify all tested language versions (PR #94243)

2024-07-12 Thread Julian Schmidt via cfe-commits
@@ -0,0 +1,39 @@ + +//===-- TestLanguage.def - Language Versions for Testing *- 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: A

[clang] [clang][test] add TestLanguage.def to specify all tested language versions (PR #94243)

2024-07-12 Thread Julian Schmidt via cfe-commits
5chmidti wrote: rebased on trunk https://github.com/llvm/llvm-project/pull/94243 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

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

2024-07-14 Thread Julian Schmidt via cfe-commits
Paul =?utf-8?q?Heidekrüger?= , Paul =?utf-8?q?Heidekrüger?= , Paul =?utf-8?q?Heidekrüger?= , Paul =?utf-8?q?Heidekrüger?= , Paul =?utf-8?q?Heidekrüger?= , Paul =?utf-8?q?Heidekrüger?= , Paul =?utf-8?q?Heidekrüger?= , Paul =?utf-8?q?Heidekrüger?= , Paul =?utf-8?q?Heidekrüger?= , Paul =?utf-8?q?Heide

[clang-tools-extra] Allow unnecessary-value-param to match templated functions including lambdas with auto. (PR #97767)

2024-07-14 Thread Julian Schmidt via cfe-commits
https://github.com/5chmidti approved this pull request. https://github.com/llvm/llvm-project/pull/97767 ___ 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
https://github.com/5chmidti requested changes to this pull request. Thanks for looking into this. Because this is touching a lot of checks, there was bound to be some conversation about which matchers need the `ignoringParenImpCasts` and which don't. I think we should check that now instead of

[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
@@ -93,7 +94,8 @@ rewriteInverseTimeCall(const MatchFinder::MatchResult &Result, llvm::StringRef InverseFunction = getTimeInverseForScale(Scale); if (const auto *MaybeCallArg = selectFirst( "e", match(callExpr(callee(functionDecl(hasName(InverseFunction))), -

<    1   2   3   4   5   6   7   8   9   10   >