[clang-tools-extra] [clangd] fix extract-to-function for overloaded operators (PR #81640)

2024-11-10 Thread Julian Schmidt via cfe-commits
@@ -104,9 +104,12 @@ bool isRootStmt(const Node *N) { // Root statement cannot be partially selected. if (N->Selected == SelectionTree::Partial) return false; - // Only DeclStmt can be an unselected RootStmt since VarDecls claim the entire - // selection range in sel

[clang-tools-extra] [clang-tidy] support static analyzer checker configuration in `--verify-config` (PR #109523)

2024-09-21 Thread Julian Schmidt via cfe-commits
https://github.com/5chmidti created https://github.com/llvm/llvm-project/pull/109523 Previously the configuration options for the Clang Static Analyzer checkers were not recognized for the verification of the configuration with `--verify-config`. Add all available configuration options of CSA ch

[clang-tools-extra] [clang-tidy] modernize-use-nullptr matches "NULL" in templates (PR #109169)

2024-09-21 Thread Julian Schmidt via cfe-commits
https://github.com/5chmidti approved this pull request. https://github.com/llvm/llvm-project/pull/109169 ___ 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-09-26 Thread Julian Schmidt via cfe-commits
5chmidti wrote: @Sirraide because this is touching the unit test infra, I held of on merging so you could take another look once you were back. https://github.com/llvm/llvm-project/pull/94243 ___ cfe-commits mailing list cfe-commits@lists.llvm.org htt

[clang-tools-extra] [clang-tidy] Portability Template Virtual Member Function Check (PR #110099)

2024-09-26 Thread Julian Schmidt via cfe-commits
@@ -0,0 +1,48 @@ +//===--- TemplateVirtualMemberFunctionCheck.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] [clang-tidy] Portability Template Virtual Member Function Check (PR #110099)

2024-09-26 Thread Julian Schmidt via cfe-commits
@@ -0,0 +1,48 @@ +//===--- TemplateVirtualMemberFunctionCheck.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] [clang-tidy] Portability Template Virtual Member Function Check (PR #110099)

2024-09-26 Thread Julian Schmidt via cfe-commits
@@ -0,0 +1,48 @@ +//===--- TemplateVirtualMemberFunctionCheck.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] [clang-tidy] Fix smart pointers handling in bugprone-use-after-move (PR #94869)

2024-09-26 Thread Julian Schmidt via cfe-commits
https://github.com/5chmidti approved this pull request. LGTM minus the other comments https://github.com/llvm/llvm-project/pull/94869 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy][bugprone-posix-return] support integer literals as LHS (PR #109302)

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

[clang-tools-extra] [clang-tidy][bugprone-posix-return] support integer literals as LHS (PR #109302)

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

[clang-tools-extra] [clang-tidy] Portability Template Virtual Member Function Check (PR #110099)

2024-09-26 Thread Julian Schmidt via cfe-commits
https://github.com/5chmidti edited https://github.com/llvm/llvm-project/pull/110099 ___ 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 smart pointers handling in bugprone-use-after-move (PR #94869)

2024-09-26 Thread Julian Schmidt via cfe-commits
@@ -104,6 +104,11 @@ New check aliases Changes in existing checks ^^ +- Improved :doc:`bugprone-use-after-move + ` check to handle smart pointers + like any other objects allowing to detect more cases, previous behavior can + be restored by setting `

[clang-tools-extra] [clang-tidy] Portability Template Virtual Member Function Check (PR #110099)

2024-09-26 Thread Julian Schmidt via cfe-commits
@@ -0,0 +1,48 @@ +//===--- TemplateVirtualMemberFunctionCheck.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] [clang-tidy][bugprone-posix-return] support integer literals as LHS (PR #109302)

2024-09-26 Thread Julian Schmidt via cfe-commits
@@ -61,23 +67,26 @@ void PosixReturnCheck::check(const MatchFinder::MatchResult &Result) { if (const auto *LessThanZeroOp = Result.Nodes.getNodeAs("ltzop")) { SourceLocation OperatorLoc = LessThanZeroOp->getOperatorLoc(); +const char NewBinOp = +Les

[clang-tools-extra] [clang-tidy] Portability Template Virtual Member Function Check (PR #110099)

2024-09-26 Thread Julian Schmidt via cfe-commits
@@ -0,0 +1,48 @@ +//===--- TemplateVirtualMemberFunctionCheck.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] [clang-tidy] Fix smart pointers handling in bugprone-use-after-move (PR #94869)

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

[clang-tools-extra] [clang-tidy] Portability Template Virtual Member Function Check (PR #110099)

2024-09-26 Thread Julian Schmidt via cfe-commits
@@ -0,0 +1,48 @@ +//===--- TemplateVirtualMemberFunctionCheck.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] [clang-tidy] Portability Template Virtual Member Function Check (PR #110099)

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

[clang-tools-extra] [clang-tidy] Create bugprone-bit-cast-pointers check (PR #108083)

2024-09-26 Thread Julian Schmidt via cfe-commits
@@ -0,0 +1,45 @@ +//===--- BitCastPointersCheck.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] [clang-tidy] Create bugprone-bit-cast-pointers check (PR #108083)

2024-09-26 Thread Julian Schmidt via cfe-commits
@@ -0,0 +1,45 @@ +//===--- BitCastPointersCheck.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] [clang-tidy] Create bugprone-bit-cast-pointers check (PR #108083)

2024-09-26 Thread Julian Schmidt via cfe-commits
https://github.com/5chmidti commented: > It now comes to mind that we probably also want to check `memcpy(ptr, ptr)`, > which is equivalent to `bit_cast`. In that case I wonder if the check name > still holds or it should be named something else? Yeah, with the addition of `memcpy`, the `bit`

[clang-tools-extra] [clang-tidy] Create bugprone-bit-cast-pointers check (PR #108083)

2024-09-26 Thread Julian Schmidt via cfe-commits
@@ -0,0 +1,45 @@ +//===--- BitCastPointersCheck.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] [clang-tidy] Portability Template Virtual Member Function Check (PR #110099)

2024-09-26 Thread Julian Schmidt via cfe-commits
@@ -0,0 +1,36 @@ +//===--- TemplateVirtualMemberFunctionCheck.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: Apa

[clang-tools-extra] [clang-tidy] Create bugprone-bit-cast-pointers check (PR #108083)

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

[clang-tools-extra] [clang-tidy] Portability Template Virtual Member Function Check (PR #110099)

2024-09-26 Thread Julian Schmidt via cfe-commits
@@ -0,0 +1,45 @@ +//===--- TemplateVirtualMemberFunctionCheck.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] [clang-tidy] Portability Template Virtual Member Function Check (PR #110099)

2024-09-26 Thread Julian Schmidt via cfe-commits
https://github.com/5chmidti approved this pull request. LGTM, but let's keep this open for others to review as well https://github.com/llvm/llvm-project/pull/110099 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/

[clang] [clang][test] add testing for the AST matcher reference (PR #94248)

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

[clang] [clang][test] remove unused `run` overload in `BoundNodesCallback` (PR #105935)

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

[clang] [clang][test] add testing for the AST matcher reference (PR #94248)

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

[clang] [clang][NFC] Fix example code for memberPointerType() AST matcher (PR #109404)

2024-09-27 Thread Julian Schmidt via cfe-commits
5chmidti wrote: I have fixed this as part of the implementation of #94248 https://github.com/llvm/llvm-project/pull/109404 ___ 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-09-27 Thread Julian Schmidt via cfe-commits
https://github.com/5chmidti closed 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] [clang][test] remove unused `run` overload in `BoundNodesCallback` (PR #105935)

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

[clang] [clang][test] add testing for the AST matcher reference (PR #110258)

2024-09-27 Thread Julian Schmidt via cfe-commits
5chmidti wrote: The buildkite failure is unrelated https://github.com/llvm/llvm-project/pull/110258 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][test] add testing for the AST matcher reference (PR #110258)

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

[clang] [clang][test] add testing for the AST matcher reference (PR #110258)

2024-09-27 Thread Julian Schmidt via cfe-commits
5chmidti wrote: This is an attempt to reland this PR, which created buildbot failures because of the python version not supporting subscripted types, and because previously, the test generation script would try to compile the code with a `clang` from `PATH`. Removed the type-hints that didn't

[clang] [clang][test] remove unused `run` overload in `BoundNodesCallback` (PR #105935)

2024-09-27 Thread Julian Schmidt via cfe-commits
https://github.com/5chmidti updated https://github.com/llvm/llvm-project/pull/105935 >From 388be9e2448e1fd6796daa92c8c1d15cecc2dd72 Mon Sep 17 00:00:00 2001 From: Julian Schmidt Date: Sat, 1 Jun 2024 17:49:13 +0200 Subject: [PATCH] [clang][test] remove unused `run` overload in `BoundNodesCallb

[clang] [clang][test][NFC] fix for python version requirements (PR #110250)

2024-09-27 Thread Julian Schmidt via cfe-commits
https://github.com/5chmidti created https://github.com/llvm/llvm-project/pull/110250 Fix for the buildbot failure due to lower python versions not supporting some types to be subscripted. Tested with python3.8. >From ca9fbe036f3f0a57c9b64b77841b883807909d17 Mon Sep 17 00:00:00 2001 From: Julia

[clang] [clang][test][NFC] fix for python version requirements (PR #110250)

2024-09-27 Thread Julian Schmidt via cfe-commits
5chmidti wrote: Fix for 097ada2fcb607be09da94a0d11f627a3759a10de https://github.com/llvm/llvm-project/pull/110250 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][test][NFC] fix for python version requirements (PR #110250)

2024-09-27 Thread Julian Schmidt via cfe-commits
5chmidti wrote: I reverted the original commit and will open a new pr https://github.com/llvm/llvm-project/pull/110250 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][test][NFC] fix for python version requirements (PR #110250)

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

[clang] [clang][test] add testing for the AST matcher reference (PR #110258)

2024-09-27 Thread Julian Schmidt via cfe-commits
5chmidti wrote: Original PR: #94248 https://github.com/llvm/llvm-project/pull/110258 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Revert "[clang][test] add testing for the AST matcher reference" (PR #110354)

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

[clang-tools-extra] [clang-tidy][readability-container-contains] Extend to any class with contains (PR #107521)

2024-09-18 Thread Julian Schmidt via cfe-commits
https://github.com/5chmidti approved this pull request. https://github.com/llvm/llvm-project/pull/107521 ___ 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-09-18 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-09-18 Thread Julian Schmidt via cfe-commits
@@ -0,0 +1,30 @@ + +External Clang-Tidy Examples + + +Introduction + + +This page provides examples of what people have done with :program:`clang-tidy` that +might serve as useful guides (or starting points) to

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

2024-09-18 Thread Julian Schmidt via cfe-commits
https://github.com/5chmidti approved this pull request. 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] [clang-tidy] Add `std::span` to default `bugprone-dangling-handle.HandleClasses` (PR #107711)

2024-09-20 Thread Julian Schmidt via cfe-commits
https://github.com/5chmidti closed https://github.com/llvm/llvm-project/pull/107711 ___ 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 `std::span` to default `bugprone-dangling-handle.HandleClasses` (PR #107711)

2024-09-20 Thread Julian Schmidt via cfe-commits
https://github.com/5chmidti updated https://github.com/llvm/llvm-project/pull/107711 >From 8528404715b4ca6dec7e251548870aba0c64bb04 Mon Sep 17 00:00:00 2001 From: Afonso Faria Date: Sat, 7 Sep 2024 18:03:48 +0100 Subject: [PATCH 1/3] Add std::span to default bugprone-dangling-handle.HandleClas

[clang] [clang-tools-extra] [clang][NFC] Fix example code for memberPointerType() AST matcher (PR #109403)

2024-09-20 Thread Julian Schmidt via cfe-commits
Carlos =?utf-8?q?G=C3=A1lvez?= Message-ID: In-Reply-To: 5chmidti wrote: FYI this should be fixed by #94248 https://github.com/llvm/llvm-project/pull/109403 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailm

[clang-tools-extra] [clang-tidy][readability-container-contains] Use hasOperands when possible (PR #109178)

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

[clang-tools-extra] [clang-tidy] loop convert can handle lambda init capture (PR #109159)

2024-10-02 Thread Julian Schmidt via cfe-commits
@@ -980,3 +980,30 @@ namespace PR78381 { } } } + +namespace GH109083 { +void test() { + const int N = 6; + int Arr[N] = {1, 2, 3, 4, 5, 6}; + + for (int I = 0; I < N; ++I) { +auto V = [T = Arr[I]]() {}; + } + // CHECK-MESSAGES: :[[@LINE-3]]:3: warning: use range-

[clang-tools-extra] [clang-tidy] loop convert can handle lambda init capture (PR #109159)

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

[clang-tools-extra] [clang-tidy] loop convert can handle lambda init capture (PR #109159)

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

[clang-tools-extra] [clang-tidy] exclude CXXParenListInitExpr from RedundantCastingCheck (PR #109741)

2024-10-03 Thread Julian Schmidt via cfe-commits
5chmidti wrote: Actually, shouldn't this check instead change an explicit cast for a `CXXParenListExpr` from `static_cast(42)` to `C(42)`? Doing this would be fairly simple and there should not be any case that wouldn't support it FWICT. https://github.com/llvm/llvm-project/pull/109741 ___

[clang-tools-extra] [llvm] [clangd] Add CodeAction to swap operands to binary operators (PR #78999)

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

[clang-tools-extra] [clang-tidy] Create bugprone-bitwise-pointer-cast check (PR #108083)

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

[clang-tools-extra] [clang-tidy] Create bugprone-bitwise-pointer-cast check (PR #108083)

2024-10-03 Thread Julian Schmidt via cfe-commits
https://github.com/5chmidti approved this pull request. > Let me know there's anything else to fix or if we can merge. Maybe give it like a day if someone wants to chime in. https://github.com/llvm/llvm-project/pull/108083 ___ cfe-commits mailing list

[clang-tools-extra] [clang-tidy] Create bugprone-bitwise-pointer-cast check (PR #108083)

2024-10-03 Thread Julian Schmidt via cfe-commits
@@ -0,0 +1,44 @@ +//===--- BitwisePointerCastCheck.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] [clang-tidy] support static analyzer checker configuration in `--verify-config` (PR #109523)

2024-10-03 Thread Julian Schmidt via cfe-commits
https://github.com/5chmidti updated https://github.com/llvm/llvm-project/pull/109523 >From 8364d6def042734fe1efc1396646d160f3355a52 Mon Sep 17 00:00:00 2001 From: Julian Schmidt Date: Fri, 20 Sep 2024 01:52:31 +0200 Subject: [PATCH 1/2] [clang-tidy] support static analyzer checker configuratio

[clang-tools-extra] [clang-tidy] support `return c ? a : b;` in bugprone-return-const-ref-from-parameter (PR #107657)

2024-10-03 Thread Julian Schmidt via cfe-commits
https://github.com/5chmidti updated https://github.com/llvm/llvm-project/pull/107657 >From b00b02b3d92a88fcf7d688b39d52e74e59f76ecd Mon Sep 17 00:00:00 2001 From: Julian Schmidt Date: Sat, 7 Sep 2024 01:54:38 +0200 Subject: [PATCH] [clang-tidy] support `return c ? a : b;` in bugprone-return-co

[clang-tools-extra] [clang-tidy] support static analyzer checker configuration in `--verify-config` (PR #109523)

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

[clang-tools-extra] [clang-tidy] fix false positive use-internal-linkage for func decl without body (PR #117490)

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

[clang] [clang-tools-extra] [clang][analysis] refactor the unevaluated api (PR #117474)

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

[clang-tools-extra] [clang-tidy] Enhance modernize-use-starts-ends-with to handle substr patterns (PR #116033)

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

[clang-tools-extra] [clang-tidy] Enhance modernize-use-starts-ends-with to handle substr patterns (PR #116033)

2024-11-24 Thread Julian Schmidt via cfe-commits
@@ -240,6 +240,9 @@ void UseStartsEndsWithCheck::check(const MatchFinder::MatchResult &Result) { ReplacementFunction->getName()); // Replace arguments and everything after the function call. + if (FindExpr->getNumArgs() == 0) { +r

[clang-tools-extra] [clang-tidy] Enhance modernize-use-starts-ends-with to handle substr patterns (PR #116033)

2024-11-24 Thread Julian Schmidt via cfe-commits
@@ -183,40 +210,47 @@ void UseStartsEndsWithCheck::check(const MatchFinder::MatchResult &Result) { const auto *EndsWithFunction = Result.Nodes.getNodeAs("ends_with_fun"); assert(bool(StartsWithFunction) != bool(EndsWithFunction)); + const CXXMethodDecl *Replacemen

[clang] [clang-tools-extra] [analyzer] Remove alpha.core.IdenticalExpr Checker (PR #114715)

2024-11-24 Thread Julian Schmidt via cfe-commits
@@ -102,6 +102,210 @@ void BranchCloneCheck::registerMatchers(MatchFinder *Finder) { this); Finder->addMatcher(switchStmt().bind("switch"), this); Finder->addMatcher(conditionalOperator().bind("condOp"), this); + Finder->addMatcher(ifStmt(hasDescendant(ifStmt())).b

[clang] [clang-tools-extra] [analyzer] Remove alpha.core.IdenticalExpr Checker (PR #114715)

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

[clang] [clang-tools-extra] [analyzer] Remove alpha.core.IdenticalExpr Checker (PR #114715)

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

[clang-tools-extra] Rename CODE_OWNERS -> Maintainers (PR #114544)

2024-11-25 Thread Julian Schmidt via cfe-commits
5chmidti wrote: @PiotrZSL The ping was in case you want to be added as a maintainer to clang-tidy as well. I’m mentioning it just to make sure. https://github.com/llvm/llvm-project/pull/114544 ___ cfe-commits mailing list cfe-commits@lists.llvm.org ht

[clang-tools-extra] [clang-tidy] do not expand macros in modernize-use-using fix (PR #113837)

2024-11-25 Thread Julian Schmidt via cfe-commits
5chmidti wrote: Ping https://github.com/llvm/llvm-project/pull/113837 ___ 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 recursion protection in ExceptionSpecAnalyzer (PR #66810)

2024-11-24 Thread Julian Schmidt via cfe-commits
https://github.com/5chmidti commented: > Being totally unfamiliar with the code, I have a feeling that we shouldn't be > fixing in the analyze function. analyze has 1 single responsibility: wrap > `analyzeImpl` in order to add cacheability for performance reasons, it does > so simply and well,

[clang-tools-extra] [clang-tidy] Fix false positive in cppcoreguidelines-avoid-const-or-ref-data-members when detecting templated classes with inheritance (PR #115180)

2024-11-24 Thread Julian Schmidt via cfe-commits
https://github.com/5chmidti approved this pull request. https://github.com/llvm/llvm-project/pull/115180 ___ 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 consteval function in `ExceptionAnalyzer` (PR #116643)

2024-11-20 Thread Julian Schmidt via cfe-commits
@@ -320,6 +320,11 @@ bool isQualificationConvertiblePointer(QualType From, QualType To, } // namespace static bool canThrow(const FunctionDecl *Func) { + // consteval specifies every call to the function must produce a compile-time + // constant. compile-time constant canno

[clang] [clang-tools-extra] [clang-tidy][use-internal-linkage]fix false positives for global overloaded operator new and operator delete (PR #117945)

2024-11-28 Thread Julian Schmidt via cfe-commits
@@ -85,3 +85,13 @@ void func_with_body() {} void func_without_body(); void func_without_body(); } + +// gh117489 start +namespace std { +using size_t = decltype(sizeof(int)); +} +void * operator new(std::size_t); +void * operator new[](std::size_t); +void operator delete(void*)

[clang] [clang-tools-extra] [clang-tidy][use-internal-linkage]fix false positives for global overloaded operator new and operator delete (PR #117945)

2024-11-28 Thread Julian Schmidt via cfe-commits
@@ -43,7 +43,7 @@ void test(void) { } extern void g3(int); // expected-note{{previous declaration is here}} -static void g3(int x) { } // expected-error{{static declaration of 'g3' follows non-static declaration}} +static void g3(int x) { } // expected-error{{static declarati

[clang-tools-extra] [clang-tidy] ignore consteval function in `ExceptionAnalyzer` (PR #116643)

2024-11-20 Thread Julian Schmidt via cfe-commits
https://github.com/5chmidti approved this pull request. LGTM minus comment nits https://github.com/llvm/llvm-project/pull/116643 ___ 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 consteval function in `ExceptionAnalyzer` (PR #116643)

2024-11-20 Thread Julian Schmidt via cfe-commits
@@ -162,6 +162,10 @@ Changes in existing checks ` check to treat `std::span` as a handle class. +- Improved :doc:`bugprone-exception-escape + ` by fixing false positives + when consteval function with throw statements. 5chmidti wrote: `when encountering

[clang-tools-extra] [clang-tidy] ignore consteval function in `ExceptionAnalyzer` (PR #116643)

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

[clang-tools-extra] [clang-tidy] Improved readability redundant casting with enums (PR #111424)

2024-11-09 Thread Julian Schmidt via cfe-commits
=?utf-8?q?Félix-Antoine?= Constantin, =?utf-8?q?Félix-Antoine?= Constantin, =?utf-8?q?Félix-Antoine?= Constantin Message-ID: In-Reply-To: https://github.com/5chmidti approved this pull request. LGTM +- some people may want to control this behavior and keep the explicit cast for enums, WDYT?

[clang-tools-extra] [clang-tidy] Create bugprone-incorrect-enable-shared-from-this check (PR #102299)

2024-11-09 Thread Julian Schmidt via cfe-commits
https://github.com/5chmidti approved this pull request. Minus my comment, this looks good to me. Thanks for working on this. https://github.com/llvm/llvm-project/pull/102299 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org

[clang-tools-extra] [clang-tidy] Create bugprone-incorrect-enable-shared-from-this check (PR #102299)

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

[clang-tools-extra] [clang-tidy] Create bugprone-incorrect-enable-shared-from-this check (PR #102299)

2024-11-09 Thread Julian Schmidt via cfe-commits
@@ -0,0 +1,62 @@ +//===--- IncorrectEnableSharedFromThisCheck.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] [clang-tidy] Create bugprone-incorrect-enable-shared-from-this check (PR #102299)

2024-11-09 Thread Julian Schmidt via cfe-commits
@@ -0,0 +1,62 @@ +//===--- IncorrectEnableSharedFromThisCheck.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] Extend bugprone-use-after-move check to handle std::optional::reset() and std::any::reset() (PR #114255)

2024-11-09 Thread Julian Schmidt via cfe-commits
@@ -279,7 +281,7 @@ void UseAfterMoveFinder::getDeclRefs( if (DeclRef && BlockMap->blockContainingStmt(DeclRef) == Block) { // Ignore uses of a standard smart pointer that don't dereference the // pointer. - if (Operator || !isStandardSmartP

[clang-tools-extra] Extend bugprone-use-after-move check to handle std::optional::reset() and std::any::reset() (PR #114255)

2024-11-09 Thread Julian Schmidt via cfe-commits
@@ -196,10 +196,9 @@ Any occurrence of the moved variable that is not a reinitialization (see below) is considered to be a use. An exception to this are objects of type ``std::unique_ptr``, -``std::shared_ptr`` and ``std::weak_ptr``, which have defined move behavior -(objects

[clang] [clang-tools-extra] RFC: [clang-tidy] [analyzer] Move nondeterministic pointer usage check to tidy (PR #110471)

2024-11-09 Thread Julian Schmidt via cfe-commits
5chmidti wrote: FYI: #115620 & #115621 https://github.com/llvm/llvm-project/pull/110471 ___ 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 bugprone-sizeof-expression when sizeof expression with template types (PR #115275)

2024-11-09 Thread Julian Schmidt via cfe-commits
@@ -385,3 +385,8 @@ int ValidExpressions() { sum += sizeof(PtrArray) / sizeof(A[0]); return sum; } + +template +int ValidateTemplateTypeExpressions(T t) { + return sizeof(t.val) / sizeof(t.val[0]); +} 5chmidti wrote: Please note the issue somewhere on thi

[clang-tools-extra] [clang-tidy] Fix false positive in cppcoreguidelines-avoid-const-or-ref-data-members when detecting templated classes with inheritance (PR #115180)

2024-11-15 Thread Julian Schmidt via cfe-commits
@@ -13,79 +13,92 @@ using namespace clang::ast_matchers; namespace clang::tidy::cppcoreguidelines { -namespace { -AST_MATCHER(FieldDecl, isMemberOfLambda) { - return Node.getParent()->isLambda(); +static bool hasCopyConstructor(CXXRecordDecl const &Node) {

[clang-tools-extra] Extend bugprone-use-after-move check to handle std::optional::reset() and std::any::reset() (PR #114255)

2024-11-15 Thread Julian Schmidt via cfe-commits
5chmidti wrote: Thank you https://github.com/llvm/llvm-project/pull/114255 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy][modernize-use-starts-ends-with] Fix minor mistake in error message (PR #116132)

2024-11-15 Thread Julian Schmidt via cfe-commits
5chmidti wrote: Please also add a test for the case you're doing this for, i.e., one without `[!=]= 0`, so that these don't regress in the future https://github.com/llvm/llvm-project/pull/116132 ___ cfe-commits maili

[clang-tools-extra] [clang-tidy][modernize-use-starts-ends-with] Fix minor mistake in error message (PR #116132)

2024-11-15 Thread Julian Schmidt via cfe-commits
@@ -244,7 +244,7 @@ Changes in existing checks - Improved :doc:`modernize-use-starts-ends-with ` check to handle two cases - that can be replaced with ``ends_with`` + that can be replaced with ``ends_with``. Minor change to error message. 5chmidti wrote:

[clang-tools-extra] [clang-tidy] Fix false positive in cppcoreguidelines-avoid-const-or-ref-data-members when detecting templated classes with inheritance (PR #115180)

2024-11-15 Thread Julian Schmidt via cfe-commits
@@ -13,79 +13,92 @@ using namespace clang::ast_matchers; namespace clang::tidy::cppcoreguidelines { -namespace { -AST_MATCHER(FieldDecl, isMemberOfLambda) { - return Node.getParent()->isLambda(); +static bool hasCopyConstructor(CXXRecordDecl const &Node) { + if (Node.needs

[clang-tools-extra] [clang-tidy] Fix false positive in cppcoreguidelines-avoid-const-or-ref-data-members when detecting templated classes with inheritance (PR #115180)

2024-11-15 Thread Julian Schmidt via cfe-commits
@@ -195,6 +195,10 @@ Changes in existing checks fix false positive that floating point variable is only used in increment expression. +- Improved :doc:`cppcoreguidelines-avoid-const-or-ref-data-members + ` check to + avoid false positive when detecting templated class w

[clang-tools-extra] Extend bugprone-use-after-move check to handle std::optional::reset() and std::any::reset() (PR #114255)

2024-11-15 Thread Julian Schmidt via cfe-commits
5chmidti wrote: Hm, on mobile it wants to use my email as the commit email... I'll merge the PR later then. https://github.com/llvm/llvm-project/pull/114255 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman

[clang-tools-extra] Extend bugprone-use-after-move check to handle std::optional::reset() and std::any::reset() (PR #114255)

2024-11-15 Thread Julian Schmidt via cfe-commits
5chmidti wrote: > Thanks! Could we merge this? Yes, thanks https://github.com/llvm/llvm-project/pull/114255 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Reland: [clang][test] add testing for the AST matcher reference (PR #112168)

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

[clang] Reland: [clang][test] add testing for the AST matcher reference (PR #112168)

2024-11-15 Thread Julian Schmidt via cfe-commits
5chmidti wrote: > @5chmidti Sorry for the delay. I have tested this and it seems to compile on > windows msvc without any regressions. Thank you for checking that it works 👍 https://github.com/llvm/llvm-project/pull/112168 ___ cfe-commits mailing li

[clang-tools-extra] [clang-tidy] Filter out googletest TUs in bugprone-unchecked-optional-access (PR #115051)

2024-11-13 Thread Julian Schmidt via cfe-commits
https://github.com/5chmidti requested changes to this pull request. I don't think we can ignore a TU simply because it has the Google Test header included, which this will do. This would ignore real problems, such as ```c++ #include #include void issue(const absl::optional &opt) { if (!opt.

[clang-tools-extra] [clang-tidy][modernize-use-starts-ends-with] Fix operator rewriting false negative (PR #117837)

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

<    6   7   8   9   10   11   12   13   14   >