https://github.com/RiverDave created
https://github.com/llvm/llvm-project/pull/128402
This PR aims to fix `performance-move-const-arg` #126515
## Changes
Enhanced the `performance-move-arg` check in Clang-Tidy to detect cases where
std::move is used
in **ternary expressions which was not bein
https://github.com/RiverDave edited
https://github.com/llvm/llvm-project/pull/128402
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/RiverDave edited
https://github.com/llvm/llvm-project/pull/128402
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
RiverDave wrote:
Thx @HerrCai0907, your feedback has been addresed.
https://github.com/llvm/llvm-project/pull/128402
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/RiverDave edited
https://github.com/llvm/llvm-project/pull/128402
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/RiverDave updated
https://github.com/llvm/llvm-project/pull/128402
>From 5eef2a52de7de53b0fb24781f40a7b02b55025b9 Mon Sep 17 00:00:00 2001
From: Riverdave
Date: Sat, 22 Feb 2025 03:57:35 -0500
Subject: [PATCH] [clang-tidy] Fix performance-move-const-arg false negative in
ter
@@ -44,6 +44,12 @@ void MoveConstArgCheck::registerMatchers(MatchFinder
*Finder) {
unless(isInTemplateInstantiation()))
.bind("call-move");
+ // Match ternary expressions where either branch contains std::move
+ auto TernaryWithMoveMatcher =
+
https://github.com/RiverDave edited
https://github.com/llvm/llvm-project/pull/128402
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
RiverDave wrote:
> lgtm. please run git-clang-format also. i think there are format issue in the
> new code.
Thx @HerrCai0907, your feedback has been addresed.
https://github.com/llvm/llvm-project/pull/128402
___
cfe-commits mailing list
cfe-commi
https://github.com/RiverDave updated
https://github.com/llvm/llvm-project/pull/128402
>From 5eef2a52de7de53b0fb24781f40a7b02b55025b9 Mon Sep 17 00:00:00 2001
From: Riverdave
Date: Sat, 22 Feb 2025 03:57:35 -0500
Subject: [PATCH] [clang-tidy] Fix performance-move-const-arg false negative in
ter
https://github.com/RiverDave updated
https://github.com/llvm/llvm-project/pull/128402
>From 848be2ccd25fd68b6a2d2037198184b08ff5d6e2 Mon Sep 17 00:00:00 2001
From: Riverdave
Date: Sat, 22 Feb 2025 03:57:35 -0500
Subject: [PATCH] [clang-tidy] Fix performance-move-const-arg false negative in
ter
https://github.com/RiverDave updated
https://github.com/llvm/llvm-project/pull/128402
>From 5eef2a52de7de53b0fb24781f40a7b02b55025b9 Mon Sep 17 00:00:00 2001
From: Riverdave
Date: Sat, 22 Feb 2025 03:57:35 -0500
Subject: [PATCH] [clang-tidy] Fix performance-move-const-arg false negative in
ter
https://github.com/RiverDave updated
https://github.com/llvm/llvm-project/pull/128402
>From f5e26951fb93db68ee51d79d6c84eb2194e3bf74 Mon Sep 17 00:00:00 2001
From: Riverdave
Date: Sat, 22 Feb 2025 03:57:35 -0500
Subject: [PATCH] [clang-tidy] Fix performance-move-const-arg false negative in
ter
https://github.com/RiverDave edited
https://github.com/llvm/llvm-project/pull/128402
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
RiverDave wrote:
> ⚠️ C/C++ code formatter, clang-format found issues in your code. ⚠️
>
> You can test this locally with the following command:
> ```shell
> git-clang-format --diff 5d501c6137976ff1f14f3b0e2e593fb9740d0146
> 848be2ccd25fd68b6a2d2037198184b08ff5d6e2 --extensions cpp --
> clang-
https://github.com/RiverDave created
https://github.com/llvm/llvm-project/pull/129370
This aims to address a portion of #122480 by adding matchers on binary
operators. **This allows explicit arithmetic operations within initializers.**
### Note
I'm aware of the other false-negatives presented
https://github.com/RiverDave edited
https://github.com/llvm/llvm-project/pull/129370
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/RiverDave edited
https://github.com/llvm/llvm-project/pull/129370
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/RiverDave updated
https://github.com/llvm/llvm-project/pull/129370
>From 68c371939323c9be13dba2e8e80ac4138859d845 Mon Sep 17 00:00:00 2001
From: David Rivera
Date: Sat, 1 Mar 2025 02:09:02 -0500
Subject: [PATCH] [clang-tidy] detect arithmetic operations within member list
in
https://github.com/RiverDave updated
https://github.com/llvm/llvm-project/pull/129370
>From 6dff411516cb4c0e807307fd36d15955e805d5c4 Mon Sep 17 00:00:00 2001
From: David Rivera
Date: Sat, 1 Mar 2025 02:09:02 -0500
Subject: [PATCH] [clang-tidy] detect arithmetic operations within member list
in
@@ -137,6 +137,10 @@ Changes in existing checks
` check by fixing false
negatives
on ternary operators calling ``std::move``.
+- Improved :doc:`modernize-use-default-member-init
RiverDave wrote:
Thx for pointing out, It's fixed now.
https://github.com/l
https://github.com/RiverDave updated
https://github.com/llvm/llvm-project/pull/129370
>From be9f035f738c8ea2771c9e79d4c22ff0fa82542e Mon Sep 17 00:00:00 2001
From: David Rivera
Date: Sat, 1 Mar 2025 02:09:02 -0500
Subject: [PATCH] [clang-tidy] detect arithmetic operations within member list
in
@@ -202,7 +208,13 @@ void
UseDefaultMemberInitCheck::registerMatchers(MatchFinder *Finder) {
unaryOperator(hasAnyOperatorName("+", "-"),
hasUnaryOperand(floatLiteral())),
cxxBoolLiteral(), cxxNullPtrLiteralExpr(), implicitValue
https://github.com/RiverDave edited
https://github.com/llvm/llvm-project/pull/129370
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/RiverDave updated
https://github.com/llvm/llvm-project/pull/129370
>From b46375a39104f967bdb3b6a9bd3214545a5965cf Mon Sep 17 00:00:00 2001
From: David Rivera
Date: Sat, 1 Mar 2025 02:09:02 -0500
Subject: [PATCH] [clang-tidy] detect arithmetic operations within member list
in
https://github.com/RiverDave edited
https://github.com/llvm/llvm-project/pull/129370
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/RiverDave edited
https://github.com/llvm/llvm-project/pull/129370
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/RiverDave updated
https://github.com/llvm/llvm-project/pull/129370
>From 39900908f047c2c067eea93855a5e6f644d13830 Mon Sep 17 00:00:00 2001
From: David Rivera
Date: Sat, 1 Mar 2025 02:09:02 -0500
Subject: [PATCH] [clang-tidy] detect arithmetic operations within member list
in
https://github.com/RiverDave deleted
https://github.com/llvm/llvm-project/pull/129370
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -202,7 +208,13 @@ void
UseDefaultMemberInitCheck::registerMatchers(MatchFinder *Finder) {
unaryOperator(hasAnyOperatorName("+", "-"),
hasUnaryOperand(floatLiteral())),
cxxBoolLiteral(), cxxNullPtrLiteralExpr(), implicitValue
https://github.com/RiverDave updated
https://github.com/llvm/llvm-project/pull/129370
>From e3c5641ee3a398d8fe12c0dcd030ee84667cc86e Mon Sep 17 00:00:00 2001
From: David Rivera
Date: Sat, 1 Mar 2025 02:09:02 -0500
Subject: [PATCH] [clang-tidy] detect arithmetic operations within member list
in
@@ -159,6 +159,12 @@ static bool sameValue(const Expr *E1, const Expr *E2) {
case Stmt::UnaryOperatorClass:
return sameValue(cast(E1)->getSubExpr(),
cast(E2)->getSubExpr());
+ case Stmt::BinaryOperatorClass: {
RiverDave wrote:
That'
https://github.com/RiverDave updated
https://github.com/llvm/llvm-project/pull/129370
>From 236cd9f21bd71b118a79356eb859dda31031bf80 Mon Sep 17 00:00:00 2001
From: David Rivera
Date: Sat, 1 Mar 2025 02:09:02 -0500
Subject: [PATCH] [clang-tidy] detect arithmetic operations within member list
in
https://github.com/RiverDave updated
https://github.com/llvm/llvm-project/pull/129370
>From 64cec5f09ff2a9b2cb3811d52c66fabae90887be Mon Sep 17 00:00:00 2001
From: David Rivera
Date: Sat, 1 Mar 2025 02:09:02 -0500
Subject: [PATCH] [clang-tidy] detect arithmetic operations within member list
in
RiverDave wrote:
Ping
https://github.com/llvm/llvm-project/pull/129425
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/RiverDave edited
https://github.com/llvm/llvm-project/pull/129370
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/RiverDave updated
https://github.com/llvm/llvm-project/pull/129425
>From 4f25319a076bddd11de886dbb35693cbfd2a3a73 Mon Sep 17 00:00:00 2001
From: David Rivera
Date: Sun, 2 Mar 2025 01:12:05 -0500
Subject: [PATCH] [clang-tidy] Add check on constexpr & static values on member
i
RiverDave wrote:
Ping
https://github.com/llvm/llvm-project/pull/129370
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
RiverDave wrote:
ping
https://github.com/llvm/llvm-project/pull/129408
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -132,11 +132,15 @@ Changes in existing checks
` check by providing additional
examples and fixing some macro related false positives.
+- Improved :doc:`modernize-use-default-member-init
RiverDave wrote:
Done
https://github.com/llvm/llvm-project/pull/1
https://github.com/RiverDave updated
https://github.com/llvm/llvm-project/pull/129370
>From 08049760b837d026fe9a69b8b6019c6d2bed06b1 Mon Sep 17 00:00:00 2001
From: David Rivera
Date: Sat, 1 Mar 2025 02:09:02 -0500
Subject: [PATCH] [clang-tidy] detect arithmetic operations within member list
in
RiverDave wrote:
> LGTM, but please address a nit
Should be done now, thanks!
https://github.com/llvm/llvm-project/pull/129370
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
RiverDave wrote:
> @RiverDave Unless you want this to be merged using github generated private
> email, change your email privacy settings.
My email should be public now
https://github.com/llvm/llvm-project/pull/129425
___
cfe-commits mailing list
cf
RiverDave wrote:
> Change looks correct, but looks like this check got one more limitation in
> case of code like this:
>
> ```
> class CastInit {
> CastInit() : m(static_cast(9)) {}
> int m = 9;
> };
> ```
>
> And this:
>
> ```
> class CastInit {
> CastInit() : m(static_cast(0)) {}
>
https://github.com/RiverDave edited
https://github.com/llvm/llvm-project/pull/129408
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/RiverDave edited
https://github.com/llvm/llvm-project/pull/129408
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -194,15 +199,21 @@ void UseDefaultMemberInitCheck::storeOptions(
}
void UseDefaultMemberInitCheck::registerMatchers(MatchFinder *Finder) {
- auto InitBase =
- anyOf(stringLiteral(), characterLiteral(), integerLiteral(),
-unaryOperator(hasAnyOperatorName("+
47 matches
Mail list logo