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

2024-10-31 Thread Julian Schmidt via cfe-commits
5chmidti wrote: > Do I understand correctly that this is a partial fix for > [clangd/clangd#1254](https://github.com/clangd/clangd/issues/1254) in that it > addresses the issue with overloaded operators in particular, but it still > leaves in place the limitation that a **single** expression s

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

2024-10-31 Thread Julian Schmidt via cfe-commits
https://github.com/5chmidti updated https://github.com/llvm/llvm-project/pull/81640 >From 0fc20dcd188510cebce43da06619729ed20884c1 Mon Sep 17 00:00:00 2001 From: Julian Schmidt Date: Tue, 13 Feb 2024 18:59:16 +0100 Subject: [PATCH 1/3] [clangd] fix extract-to-function for overloaded operators

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

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

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

2024-11-02 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] [clang-tidy] fix crash in altera-id-dependent-backward-branch (PR #113833)

2024-11-02 Thread Julian Schmidt via cfe-commits
https://github.com/5chmidti closed https://github.com/llvm/llvm-project/pull/113833 ___ 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 a check for signed and unsigned integers comparison (PR #113144)

2024-10-28 Thread Julian Schmidt via cfe-commits
@@ -0,0 +1,47 @@ +//===--- UseIntegerSignComparisonCheck.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 a check for signed and unsigned integers comparison (PR #113144)

2024-10-27 Thread Julian Schmidt via cfe-commits
5chmidti wrote: Please add tests where templates and macros are involved https://github.com/llvm/llvm-project/pull/113144 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/

[clang-tools-extra] [clang-tidy] Create a check for signed and unsigned integers comparison (PR #113144)

2024-10-27 Thread Julian Schmidt via cfe-commits
@@ -0,0 +1,165 @@ +//===--- UseIntegerSignComparisonCheck.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] Create a check for signed and unsigned integers comparison (PR #113144)

2024-10-27 Thread Julian Schmidt via cfe-commits
@@ -0,0 +1,165 @@ +//===--- UseIntegerSignComparisonCheck.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] Create a check for signed and unsigned integers comparison (PR #113144)

2024-10-27 Thread Julian Schmidt via cfe-commits
@@ -0,0 +1,165 @@ +//===--- UseIntegerSignComparisonCheck.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] Create a check for signed and unsigned integers comparison (PR #113144)

2024-10-27 Thread Julian Schmidt via cfe-commits
@@ -0,0 +1,165 @@ +//===--- UseIntegerSignComparisonCheck.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] Create a check for signed and unsigned integers comparison (PR #113144)

2024-10-27 Thread Julian Schmidt via cfe-commits
@@ -0,0 +1,165 @@ +//===--- UseIntegerSignComparisonCheck.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] Create a check for signed and unsigned integers comparison (PR #113144)

2024-10-27 Thread Julian Schmidt via cfe-commits
@@ -0,0 +1,26 @@ +set(LLVM_LINK_COMPONENTS +FrontendOpenMP +Support +) + +add_clang_library(clangTidyQtModule 5chmidti wrote: Please add `STATIC` at the end of this line. This was changed just a few days ago to be explicit https://github.com/llvm/llvm-p

[clang-tools-extra] [clang-tidy] Create a check for signed and unsigned integers comparison (PR #113144)

2024-10-27 Thread Julian Schmidt via cfe-commits
@@ -0,0 +1,165 @@ +//===--- UseIntegerSignComparisonCheck.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] Create a check for signed and unsigned integers comparison (PR #113144)

2024-10-27 Thread Julian Schmidt via cfe-commits
@@ -0,0 +1,165 @@ +//===--- UseIntegerSignComparisonCheck.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] Create a check for signed and unsigned integers comparison (PR #113144)

2024-10-27 Thread Julian Schmidt via cfe-commits
@@ -0,0 +1,47 @@ +//===--- UseIntegerSignComparisonCheck.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 a check for signed and unsigned integers comparison (PR #113144)

2024-10-27 Thread Julian Schmidt via cfe-commits
@@ -0,0 +1,165 @@ +//===--- UseIntegerSignComparisonCheck.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] Create a check for signed and unsigned integers comparison (PR #113144)

2024-10-27 Thread Julian Schmidt via cfe-commits
@@ -0,0 +1,165 @@ +//===--- UseIntegerSignComparisonCheck.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] Create a check for signed and unsigned integers comparison (PR #113144)

2024-10-27 Thread Julian Schmidt via cfe-commits
https://github.com/5chmidti edited https://github.com/llvm/llvm-project/pull/113144 ___ 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 a check for signed and unsigned integers comparison (PR #113144)

2024-10-27 Thread Julian Schmidt via cfe-commits
https://github.com/5chmidti requested changes to this pull request. This will be very nice to get in https://github.com/llvm/llvm-project/pull/113144 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinf

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

2024-10-27 Thread Julian Schmidt via cfe-commits
5chmidti wrote: > I do plan to work on improvements Great > would like to get this baseline checker in for now as a "scope of work" for > this PR Yep, what I meant as well > I don't mind documenting the improvement step > Do you have suggestions on where to document improvements? As sugges

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

2024-10-27 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-10-27 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] fix false positive for implicit conversion of comparison result in C23 (PR #113639)

2024-10-27 Thread Julian Schmidt via cfe-commits
https://github.com/5chmidti approved this pull request. https://github.com/llvm/llvm-project/pull/113639 ___ 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-10-27 Thread Julian Schmidt via cfe-commits
@@ -0,0 +1,35 @@ +//===--- IncorrectEnableSharedFromThisCheck.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-incorrect-enable-shared-from-this check (PR #102299)

2024-10-27 Thread Julian Schmidt via cfe-commits
https://github.com/5chmidti commented: After these, this should be good to go in my opinion. --- For updating the PR branch: The whole branch gets squashed when merged anyway. A merge reduces the chance for pushing already existing commits that changed during rebase, causing other people to

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

2024-10-27 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] Fix crash in modernize-use-designated-initializers check (PR #113688)

2024-10-27 Thread Julian Schmidt via cfe-commits
https://github.com/5chmidti approved this pull request. Either way is fine with me. https://github.com/llvm/llvm-project/pull/113688 ___ 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 for implicit conversion of comparison result in C23 (PR #113639)

2024-10-27 Thread Julian Schmidt via cfe-commits
@@ -298,6 +300,11 @@ void ImplicitBoolConversionCheck::registerMatchers(MatchFinder *Finder) { hasCastKind(CK_FloatingToBoolean), hasCastKind(CK_PointerToBoolean), hasCastKind(CK_MemberPointerToBoolean)

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

2024-10-27 Thread Julian Schmidt via cfe-commits
@@ -0,0 +1,85 @@ +//===- NondeterministicPointerIterationOrderCheck.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] [clang-tools-extra] RFC: [clang-tidy] [analyzer] Move nondeterministic pointer usage check to tidy (PR #110471)

2024-10-27 Thread Julian Schmidt via cfe-commits
@@ -0,0 +1,85 @@ +//===- NondeterministicPointerIterationOrderCheck.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] [clang-tools-extra] RFC: [clang-tidy] [analyzer] Move nondeterministic pointer usage check to tidy (PR #110471)

2024-10-27 Thread Julian Schmidt via cfe-commits
@@ -0,0 +1,37 @@ +//=== NondeterministicPointerIterationOrderCheck.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] [clang-tools-extra] RFC: [clang-tidy] [analyzer] Move nondeterministic pointer usage check to tidy (PR #110471)

2024-10-27 Thread Julian Schmidt via cfe-commits
https://github.com/5chmidti approved this pull request. > I'm happy to document future changes beyond this check, but would like to > keep this PR's scope limited to just porting the original CSA based check to > a tidy check as much as possible. +1 --- > Also, I've not yet completed a full

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

2024-10-27 Thread Julian Schmidt via cfe-commits
@@ -0,0 +1,35 @@ +.. title:: clang-tidy - bugprone-nondeterministic-pointer-iteration-order + +bugprone-nondeterministic-pointer-iteration-order += + +Finds nondeterministic usages of pointers in unordered containers. + +One canonica

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

2024-10-27 Thread Julian Schmidt via cfe-commits
https://github.com/5chmidti edited 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] [clang][Index] check `TemplateTypeParmTypeLoc::getDecl()` against `nullptr` in `TypeIndexer` and `CursorVisitor` (PR #89392)

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

[clang] [clang][Index] check `TemplateTypeParmTypeLoc::getDecl()` against `nullptr` in `TypeIndexer` and `CursorVisitor` (PR #89392)

2024-10-27 Thread Julian Schmidt via cfe-commits
5chmidti wrote: Fixed by https://github.com/llvm/llvm-project/commit/c7bfc41860a6abe5c92dc5afb47348b0c9e69963 https://github.com/llvm/llvm-project/pull/89392 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailma

[clang-tools-extra] [clang-tidy] fix crash in altera-id-dependent-backward-branch (PR #113833)

2024-10-27 Thread Julian Schmidt via cfe-commits
https://github.com/5chmidti created https://github.com/llvm/llvm-project/pull/113833 Add some checks for `nullptr` and change some `dyn_cast` to `dyn_cast_if_present` to avoid crashes. Fixes #55408 >From 99090f44fdfe049d7e01e469787ebb0039b965c4 Mon Sep 17 00:00:00 2001 From: Julian Schmidt D

[clang-tools-extra] [clang-tidy] fix crash in altera-id-dependent-backward-branch (PR #113833)

2024-10-27 Thread Julian Schmidt via cfe-commits
https://github.com/5chmidti updated https://github.com/llvm/llvm-project/pull/113833 >From 99090f44fdfe049d7e01e469787ebb0039b965c4 Mon Sep 17 00:00:00 2001 From: Julian Schmidt Date: Sun, 27 Oct 2024 20:47:21 +0100 Subject: [PATCH 1/2] [clang-tidy] fix crash in altera-id-dependent-backward-br

[clang-tools-extra] [clang-tidy] Add recursion protection in ExceptionSpecAnalyzer (PR #66810)

2024-10-27 Thread Julian Schmidt via cfe-commits
5chmidti wrote: There is a minimal repro in #111436 available https://github.com/llvm/llvm-project/pull/66810 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

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

2024-10-27 Thread Julian Schmidt via cfe-commits
https://github.com/5chmidti created https://github.com/llvm/llvm-project/pull/113837 Previously, the implementation used the printed type, which contains the macro arguments expanded (also deleting comments). Instead, this check can be more surgical and keep the actual written type as is, keepin

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

2024-10-27 Thread Julian Schmidt via cfe-commits
https://github.com/5chmidti edited 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] Create bugprone-incorrect-enable-shared-from-this check (PR #102299)

2024-10-28 Thread Julian Schmidt via cfe-commits
https://github.com/5chmidti commented: > next time I shouldn't rebase and just wait to fix the conflict on merge PRs that are quite outdated should, and those that have conflicts must be updated before the PR is merged. You can either rebase with upstream changes, or merge with upstream. Which

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

2024-10-28 Thread Julian Schmidt via cfe-commits
@@ -0,0 +1,35 @@ +//===--- IncorrectEnableSharedFromThisCheck.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-incorrect-enable-shared-from-this check (PR #102299)

2024-10-28 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] Fix false positive in bugprone-throw-keyword-missing (PR #115302)

2024-11-08 Thread Julian Schmidt via cfe-commits
https://github.com/5chmidti approved this pull request. LGTM --- I filed #115540 because I noticed how the `hasAncestor` matcher in the `unless` part means that we are excluding quite some cases. (unrelated to this PRI) https://github.com/llvm/llvm-project/pull/115302

[clang-tools-extra] [clang-tidy] Do not emit file path for anonymous enums in `readability-enum-initial-value` check (PR #112496)

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

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

2024-10-26 Thread Julian Schmidt via cfe-commits
https://github.com/5chmidti updated https://github.com/llvm/llvm-project/pull/81640 >From 1796e5d2c44bae890c13b2af3fc7e4ec36e716dd Mon Sep 17 00:00:00 2001 From: Julian Schmidt Date: Tue, 13 Feb 2024 18:59:16 +0100 Subject: [PATCH 1/3] [clangd] fix extract-to-function for overloaded operators

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

2024-10-26 Thread Julian Schmidt via cfe-commits
https://github.com/5chmidti commented: CC @HighCommander4 @kadircet Technically, Sam told me last EuroLLVM that he had some refactor of the `SelectionTree` that would resolve issues like this in the general case, but as it is unclear that those changes will get in someday/in the 'near' future

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

2024-10-26 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] [clangd] fix extract-to-function for overloaded operators (PR #81640)

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

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

2024-10-26 Thread Julian Schmidt via cfe-commits
https://github.com/5chmidti updated https://github.com/llvm/llvm-project/pull/81640 >From 1796e5d2c44bae890c13b2af3fc7e4ec36e716dd Mon Sep 17 00:00:00 2001 From: Julian Schmidt Date: Tue, 13 Feb 2024 18:59:16 +0100 Subject: [PATCH 1/3] [clangd] fix extract-to-function for overloaded operators

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

2024-11-13 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-13 Thread Julian Schmidt via cfe-commits
@@ -102,6 +102,209 @@ 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-13 Thread Julian Schmidt via cfe-commits
@@ -866,19 +866,16 @@ void RedundantExpressionCheck::registerMatchers(MatchFinder *Finder) { // Binary with equivalent operands, like (X != 2 && X != 2). Finder->addMatcher( traverse(TK_AsIs, - binaryOperator( - anyOf(isComparisonOpera

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

2024-11-13 Thread Julian Schmidt via cfe-commits
@@ -1,4 +1,5 @@ -// RUN: %clang_analyze_cc1 -analyzer-checker=core,alpha.core.IdenticalExpr -w -verify %s +// RUN: clang-tidy %s -checks="-*,misc-redundant-expression" -- 2>&1 | FileCheck %s --check-prefix=IDENTEXPR +// RUN: clang-tidy %s -checks="-*,bugprone-branch-clone" -- 2>

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

2024-11-13 Thread Julian Schmidt via cfe-commits
@@ -1238,6 +1235,59 @@ void RedundantExpressionCheck::check(const MatchFinder::MatchResult &Result) { if (const auto *BinOp = Result.Nodes.getNodeAs("binary")) { // If the expression's constants are macros, check whether they are // intentional. + +// +// Spe

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

2024-11-13 Thread Julian Schmidt via cfe-commits
@@ -102,6 +102,209 @@ 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-13 Thread Julian Schmidt via cfe-commits
@@ -32,9 +32,28 @@ If this is the intended behavior, then there is no reason to use a conditional statement; otherwise the issue can be solved by fixing the branch that is handled incorrectly. -The check also detects repeated branches in longer ``if/else if/else`` chains +The

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

2024-11-13 Thread Julian Schmidt via cfe-commits
5chmidti wrote: Thanks for changing these to be more understandable w.r.t. what has changed. Could you please do a follow-up PR that splits this file, so we have the diff that shows no capabilities were lost in this PR/commit, and then have the tests be where

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

2024-11-13 Thread Julian Schmidt via cfe-commits
@@ -32,9 +32,28 @@ If this is the intended behavior, then there is no reason to use a conditional statement; otherwise the issue can be solved by fixing the branch that is handled incorrectly. -The check also detects repeated branches in longer ``if/else if/else`` chains +The

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

2024-11-13 Thread Julian Schmidt via cfe-commits
https://github.com/5chmidti commented: > some guidance on if the additional "scaffolded" case should be kept in place > (to maintain clear differences from the original to new file in the git > diff), or split the file now or maybe in a future separate commit so the > differences are clear. I

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

2024-11-13 Thread Julian Schmidt via cfe-commits
@@ -814,6 +814,12 @@ Improvements Moved checkers ^^ +- The checker ``alpha.core.IdenticalExpr`` was removed because it was + duplicated in the clang-tidy checkers ``misc-redundant-expression`` and 5chmidti wrote: nit https://github.com/llvm/llvm

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

2024-11-13 Thread Julian Schmidt via cfe-commits
@@ -269,6 +472,23 @@ void BranchCloneCheck::check(const MatchFinder::MatchResult &Result) { return; } + if (const auto *IS = Result.Nodes.getNodeAs("ifWithDescendantIf")) { +const Stmt *Then = IS->getThen(); +if (const CompoundStmt *CS = dyn_cast(Then)) { +

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

2024-11-13 Thread Julian Schmidt via cfe-commits
https://github.com/5chmidti approved this pull request. LGTM in regard to my details. There are some emails that have their `@` escaped. Was that intended? https://github.com/llvm/llvm-project/pull/114544 ___ cfe-commits mailing list cfe-commits@lists

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

2024-11-13 Thread Julian Schmidt via cfe-commits
https://github.com/5chmidti approved this pull request. LGTM, 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-tools-extra] [clang-tidy] Improved readability redundant casting with enums (PR #111424)

2024-11-13 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: 5chmidti wrote: > > +- some people may want to control this behavior and keep the explicit cast > > for enums, WDYT? > > I can see why some people might wa

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

2024-10-31 Thread Julian Schmidt via cfe-commits
https://github.com/5chmidti edited https://github.com/llvm/llvm-project/pull/81640 ___ 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 a check for signed and unsigned integers comparison (PR #113144)

2024-10-31 Thread Julian Schmidt via cfe-commits
@@ -0,0 +1,192 @@ +//===--- UseIntegerSignComparisonCheck.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] Create a check for signed and unsigned integers comparison (PR #113144)

2024-10-31 Thread Julian Schmidt via cfe-commits
@@ -123,10 +123,16 @@ New checks Gives warnings for tagged unions, where the number of tags is different from the number of data members inside the union. +- New :doc:`modernize-use-integer-sign-comparison + ` check. + + Replace comparisons between signed and unsigned in

[clang-tools-extra] [clang-tidy] Create a check for signed and unsigned integers comparison (PR #113144)

2024-10-31 Thread Julian Schmidt via cfe-commits
@@ -0,0 +1,192 @@ +//===--- UseIntegerSignComparisonCheck.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] fix crash in altera-id-dependent-backward-branch (PR #113833)

2024-10-31 Thread Julian Schmidt via cfe-commits
https://github.com/5chmidti updated https://github.com/llvm/llvm-project/pull/113833 >From 99090f44fdfe049d7e01e469787ebb0039b965c4 Mon Sep 17 00:00:00 2001 From: Julian Schmidt Date: Sun, 27 Oct 2024 20:47:21 +0100 Subject: [PATCH 1/3] [clang-tidy] fix crash in altera-id-dependent-backward-br

[clang-tools-extra] [clang-tidy] Create a check for signed and unsigned integers comparison (PR #113144)

2024-10-31 Thread Julian Schmidt via cfe-commits
@@ -0,0 +1,165 @@ +//===--- UseIntegerSignComparisonCheck.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] Create a check for signed and unsigned integers comparison (PR #113144)

2024-10-31 Thread Julian Schmidt via cfe-commits
@@ -0,0 +1,165 @@ +//===--- UseIntegerSignComparisonCheck.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] Create a check for signed and unsigned integers comparison (PR #113144)

2024-10-31 Thread Julian Schmidt via cfe-commits
@@ -0,0 +1,192 @@ +//===--- UseIntegerSignComparisonCheck.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] Create a check for signed and unsigned integers comparison (PR #113144)

2024-10-31 Thread Julian Schmidt via cfe-commits
@@ -84,6 +84,7 @@ Name prefixDescription ``performance-`` Checks that target performance-related issues. ``portability-`` Checks that target portability-related issues that don't relate to any particular coding style. +``qt-``

[clang-tools-extra] [clang-tidy] Create a check for signed and unsigned integers comparison (PR #113144)

2024-10-31 Thread Julian Schmidt via cfe-commits
@@ -136,6 +142,16 @@ New check aliases :doc:`bugprone-sizeof-expression ` was added. +- New alias :doc:`qt-integer-sign-comparison + ` to + :doc:`modernize-use-integer-sign-comparison + ` check. + If C++17 is supported, the fix-it replaces integers comparisons to + ``

[clang-tools-extra] [clang-tidy] Create a check for signed and unsigned integers comparison (PR #113144)

2024-10-31 Thread Julian Schmidt via cfe-commits
@@ -0,0 +1,46 @@ +//===--- QtTidyModule.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 a check for signed and unsigned integers comparison (PR #113144)

2024-10-31 Thread Julian Schmidt via cfe-commits
@@ -0,0 +1,165 @@ +//===--- UseIntegerSignComparisonCheck.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] Create a check for signed and unsigned integers comparison (PR #113144)

2024-10-31 Thread Julian Schmidt via cfe-commits
@@ -0,0 +1,192 @@ +//===--- UseIntegerSignComparisonCheck.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] Create a check for signed and unsigned integers comparison (PR #113144)

2024-10-31 Thread Julian Schmidt via cfe-commits
@@ -0,0 +1,64 @@ +.. title:: clang-tidy - qt-integer-sign-comparison + +qt-integer-sign-comparison += + +The qt-integer-sign-comparison check is an alias, please see +:doc:`modernize-use-integer-sign-comparison <../modernize/use-integer-sign-comparison

[clang-tools-extra] [clang-tidy] Create a check for signed and unsigned integers comparison (PR #113144)

2024-10-31 Thread Julian Schmidt via cfe-commits
@@ -0,0 +1,165 @@ +//===--- UseIntegerSignComparisonCheck.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] Create a check for signed and unsigned integers comparison (PR #113144)

2024-10-31 Thread Julian Schmidt via cfe-commits
@@ -0,0 +1,43 @@ +.. title:: clang-tidy - modernize-use-integer-sign-comparison + +modernize-use-integer-sign-comparison += + +Replace comparisons between signed and unsigned integers with their safe +``std::cmp_*`` alternative. + +Examples of f

[clang-tools-extra] [clang-tidy] Create a check for signed and unsigned integers comparison (PR #113144)

2024-10-31 Thread Julian Schmidt via cfe-commits
@@ -0,0 +1,46 @@ +//===--- QtTidyModule.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 insertion location for function pointers in cppcoreguidelines-init-variables (PR #112091)

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

[clang-tools-extra] Add bugprone-undefined-sprintf-overlap (PR #114244)

2024-11-09 Thread Julian Schmidt via cfe-commits
@@ -0,0 +1,82 @@ +//===--- UndefinedSprintfOverlapCheck.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 bugprone-sizeof-expression when sizeof expression with template types (PR #115275)

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

[clang-tools-extra] Add bugprone-undefined-sprintf-overlap (PR #114244)

2024-11-09 Thread Julian Schmidt via cfe-commits
@@ -0,0 +1,82 @@ +//===--- UndefinedSprintfOverlapCheck.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 bugprone-sizeof-expression when sizeof expression with template types (PR #115275)

2024-11-09 Thread Julian Schmidt via cfe-commits
@@ -175,7 +175,8 @@ Changes in existing checks - Improved :doc:`bugprone-sizeof-expression ` check to find suspicious usages of ``sizeof()``, ``alignof()``, and ``offsetof()`` when adding or - subtracting from a pointer directly or when used to scale a numeric value. + su

[clang-tools-extra] Add bugprone-undefined-sprintf-overlap (PR #114244)

2024-11-09 Thread Julian Schmidt via cfe-commits
@@ -0,0 +1,82 @@ +//===--- UndefinedSprintfOverlapCheck.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 bugprone-undefined-sprintf-overlap (PR #114244)

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

[clang-tools-extra] Add bugprone-undefined-sprintf-overlap (PR #114244)

2024-11-09 Thread Julian Schmidt via cfe-commits
@@ -0,0 +1,36 @@ +//===--- UndefinedSprintfOverlapCheck.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] Add bugprone-undefined-sprintf-overlap (PR #114244)

2024-11-09 Thread Julian Schmidt via cfe-commits
@@ -0,0 +1,82 @@ +//===--- UndefinedSprintfOverlapCheck.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 bugprone-undefined-sprintf-overlap (PR #114244)

2024-11-09 Thread Julian Schmidt via cfe-commits
@@ -0,0 +1,23 @@ +.. title:: clang-tidy - bugprone-undefined-sprintf-overlap + +bugprone-undefined-sprintf-overlap +== + +Warns if any arguments to the ``sprintf`` family of functions overlap with the +first argument. 5chmidti wrote

[clang-tools-extra] Add bugprone-undefined-sprintf-overlap (PR #114244)

2024-11-09 Thread Julian Schmidt via cfe-commits
https://github.com/5chmidti requested changes to this pull request. There are some false-negatives that exist for this check: E.g., ```c++ // from tests char bufss[10][10][10]; sprintf(bufss[0][1], "%s", bufss[0][1]); ``` or `*( *(bufss + 0) + 1)`. Though these can border on requiring, e

[clang-tools-extra] Add bugprone-undefined-sprintf-overlap (PR #114244)

2024-11-09 Thread Julian Schmidt via cfe-commits
@@ -0,0 +1,82 @@ +//===--- UndefinedSprintfOverlapCheck.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 bugprone-undefined-sprintf-overlap (PR #114244)

2024-11-09 Thread Julian Schmidt via cfe-commits
@@ -0,0 +1,82 @@ +//===--- UndefinedSprintfOverlapCheck.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 bugprone-undefined-sprintf-overlap (PR #114244)

2024-11-09 Thread Julian Schmidt via cfe-commits
@@ -0,0 +1,82 @@ +//===--- UndefinedSprintfOverlapCheck.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] [clangd] fix extract-to-function for overloaded operators (PR #81640)

2024-11-10 Thread Julian Schmidt via cfe-commits
https://github.com/5chmidti updated https://github.com/llvm/llvm-project/pull/81640 >From 04687eb4fcc3cc424580c0a0df8044a8b17286f8 Mon Sep 17 00:00:00 2001 From: Julian Schmidt Date: Tue, 13 Feb 2024 18:59:16 +0100 Subject: [PATCH 1/4] [clangd] fix extract-to-function for overloaded operators

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

2024-11-10 Thread Julian Schmidt via cfe-commits
@@ -190,6 +190,14 @@ F (extracted();) }]] )cpp"; EXPECT_EQ(apply(CompoundFailInput), "unavailable"); + + ExtraArgs.push_back("-std=c++14"); + // FIXME: Expressions are currently not extracted + EXPECT_EQ(apply(R"cpp( +void sink(int); +

<    5   6   7   8   9   10   11   12   13   >