[clang] [clang-tools-extra] [clang-tidy] Add new check `modernize-use-designated-initializers` (PR #80541)

2024-02-12 Thread Julian Schmidt via cfe-commits
Danny =?utf-8?q?Mösch?= , Danny =?utf-8?q?Mösch?= , Danny =?utf-8?q?Mösch?= , Danny =?utf-8?q?Mösch?= , Danny =?utf-8?q?Mösch?= , Danny =?utf-8?q?Mösch?= , Danny =?utf-8?q?Mösch?= , Danny =?utf-8?q?Mösch?= , Danny =?utf-8?q?Mösch?= , Danny =?utf-8?q?Mösch?= , Danny =?utf-8?q?Mösch?= , Danny =?utf-8

[clang] [clang-tools-extra] [clang-tidy] Add new check `modernize-use-designated-initializers` (PR #80541)

2024-02-12 Thread Julian Schmidt via cfe-commits
Danny =?utf-8?q?Mösch?= , Danny =?utf-8?q?Mösch?= , Danny =?utf-8?q?Mösch?= , Danny =?utf-8?q?Mösch?= , Danny =?utf-8?q?Mösch?= , Danny =?utf-8?q?Mösch?= , Danny =?utf-8?q?Mösch?= , Danny =?utf-8?q?Mösch?= , Danny =?utf-8?q?Mösch?= , Danny =?utf-8?q?Mösch?= , Danny =?utf-8?q?Mösch?= , Danny =?utf-8

[clang] [clang-tools-extra] [clang-tidy] Add new check `modernize-use-designated-initializers` (PR #80541)

2024-02-12 Thread Julian Schmidt via cfe-commits
Danny =?utf-8?q?Mösch?= , Danny =?utf-8?q?Mösch?= , Danny =?utf-8?q?Mösch?= , Danny =?utf-8?q?Mösch?= , Danny =?utf-8?q?Mösch?= , Danny =?utf-8?q?Mösch?= , Danny =?utf-8?q?Mösch?= , Danny =?utf-8?q?Mösch?= , Danny =?utf-8?q?Mösch?= , Danny =?utf-8?q?Mösch?= , Danny =?utf-8?q?Mösch?= , Danny =?utf-8

[clang] [clang-tools-extra] [clang-tidy] Add new check `modernize-use-designated-initializers` (PR #80541)

2024-02-12 Thread Julian Schmidt via cfe-commits
Danny =?utf-8?q?Mösch?= , Danny =?utf-8?q?Mösch?= , Danny =?utf-8?q?Mösch?= , Danny =?utf-8?q?Mösch?= , Danny =?utf-8?q?Mösch?= , Danny =?utf-8?q?Mösch?= , Danny =?utf-8?q?Mösch?= , Danny =?utf-8?q?Mösch?= , Danny =?utf-8?q?Mösch?= , Danny =?utf-8?q?Mösch?= , Danny =?utf-8?q?Mösch?= , Danny =?utf-8

[clang-tools-extra] [clang-tidy] fix incorrect hint for InitListExpr in prefer-member-initializer (PR #81560)

2024-02-13 Thread Julian Schmidt via cfe-commits
https://github.com/5chmidti edited https://github.com/llvm/llvm-project/pull/81560 ___ 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 incorrect hint for InitListExpr in prefer-member-initializer (PR #81560)

2024-02-13 Thread Julian Schmidt via cfe-commits
https://github.com/5chmidti requested changes to this pull request. Just two nits. https://github.com/llvm/llvm-project/pull/81560 ___ 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 incorrect hint for InitListExpr in prefer-member-initializer (PR #81560)

2024-02-13 Thread Julian Schmidt via cfe-commits
@@ -616,3 +616,26 @@ class Foo { #undef INVALID_HANDLE_VALUE #undef RGB } + +namespace GH77684 { +struct S1 { +// CHECK-MESSAGES: :[[@LINE+1]]:16: warning: 'M' should be initialized in a member initializer of the constructor [cppcoreguidelines-prefer-member-initializer] + S1

[clang-tools-extra] [clang-tidy] fix incorrect hint for InitListExpr in prefer-member-initializer (PR #81560)

2024-02-13 Thread Julian Schmidt via cfe-commits
@@ -203,6 +203,7 @@ void PreferMemberInitializerCheck::check( SourceLocation InsertPos; SourceRange ReplaceRange; bool AddComma = false; +bool AddBracket = false; 5chmidti wrote: Brackets are `[]`, use brace (`{}`). https://github.com/llvm/llv

[clang-tools-extra] [clang-tidy] fix incorrect hint for InitListExpr in prefer-member-initializer (PR #81560)

2024-02-13 Thread Julian Schmidt via cfe-commits
https://github.com/5chmidti edited https://github.com/llvm/llvm-project/pull/81560 ___ 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 incorrect hint for InitListExpr in prefer-member-initializer (PR #81560)

2024-02-13 Thread Julian Schmidt via cfe-commits
@@ -216,6 +217,7 @@ void PreferMemberInitializerCheck::check( else { ReplaceRange = Init->getInit()->getSourceRange(); } +AddBracket = isa(Init->getInit()); 5chmidti wrote: This could be inside the else-branch right above, rig

[clang-tools-extra] [clang-tidy] fix incorrect hint for InitListExpr in prefer-member-initializer (PR #81560)

2024-02-13 Thread Julian Schmidt via cfe-commits
https://github.com/5chmidti commented: FYI: I have found a false-negative that is unrelated to this pr and issue, but my fix builds upon your pr. I filed an issue for it here #81613 and will post a pr once yours in merged, I don't want to make a stack just for that fix. https://github.com/llvm

[clang-tools-extra] [clang-tidy] fix incorrect hint for InitListExpr in prefer-member-initializer (PR #81560)

2024-02-13 Thread Julian Schmidt via cfe-commits
https://github.com/5chmidti edited https://github.com/llvm/llvm-project/pull/81560 ___ 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 incorrect hint for InitListExpr in prefer-member-initializer (PR #81560)

2024-02-13 Thread Julian Schmidt via cfe-commits
https://github.com/5chmidti edited https://github.com/llvm/llvm-project/pull/81560 ___ 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 incorrect hint for InitListExpr in prefer-member-initializer (PR #81560)

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

[clang-tools-extra] [clangd] Extract Function: add hoisting support (PR #75533)

2024-02-13 Thread Julian Schmidt via cfe-commits
5chmidti wrote: Ping https://github.com/llvm/llvm-project/pull/75533 ___ 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-02-13 Thread Julian Schmidt via cfe-commits
https://github.com/5chmidti created https://github.com/llvm/llvm-project/pull/81640 When selecting code that contains the use of overloaded operators, the SelectionTree will attribute the operator to the operator declaration, not to the `CXXOperatorCallExpr`. To allow extract-to-function to work

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

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

[clang-tools-extra] [clang-tidy] Add bugprone-suspicious-stringview-data-usage check (PR #83716)

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

[clang-tools-extra] [clang-tidy] Add bugprone-suspicious-stringview-data-usage check (PR #83716)

2024-03-06 Thread Julian Schmidt via cfe-commits
@@ -0,0 +1,100 @@ +//===--- SuspiciousStringviewDataUsageCheck.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] Add bugprone-suspicious-stringview-data-usage check (PR #83716)

2024-03-06 Thread Julian Schmidt via cfe-commits
@@ -0,0 +1,100 @@ +//===--- SuspiciousStringviewDataUsageCheck.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] Add bugprone-suspicious-stringview-data-usage check (PR #83716)

2024-03-06 Thread Julian Schmidt via cfe-commits
@@ -0,0 +1,100 @@ +//===--- SuspiciousStringviewDataUsageCheck.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] Add bugprone-suspicious-stringview-data-usage check (PR #83716)

2024-03-06 Thread Julian Schmidt via cfe-commits
https://github.com/5chmidti commented: Overall looks good https://github.com/llvm/llvm-project/pull/83716 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy] Fix handling --driver-mode= (PR #66553)

2024-03-06 Thread Julian Schmidt via cfe-commits
https://github.com/5chmidti commented: I don't know enough about the driver to approve this, but I read this a few times and I think that this is correct. I just added a few small and non-functional nits https://github.com/llvm/llvm-project/pull/66553 __

[clang-tools-extra] [clang-tidy] Fix handling --driver-mode= (PR #66553)

2024-03-06 Thread Julian Schmidt via cfe-commits
@@ -550,9 +555,91 @@ static llvm::IntrusiveRefCntPtr createBaseFS() { return BaseFS; } +static void recreateOptionsParserIfNeeded( +llvm::Expected &OptionsParser, +llvm::ArrayRef Args, +const ClangTidyOptions &EffectiveOptions) { + + auto DoubleDashIt = std::fi

[clang-tools-extra] [clang-tidy] Fix handling --driver-mode= (PR #66553)

2024-03-06 Thread Julian Schmidt via cfe-commits
@@ -550,9 +555,91 @@ static llvm::IntrusiveRefCntPtr createBaseFS() { return BaseFS; } +static void recreateOptionsParserIfNeeded( +llvm::Expected &OptionsParser, +llvm::ArrayRef Args, +const ClangTidyOptions &EffectiveOptions) { + + auto DoubleDashIt = std::fi

[clang-tools-extra] [clang-tidy] Fix handling --driver-mode= (PR #66553)

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

[clang-tools-extra] [clang-tidy] Fix handling --driver-mode= (PR #66553)

2024-03-06 Thread Julian Schmidt via cfe-commits
@@ -550,9 +555,91 @@ static llvm::IntrusiveRefCntPtr createBaseFS() { return BaseFS; } +static void recreateOptionsParserIfNeeded( +llvm::Expected &OptionsParser, +llvm::ArrayRef Args, +const ClangTidyOptions &EffectiveOptions) { + + auto DoubleDashIt = std::fi

[clang-tools-extra] [clang-tidy] Fix handling --driver-mode= (PR #66553)

2024-03-06 Thread Julian Schmidt via cfe-commits
@@ -550,9 +555,91 @@ static llvm::IntrusiveRefCntPtr createBaseFS() { return BaseFS; } +static void recreateOptionsParserIfNeeded( +llvm::Expected &OptionsParser, +llvm::ArrayRef Args, +const ClangTidyOptions &EffectiveOptions) { + + auto DoubleDashIt = std::fi

[clang-tools-extra] [clang-tidy] Fix handling --driver-mode= (PR #66553)

2024-03-06 Thread Julian Schmidt via cfe-commits
@@ -550,9 +555,91 @@ static llvm::IntrusiveRefCntPtr createBaseFS() { return BaseFS; } +static void recreateOptionsParserIfNeeded( +llvm::Expected &OptionsParser, +llvm::ArrayRef Args, +const ClangTidyOptions &EffectiveOptions) { + + auto DoubleDashIt = std::fi

[clang-tools-extra] [clang-tidy] bugprone-assert-side-effect can detect side effect from non-const reference parameters (PR #84095)

2024-03-06 Thread Julian Schmidt via cfe-commits
https://github.com/5chmidti approved this pull request. LGTM https://github.com/llvm/llvm-project/pull/84095 ___ 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-assert-side-effect can detect side effect from non-const reference parameters (PR #84095)

2024-03-06 Thread Julian Schmidt via cfe-commits
@@ -122,6 +122,10 @@ New check aliases Changes in existing checks ^^ +- Improved :doc:`bugprone-assert-side-effect + ` check by detection side 5chmidti wrote: `... detecting side effects from calling a method ...` https://github.com/

[clang-tools-extra] [clang-tidy] bugprone-assert-side-effect can detect side effect from non-const reference parameters (PR #84095)

2024-03-06 Thread Julian Schmidt via cfe-commits
https://github.com/5chmidti edited https://github.com/llvm/llvm-project/pull/84095 ___ 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-assert-side-effect can detect side effect from non-const reference parameters (PR #84095)

2024-03-06 Thread Julian Schmidt via cfe-commits
@@ -60,16 +60,27 @@ AST_MATCHER_P2(Expr, hasSideEffect, bool, CheckFunctionCalls, } if (const auto *CExpr = dyn_cast(E)) { -bool Result = CheckFunctionCalls; +if (!CheckFunctionCalls) + return false; if (const auto *FuncDecl = CExpr->getDirectCallee()) {

[clang-tools-extra] [clang-tidy] Add bugprone-suspicious-stringview-data-usage check (PR #83716)

2024-03-06 Thread Julian Schmidt via cfe-commits
@@ -0,0 +1,100 @@ +//===--- SuspiciousStringviewDataUsageCheck.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] Add bugprone-suspicious-stringview-data-usage check (PR #83716)

2024-03-06 Thread Julian Schmidt via cfe-commits
@@ -0,0 +1,100 @@ +//===--- SuspiciousStringviewDataUsageCheck.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]avoid bugprone-unused-return-value false positive for function with the same prefix as the default argument (PR #84333)

2024-03-07 Thread Julian Schmidt via cfe-commits
https://github.com/5chmidti approved this pull request. +1 on the docs https://github.com/llvm/llvm-project/pull/84333 ___ 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 support for lambdas in cppcoreguidelines-owning-memory (PR #77246)

2024-03-07 Thread Julian Schmidt via cfe-commits
https://github.com/5chmidti approved this pull request. LGTM https://github.com/llvm/llvm-project/pull/77246 ___ 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 support for lambdas in cppcoreguidelines-owning-memory (PR #77246)

2024-03-07 Thread Julian Schmidt via cfe-commits
5chmidti wrote: But wait for @HerrCai0907, you commented earlier as well. https://github.com/llvm/llvm-project/pull/77246 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy] Add bugprone-suspicious-stringview-data-usage check (PR #83716)

2024-03-07 Thread Julian Schmidt via cfe-commits
https://github.com/5chmidti approved this pull request. Found something unused, otherwise LGTM https://github.com/llvm/llvm-project/pull/83716 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-c

[clang-tools-extra] [clang-tidy] Add bugprone-suspicious-stringview-data-usage check (PR #83716)

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

[clang-tools-extra] [clang-tidy] Add bugprone-suspicious-stringview-data-usage check (PR #83716)

2024-03-07 Thread Julian Schmidt via cfe-commits
@@ -0,0 +1,101 @@ +//===--- SuspiciousStringviewDataUsageCheck.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]avoid bugprone-unused-return-value false positive for assignment operator overloading (PR #84489)

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

[clang-tools-extra] [clang-tidy]avoid bugprone-unused-return-value false positive for assignment operator overloading (PR #84489)

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

[clang-tools-extra] [clang-tidy]avoid bugprone-unused-return-value false positive for assignment operator overloading (PR #84489)

2024-03-08 Thread Julian Schmidt via cfe-commits
@@ -28,6 +30,11 @@ AST_MATCHER_P(FunctionDecl, isInstantiatedFrom, Matcher, return InnerMatcher.matches(InstantiatedFrom ? *InstantiatedFrom : Node, Finder, Builder); } + +AST_MATCHER_P(CXXMethodDecl, isOperatorOverloading, + llvm::

[clang-tools-extra] [clang-tidy]avoid bugprone-unused-return-value false positive for assignment operator overloading (PR #84489)

2024-03-08 Thread Julian Schmidt via cfe-commits
@@ -5,6 +5,8 @@ bugprone-unused-return-value Warns on unused function return values. The checked functions can be configured. +Operator overloading with assignment semantics are ignored。 5chmidti wrote: The dot at the end of this line is some character that

[clang-tools-extra] [clang-tidy]avoid bugprone-unused-return-value false positive for assignment operator overloading (PR #84489)

2024-03-08 Thread Julian Schmidt via cfe-commits
5chmidti wrote: *(Approval after fixes) https://github.com/llvm/llvm-project/pull/84489 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy] Let `bugprone-use-after-move` also handle calls to `std::forward` (PR #82673)

2024-02-23 Thread Julian Schmidt via cfe-commits
5chmidti wrote: I'd like to see the diagnostics say `forwarded` instead of `moved` (for all 4 possible diagnostics). `after it was potentially moved by forwarding` could work as well. Otherwise, the changes themselves look good https://github.com/llvm/llvm-project/pull/82673 _

[clang-tools-extra] [clang-tidy] Let `bugprone-use-after-move` also handle calls to `std::forward` (PR #82673)

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

[clang-tools-extra] [clang-tidy] Let `bugprone-use-after-move` also handle calls to `std::forward` (PR #82673)

2024-02-23 Thread Julian Schmidt via cfe-commits
@@ -359,24 +360,52 @@ void UseAfterMoveFinder::getReinits( } } +enum class MoveType { + Move,// std::move + Forward, // std::forward +}; + +static MoveType determineMoveType(const FunctionDecl *FuncDecl) { + if (FuncDecl->getName() == "move") +return MoveType::Mov

[clang-tools-extra] [clang-tidy] Let `bugprone-use-after-move` also handle calls to `std::forward` (PR #82673)

2024-02-23 Thread Julian Schmidt via cfe-commits
https://github.com/5chmidti commented: Please add a short explanation that `forward` is also checked in the check's docs here https://github.com/llvm/llvm-project/blob/main/clang-tools-extra/docs/clang-tidy/checks/bugprone/use-after-move.rst. https://github.com/llvm/llvm-project/pull/82673 ___

[clang-tools-extra] [clang-tidy] Let `bugprone-use-after-move` also handle calls to `std::forward` (PR #82673)

2024-02-23 Thread Julian Schmidt via cfe-commits
@@ -359,24 +360,52 @@ void UseAfterMoveFinder::getReinits( } } +enum class MoveType { + Move,// std::move + Forward, // std::forward +}; + +static MoveType determineMoveType(const FunctionDecl *FuncDecl) { + if (FuncDecl->getName() == "move") +return MoveType::Mov

[clang-tools-extra] [clang-tidy] Improve `google-explicit-constructor` checks handling of `explicit(bool)` (PR #82689)

2024-02-23 Thread Julian Schmidt via cfe-commits
@@ -130,18 +134,30 @@ void ExplicitConstructorCheck::check(const MatchFinder::MatchResult &Result) { return; } - if (Ctor->isExplicit() || Ctor->isCopyOrMoveConstructor() || + if (ExplicitSpec.isExplicit() || Ctor->isCopyOrMoveConstructor() || TakesInitializerL

[clang-tools-extra] [clang-tidy] Improve `google-explicit-constructor` checks handling of `explicit(bool)` (PR #82689)

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

[clang-tools-extra] [clang-tidy] Improve `google-explicit-constructor` checks handling of `explicit(bool)` (PR #82689)

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

[clang-tools-extra] [clangd] Extract Function: add hoisting support (PR #75533)

2024-02-24 Thread Julian Schmidt via cfe-commits
5chmidti wrote: Ping https://github.com/llvm/llvm-project/pull/75533 ___ 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-02-24 Thread Julian Schmidt via cfe-commits
5chmidti wrote: Ping 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] [clang] remove (clang::)ast_matchers:: namespace from AST matcher args for docs (PR #81437)

2024-02-24 Thread Julian Schmidt via cfe-commits
5chmidti wrote: Ping https://github.com/llvm/llvm-project/pull/81437 ___ 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 `cppcoreguidelines-missing-std-forward` false positive for deleted functions (PR #83055)

2024-02-26 Thread Julian Schmidt via cfe-commits
https://github.com/5chmidti edited https://github.com/llvm/llvm-project/pull/83055 ___ 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 `cppcoreguidelines-missing-std-forward` false positive for deleted functions (PR #83055)

2024-02-26 Thread Julian Schmidt via cfe-commits
https://github.com/5chmidti approved this pull request. https://github.com/llvm/llvm-project/pull/83055 ___ 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 `cppcoreguidelines-missing-std-forward` false positive for deleted functions (PR #83055)

2024-02-26 Thread Julian Schmidt via cfe-commits
@@ -134,6 +134,10 @@ Changes in existing checks ` check by ignoring local variable with ``[maybe_unused]`` attribute. +- Fixed :doc:`cppcoreguidelines-missing-std-forward + ` check giving false + positives for deleted functions. + 5chmidti wrote: Nit: I

[clang] [clang] remove (clang::)ast_matchers:: namespace from AST matcher args for docs (PR #81437)

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

[clang-tools-extra] [clang-tidy] Improve `google-explicit-constructor` checks handling of `explicit(bool)` (PR #82689)

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

[clang-tools-extra] [clang-tidy] Let `bugprone-use-after-move` also handle calls to `std::forward` (PR #82673)

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

[clang] [llvm] [clang-tools-extra] Add clang-tidy check to suggest replacement of conditional statement with std::min/std::max (PR #77816)

2024-02-04 Thread Julian Schmidt via cfe-commits
https://github.com/5chmidti approved this pull request. LGTM, just two small nits. https://github.com/llvm/llvm-project/pull/77816 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [llvm] [clang] Add clang-tidy check to suggest replacement of conditional statement with std::min/std::max (PR #77816)

2024-02-04 Thread Julian Schmidt via cfe-commits
@@ -0,0 +1,188 @@ +//===--- UseStdMinMaxCheck.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] [llvm] [clang] Add clang-tidy check to suggest replacement of conditional statement with std::min/std::max (PR #77816)

2024-02-04 Thread Julian Schmidt via cfe-commits
@@ -0,0 +1,188 @@ +//===--- UseStdMinMaxCheck.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] [llvm] Add clang-tidy check to suggest replacement of conditional statement with std::min/std::max (PR #77816)

2024-02-04 Thread Julian Schmidt via cfe-commits
https://github.com/5chmidti edited https://github.com/llvm/llvm-project/pull/77816 ___ 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 clang-tidy check to suggest replacement of conditional statement with std::min/std::max (PR #77816)

2024-02-04 Thread Julian Schmidt via cfe-commits
@@ -0,0 +1,188 @@ +//===--- UseStdMinMaxCheck.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] [clangd] update list of fast tidy checks (PR #69723)

2024-01-27 Thread Julian Schmidt via cfe-commits
5chmidti wrote: Given that the release branch for 18 was created, could the list be updated and backported, so that clangd-18 will contain the up-to-date fast-checks? https://github.com/llvm/llvm-project/pull/69723 ___ cfe-commits mailing list cfe-com

[clang-tools-extra] [clang-tidy] Add readability-redundant-casting check (PR #70595)

2024-01-11 Thread Julian Schmidt via cfe-commits
@@ -0,0 +1,242 @@ +//===--- RedundantCastingCheck.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] Add readability-redundant-casting check (PR #70595)

2024-01-11 Thread Julian Schmidt via cfe-commits
@@ -0,0 +1,242 @@ +//===--- RedundantCastingCheck.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] Add clang-tidy check to suggest replacement of conditional statement with std::min/std::max (PR #77816)

2024-01-11 Thread Julian Schmidt via cfe-commits
5chmidti wrote: LLVM uses `CamelCase` instead of `camelCase`. This is enforced by the top-level `.clang-tidy` file so you don't need to do this by hand, run clang-tidy and let it apply the fix-its on your file (clangd should provide these fixes as well, but currently only per var, not all at o

[clang-tools-extra] [clangd] Extract Function: add hoisting support (PR #75533)

2024-01-11 Thread Julian Schmidt via cfe-commits
https://github.com/5chmidti updated https://github.com/llvm/llvm-project/pull/75533 >From 4aa436ae184d7a0f1689800796c8dfde1e889a0e Mon Sep 17 00:00:00 2001 From: Julian Schmidt <44101708+5chmi...@users.noreply.github.com> Date: Sat, 21 Jan 2023 14:49:58 +0100 Subject: [PATCH 1/2] [clangd] Extrac

[clang] [clang][ASTMatcher] Add matchers for CXXFoldExpr (PR #71245)

2024-01-14 Thread Julian Schmidt via cfe-commits
https://github.com/5chmidti updated https://github.com/llvm/llvm-project/pull/71245 >From 3979b64361ee286fd71d0aba816047dc3dea319d Mon Sep 17 00:00:00 2001 From: Julian Schmidt <44101708+5chmi...@users.noreply.github.com> Date: Fri, 3 Nov 2023 21:51:57 +0100 Subject: [PATCH 1/5] [clang][ASTMatch

[clang] [clang][ASTMatcher] Add matchers for CXXFoldExpr (PR #71245)

2024-01-14 Thread Julian Schmidt via cfe-commits
5chmidti wrote: I updated the branch with GitHubs UI and will merge this in one or two days, to let the CI run against a recent base. https://github.com/llvm/llvm-project/pull/71245 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists

[clang] [clang][ASTMatcher] Add matchers for CXXFoldExpr (PR #71245)

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

[clang] [clang-tools-extra] [clang-tidy] fix misc-const-correctnes false-positive for fold expressions (PR #78320)

2024-01-16 Thread Julian Schmidt via cfe-commits
https://github.com/5chmidti created https://github.com/llvm/llvm-project/pull/78320 The check no longer emits a diagnostic for variables used as the initializer of C++17 fold expressions. The operator used is type-dependent because of the parameter pack and can therefore not be guaranteed to not

[clang] [clang][ASTMatcher] Add matchers for CXXFoldExpr (PR #71245)

2024-01-16 Thread Julian Schmidt via cfe-commits
5chmidti wrote: I have posted the mentioned fix for `ExprMutationAnalyzer`: #78320 https://github.com/llvm/llvm-project/pull/71245 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang] [clang-tidy] fix misc-const-correctnes false-positive for fold expressions (PR #78320)

2024-01-16 Thread Julian Schmidt via cfe-commits
https://github.com/5chmidti updated https://github.com/llvm/llvm-project/pull/78320 >From 1951630fd6a0edc5258f5a775c95b9e9c30106df Mon Sep 17 00:00:00 2001 From: Julian Schmidt <44101708+5chmi...@users.noreply.github.com> Date: Sat, 28 Oct 2023 18:39:18 +0200 Subject: [PATCH] [clang-tidy] fix mi

[clang] [clang-tools-extra] [clang-tidy] fix misc-const-correctnes false-positive for fold expressions (PR #78320)

2024-01-17 Thread Julian Schmidt via cfe-commits
https://github.com/5chmidti updated https://github.com/llvm/llvm-project/pull/78320 >From 1951630fd6a0edc5258f5a775c95b9e9c30106df Mon Sep 17 00:00:00 2001 From: Julian Schmidt <44101708+5chmi...@users.noreply.github.com> Date: Sat, 28 Oct 2023 18:39:18 +0200 Subject: [PATCH 1/3] [clang-tidy] fi

[clang] [clang-tools-extra] [clang-tidy] fix misc-const-correctnes false-positive for fold expressions (PR #78320)

2024-01-17 Thread Julian Schmidt via cfe-commits
5chmidti wrote: I fixed the clang-tidy test case by separating them and I have added a test case to check that using a variable in the pack side of the fold expression would be detected (that did not change with this patch though, just as a sanity check). https://github.com/llvm/llvm-project/

[clang-tools-extra] [clang] [clang-tidy] fix misc-const-correctnes false-positive for fold expressions (PR #78320)

2024-01-17 Thread Julian Schmidt via cfe-commits
@@ -382,7 +382,8 @@ Changes in existing checks using pointer to member function. Additionally, the check no longer emits a diagnostic when a variable that is not type-dependent is an operand of a type-dependent binary operator. Improved performance of the check through -

[clang-tools-extra] [clang] [clang-tidy] fix misc-const-correctnes false-positive for fold expressions (PR #78320)

2024-01-17 Thread Julian Schmidt via cfe-commits
https://github.com/5chmidti updated https://github.com/llvm/llvm-project/pull/78320 >From 1951630fd6a0edc5258f5a775c95b9e9c30106df Mon Sep 17 00:00:00 2001 From: Julian Schmidt <44101708+5chmi...@users.noreply.github.com> Date: Sat, 28 Oct 2023 18:39:18 +0200 Subject: [PATCH 1/4] [clang-tidy] fi

[clang-tools-extra] [clang] [clang-tidy] fix misc-const-correctnes false-positive for fold expressions (PR #78320)

2024-01-17 Thread Julian Schmidt via cfe-commits
@@ -382,7 +382,8 @@ Changes in existing checks using pointer to member function. Additionally, the check no longer emits a diagnostic when a variable that is not type-dependent is an operand of a type-dependent binary operator. Improved performance of the check through -

[clang-tools-extra] [llvm] [clang] Add clang-tidy check to suggest replacement of conditional statement with std::min/std::max (PR #77816)

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

[clang-tools-extra] [clang] [llvm] Add clang-tidy check to suggest replacement of conditional statement with std::min/std::max (PR #77816)

2024-01-18 Thread Julian Schmidt via cfe-commits
@@ -0,0 +1,132 @@ +//===--- UseStdMinMaxCheck.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

[llvm] [clang-tools-extra] [clang] Add clang-tidy check to suggest replacement of conditional statement with std::min/std::max (PR #77816)

2024-01-18 Thread Julian Schmidt via cfe-commits
@@ -0,0 +1,132 @@ +//===--- UseStdMinMaxCheck.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

[llvm] [clang-tools-extra] [clang] Add clang-tidy check to suggest replacement of conditional statement with std::min/std::max (PR #77816)

2024-01-18 Thread Julian Schmidt via cfe-commits
@@ -0,0 +1,132 @@ +//===--- UseStdMinMaxCheck.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

[llvm] [clang] [clang-tools-extra] Add clang-tidy check to suggest replacement of conditional statement with std::min/std::max (PR #77816)

2024-01-18 Thread Julian Schmidt via cfe-commits
@@ -0,0 +1,132 @@ +//===--- UseStdMinMaxCheck.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] [llvm] [clang-tools-extra] Add clang-tidy check to suggest replacement of conditional statement with std::min/std::max (PR #77816)

2024-01-18 Thread Julian Schmidt via cfe-commits
https://github.com/5chmidti commented: I found a few more nits, nothing with the implemented functionality itself https://github.com/llvm/llvm-project/pull/77816 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mai

[llvm] [clang-tools-extra] [clang] Add clang-tidy check to suggest replacement of conditional statement with std::min/std::max (PR #77816)

2024-01-18 Thread Julian Schmidt via cfe-commits
@@ -0,0 +1,132 @@ +//===--- UseStdMinMaxCheck.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] [llvm] Add clang-tidy check to suggest replacement of conditional statement with std::min/std::max (PR #77816)

2024-01-18 Thread Julian Schmidt via cfe-commits
@@ -0,0 +1,132 @@ +//===--- UseStdMinMaxCheck.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

[llvm] [clang-tools-extra] [clang] Add clang-tidy check to suggest replacement of conditional statement with std::min/std::max (PR #77816)

2024-01-18 Thread Julian Schmidt via cfe-commits
https://github.com/5chmidti edited https://github.com/llvm/llvm-project/pull/77816 ___ 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 readability-redundant-casting check (PR #70595)

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

[llvm] [clang-tools-extra] [clang] Add clang-tidy check to suggest replacement of conditional statement with std::min/std::max (PR #77816)

2024-01-19 Thread Julian Schmidt via cfe-commits
https://github.com/5chmidti requested changes to this pull request. I found some things that should be addressed. @PiotrZSL you had a comment about "improving readability and promoting the use of standard library functions." in `ReleaseNotes.rst`, I just want to mention that this sentence is a

[clang] [clang-tools-extra] [llvm] Add clang-tidy check to suggest replacement of conditional statement with std::min/std::max (PR #77816)

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

[clang-tools-extra] [llvm] [clang] Add clang-tidy check to suggest replacement of conditional statement with std::min/std::max (PR #77816)

2024-01-19 Thread Julian Schmidt via cfe-commits
@@ -0,0 +1,143 @@ +//===--- UseStdMinMaxCheck.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] [llvm] Add clang-tidy check to suggest replacement of conditional statement with std::min/std::max (PR #77816)

2024-01-19 Thread Julian Schmidt via cfe-commits
@@ -0,0 +1,143 @@ +//===--- UseStdMinMaxCheck.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] [llvm] [clang] Add clang-tidy check to suggest replacement of conditional statement with std::min/std::max (PR #77816)

2024-01-19 Thread Julian Schmidt via cfe-commits
@@ -0,0 +1,143 @@ +//===--- UseStdMinMaxCheck.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

[llvm] [clang-tools-extra] [clang] Add clang-tidy check to suggest replacement of conditional statement with std::min/std::max (PR #77816)

2024-01-19 Thread Julian Schmidt via cfe-commits
@@ -56,13 +56,16 @@ #include "UniqueptrDeleteReleaseCheck.h" #include "UppercaseLiteralSuffixCheck.h" #include "UseAnyOfAllOfCheck.h" +#include "UseStdMinMaxCheck.h" namespace clang::tidy { namespace readability { class ReadabilityModule : public ClangTidyModule { publi

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