[clang-tools-extra] [clang-tidy][C++20] Add support for Initialization Forwarding in structs and Nested Objects within modernize-use-emplace (PR #131969)

2025-04-05 Thread David Rivera via cfe-commits
https://github.com/RiverDave updated https://github.com/llvm/llvm-project/pull/131969 >From 760916be170bc3a3e4188f9b399050cc92ab334f Mon Sep 17 00:00:00 2001 From: David Rivera Date: Sun, 16 Mar 2025 16:20:16 -0400 Subject: [PATCH] [clang-tidy] Add support for Initialization Forwarding in Nest

[clang-tools-extra] [clang-tidy] detect arithmetic operations within member list initialization in modernize-use-default-member-init check (PR #129370)

2025-04-05 Thread David Rivera via cfe-commits
RiverDave wrote: Ping @5chmidti @PiotrZSL @carlosgalvezp 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

[clang-tools-extra] [clang-tidy] Improve integer comparison by matching valid expressions outside implicitCastExpr (PR #134188)

2025-04-05 Thread David Rivera via cfe-commits
https://github.com/RiverDave updated https://github.com/llvm/llvm-project/pull/134188 >From 357f8d3b2fc424968a9e17c3dd2a13fe046f6cf9 Mon Sep 17 00:00:00 2001 From: David Rivera Date: Wed, 2 Apr 2025 21:02:00 -0400 Subject: [PATCH] [clang-tidy] Improve integer comparison by matching valid expre

[clang-tools-extra] [clang-tidy][C++20] Add support for Initialization Forwarding in structs and Nested Objects within modernize-use-emplace (PR #131969)

2025-04-05 Thread David Rivera via cfe-commits
@@ -332,19 +380,44 @@ void UseEmplaceCheck::check(const MatchFinder::MatchResult &Result) { }(); assert(Call && "No call matched"); - assert((CtorCall || MakeCall) && "No push_back parameter matched"); + assert((CtorCall || MakeCall || AggInitCall) && + "No push

[clang-tools-extra] [clang-tidy][C++20] Add support for Initialization Forwarding in structs and Nested Objects within modernize-use-emplace (PR #131969)

2025-04-04 Thread David Rivera via cfe-commits
RiverDave wrote: Ping https://github.com/llvm/llvm-project/pull/131969 ___ 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 integer comparison by matching valid expressions outside implicitCastExpr (PR #134188)

2025-04-04 Thread David Rivera via cfe-commits
@@ -166,6 +166,10 @@ Changes in existing checks excluding variables with ``thread_local`` storage class specifier from being matched. +- Improved :doc:`modernize-use-integer-sign-comparison RiverDave wrote: Figured it out the instant I pushed my changes 😂

[clang-tools-extra] [clang-tidy] Improve integer comparison by matching valid expressions outside implicitCastExpr (PR #134188)

2025-04-04 Thread David Rivera via cfe-commits
https://github.com/RiverDave updated https://github.com/llvm/llvm-project/pull/134188 >From 3a2d0c5cc8de153e6d0139154c2c6cd674936a40 Mon Sep 17 00:00:00 2001 From: David Rivera Date: Wed, 2 Apr 2025 21:02:00 -0400 Subject: [PATCH] [clang-tidy] Improve integer comparison by matching valid expre

[clang-tools-extra] [clang-tidy] Improve integer comparison by matching valid expressions outside implicitCastExpr (PR #134188)

2025-04-04 Thread David Rivera via cfe-commits
@@ -177,6 +177,10 @@ Changes in existing checks matched scenarios of ``find`` and ``rfind`` methods and fixing false positives when those methods were called with 3 arguments. +- Improved :doc:`modernize-use-integer-sign-comparison RiverDave wrote: Thanks

[clang-tools-extra] [clang-tidy] Improve integer comparison by matching valid expressions outside implicitCastExpr (PR #134188)

2025-04-04 Thread David Rivera via cfe-commits
https://github.com/RiverDave updated https://github.com/llvm/llvm-project/pull/134188 >From b37d2b18e12cce53137eb78af5507ebf13ee45a1 Mon Sep 17 00:00:00 2001 From: David Rivera Date: Wed, 2 Apr 2025 21:02:00 -0400 Subject: [PATCH] [clang-tidy] Improve integer comparison by matching valid expre

[clang-tools-extra] [clang-tidy] detect arithmetic operations within member list initialization in modernize-use-default-member-init check (PR #129370)

2025-04-04 Thread David Rivera via cfe-commits
RiverDave wrote: Ping @HerrCai0907 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

[clang-tools-extra] [clang-tidy] Improve integer comparison by matching valid expressions outside implicitCastExpr (PR #134188)

2025-04-03 Thread David Rivera via cfe-commits
https://github.com/RiverDave edited https://github.com/llvm/llvm-project/pull/134188 ___ 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 integer comparison by matching valid expressions outside implicitCastExpr (PR #134188)

2025-04-02 Thread David Rivera via cfe-commits
https://github.com/RiverDave updated https://github.com/llvm/llvm-project/pull/134188 >From ac9833cd5abdaf4a91c785d5fa9d51190219851a Mon Sep 17 00:00:00 2001 From: David Rivera Date: Wed, 2 Apr 2025 21:02:00 -0400 Subject: [PATCH] [clang-tidy] Improve integer comparison by matching valid expre

[clang-tools-extra] [clang-tidy] Improve integer comparison by matching valid expressions outside implicitCastExpr (PR #134188)

2025-04-02 Thread David Rivera via cfe-commits
https://github.com/RiverDave created https://github.com/llvm/llvm-project/pull/134188 Covered the edge case where an int expression is not necessarily directly wrapped around an ImplicitCastExpr which seemed to be a requirement in this check to trigger. **For instance**: ```cpp #include bo

[clang-tools-extra] [clang-tidy][C++20] Add support for Initialization Forwarding in structs and Nested Objects within modernize-use-emplace (PR #131969)

2025-04-01 Thread David Rivera via cfe-commits
https://github.com/RiverDave updated https://github.com/llvm/llvm-project/pull/131969 >From 27f7da4bee6ea2f5c1c5dcd899bfe980df30f0ce Mon Sep 17 00:00:00 2001 From: David Rivera Date: Sun, 16 Mar 2025 16:20:16 -0400 Subject: [PATCH] [clang-tidy] Add support for Initialization Forwarding in Nest

[clang-tools-extra] [clang-tidy][C++20] Add support for Initialization Forwarding in structs and Nested Objects within modernize-use-emplace (PR #131969)

2025-04-01 Thread David Rivera via cfe-commits
@@ -1285,11 +1289,9 @@ void testBracedInitTemporaries() { // These should not be noticed or fixed; after the correction, the code won't - // compile. + // compile in version previous to C++20. RiverDave wrote: All should be addressed now https://github.

[clang-tools-extra] [clang-tidy][C++20] Add support for Initialization Forwarding in structs and Nested Objects within modernize-use-emplace (PR #131969)

2025-04-01 Thread David Rivera via cfe-commits
https://github.com/RiverDave updated https://github.com/llvm/llvm-project/pull/131969 >From 89412d91ff6cd38a8060c84f66bbab3caead2478 Mon Sep 17 00:00:00 2001 From: David Rivera Date: Sun, 16 Mar 2025 16:20:16 -0400 Subject: [PATCH] [clang-tidy] Add support for Initialization Forwarding in Nest

[clang-tools-extra] [clang-tidy][C++20] Add support for Initialization Forwarding in structs and Nested Objects within modernize-use-emplace (PR #131969)

2025-03-30 Thread David Rivera via cfe-commits
https://github.com/RiverDave edited https://github.com/llvm/llvm-project/pull/131969 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy][C++20] Add support for Initialization Forwarding in structs and Nested Objects within modernize-use-emplace (PR #131969)

2025-03-30 Thread David Rivera via cfe-commits
@@ -1285,11 +1289,9 @@ void testBracedInitTemporaries() { // These should not be noticed or fixed; after the correction, the code won't - // compile. + // compile in version previous to C++20. RiverDave wrote: Indeed, forgot to delete that, thx https://

[clang-tools-extra] [clang-tidy][C++20] Add support for Initialization Forwarding in structs and Nested Objects within modernize-use-emplace (PR #131969)

2025-03-29 Thread David Rivera via cfe-commits
https://github.com/RiverDave updated https://github.com/llvm/llvm-project/pull/131969 >From f0b31f80f452c80926822ea279e5aff37b84b840 Mon Sep 17 00:00:00 2001 From: David Rivera Date: Sun, 16 Mar 2025 16:20:16 -0400 Subject: [PATCH] [clang-tidy] Add support for Initialization Forwarding in Nest

[clang-tools-extra] [clang-tidy][C++20] Add support for Initialization Forwarding in structs and Nested Objects within modernize-use-emplace (PR #131969)

2025-03-29 Thread David Rivera via cfe-commits
@@ -1289,7 +1305,11 @@ void testBracedInitTemporaries() { v2.push_back(NonTrivialWithVector{{0}}); v2.push_back({{0}}); v2.push_back(NonTrivialWithVector{std::vector{0}}); + // CHECK-MESSAGES-CPP20: :[[@LINE-1]]:6: warning: use emplace_back instead of push_back

[clang-tools-extra] [clang-tidy][C++20] Add support for Initialization Forwarding in structs and Nested Objects within modernize-use-emplace (PR #131969)

2025-03-29 Thread David Rivera via cfe-commits
https://github.com/RiverDave updated https://github.com/llvm/llvm-project/pull/131969 >From 9972aa8e1720f7e6378c63551c853ee504193000 Mon Sep 17 00:00:00 2001 From: David Rivera Date: Sun, 16 Mar 2025 16:20:16 -0400 Subject: [PATCH] [clang-tidy] Add support for Initialization Forwarding in Nest

[clang-tools-extra] [clang-tidy][C++20] Add support for Initialization Forwarding in structs and Nested Objects within modernize-use-emplace (PR #131969)

2025-03-29 Thread David Rivera via cfe-commits
https://github.com/RiverDave edited https://github.com/llvm/llvm-project/pull/131969 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy] detect arithmetic operations within member list initialization in modernize-use-default-member-init check (PR #129370)

2025-03-29 Thread David Rivera via cfe-commits
https://github.com/RiverDave updated https://github.com/llvm/llvm-project/pull/129370 >From 82951dab6d1b834a5b296faddcf23603f3f05e84 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

[clang-tools-extra] [clang-tidy] detect arithmetic operations within member list initialization in modernize-use-default-member-init check (PR #129370)

2025-03-29 Thread David Rivera via cfe-commits
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

[clang-tools-extra] [clang-tidy][C++20] Add support for Initialization Forwarding in Nested Objects (PR #131969)

2025-03-27 Thread David Rivera via cfe-commits
RiverDave wrote: Ping https://github.com/llvm/llvm-project/pull/131969 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy][C++20] Add support for aggregate types within modernize-use-emplace (PR #131969)

2025-03-25 Thread David Rivera via cfe-commits
@@ -1,4 +1,4 @@ -// RUN: %check_clang_tidy %s modernize-use-emplace %t -- \ +// RUN: %check_clang_tidy %s -std=c++17 modernize-use-emplace %t -- \ RiverDave wrote: On second thought would this be sufficient for the cases shown above?: I've noticed that `use-range

[clang-tools-extra] [clang-tidy][C++20] Add support for Initialization Forwarding in Nested Objects (PR #131969)

2025-03-23 Thread David Rivera via cfe-commits
https://github.com/RiverDave edited https://github.com/llvm/llvm-project/pull/131969 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy][C++20] Add support for Initialization Forwarding in Nested Object Construction (PR #131969)

2025-03-23 Thread David Rivera via cfe-commits
https://github.com/RiverDave updated https://github.com/llvm/llvm-project/pull/131969 >From c966cef850ed1350264110e622866dae66f99a07 Mon Sep 17 00:00:00 2001 From: David Rivera Date: Sun, 16 Mar 2025 16:20:16 -0400 Subject: [PATCH] [clang-tidy] Add support for Initialization Forwarding in Nest

[clang-tools-extra] [clang-tidy][C++20] Add support for Initialization Forwarding in Nested Object Construction (PR #131969)

2025-03-23 Thread David Rivera via cfe-commits
https://github.com/RiverDave edited https://github.com/llvm/llvm-project/pull/131969 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy][C++20] Add support for Initialization Forwarding in Nested Object Construction (PR #131969)

2025-03-23 Thread David Rivera via cfe-commits
https://github.com/RiverDave edited https://github.com/llvm/llvm-project/pull/131969 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy][C++20] Add support for Initialization Forwarding in Nested Object Construction (PR #131969)

2025-03-23 Thread David Rivera via cfe-commits
https://github.com/RiverDave edited https://github.com/llvm/llvm-project/pull/131969 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy][C++20] Add support for Initialization Forwarding in Nested Object Construction (PR #131969)

2025-03-23 Thread David Rivera via cfe-commits
RiverDave wrote: Removed **Aggregates** from both title and release notes considering my changes can potentially affect non aggregate structs types as well. https://github.com/llvm/llvm-project/pull/131969 ___ cfe-commits mailing list cfe-commits@list

[clang-tools-extra] [clang-tidy][C++20] Add support for Initialization Forwarding in Nested Object Construction (PR #131969)

2025-03-23 Thread David Rivera via cfe-commits
@@ -0,0 +1,86 @@ +// RUN: %check_clang_tidy %s -std=c++20 modernize-use-emplace %t -- \ RiverDave wrote: File was removed as suggested, will create a new file for future work on designated inits https://github.com/llvm/llvm-project/pull/131969 _

[clang-tools-extra] [clang-tidy][C++20] Add support for Initialization Forwarding in Nested Object Construction (PR #131969)

2025-03-23 Thread David Rivera via cfe-commits
https://github.com/RiverDave edited https://github.com/llvm/llvm-project/pull/131969 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy][C++20] Add support for Initialization Forwarding in Nested Object Construction (PR #131969)

2025-03-23 Thread David Rivera via cfe-commits
@@ -1,4 +1,4 @@ -// RUN: %check_clang_tidy %s modernize-use-emplace %t -- \ +// RUN: %check_clang_tidy %s -std=c++17 modernize-use-emplace %t -- \ RiverDave wrote: Thx for your suggestions, this is really great, this should be addressed now. https://github.com/l

[clang-tools-extra] [clang-tidy][C++20] Add support for Initialization Forwarding in Nested Object Construction (PR #131969)

2025-03-23 Thread David Rivera via cfe-commits
https://github.com/RiverDave updated https://github.com/llvm/llvm-project/pull/131969 >From 30678d79b5f7cd91da8eef5251eabe96875c0397 Mon Sep 17 00:00:00 2001 From: David Rivera Date: Sun, 16 Mar 2025 16:20:16 -0400 Subject: [PATCH] [clang-tidy] Add support for Initialization Forwarding in Nest

[clang-tools-extra] [clang-tidy][C++20] Add support for Initialization Forwarding in Nested Object Construction (PR #131969)

2025-03-23 Thread David Rivera via cfe-commits
https://github.com/RiverDave updated https://github.com/llvm/llvm-project/pull/131969 >From fa0f1079587e6e26279c293fe4467ff0388f6a43 Mon Sep 17 00:00:00 2001 From: David Rivera Date: Sun, 16 Mar 2025 16:20:16 -0400 Subject: [PATCH] [clang-tidy] Add support for Initialization Forwarding in Nest

[clang-tools-extra] [clang-tidy][C++20] Add support for aggregate types within modernize-use-emplace (PR #131969)

2025-03-23 Thread David Rivera via cfe-commits
@@ -0,0 +1,86 @@ +// RUN: %check_clang_tidy %s -std=c++20 modernize-use-emplace %t -- \ +// RUN: -config="{CheckOptions: \ +// RUN: {modernize-use-emplace.ContainersWithPushBack: \ +// RUN:'::std::vector; ::std::list; ::std::deque; llvm::LikeASmallVe

[clang-tools-extra] [clang-tidy] detect arithmetic operations within member list initialization in modernize-use-default-member-init check (PR #129370)

2025-03-22 Thread David Rivera via cfe-commits
RiverDave wrote: @HerrCai0907 could we merge this? 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

[clang-tools-extra] [clang-tidy] detect arithmetic operations within member list initialization in modernize-use-default-member-init check (PR #129370)

2025-03-22 Thread David Rivera via cfe-commits
@@ -159,8 +159,8 @@ Changes in existing checks - Improved :doc:`modernize-use-default-member-init ` check by matching - ``constexpr`` and ``static``` values on member initialization and by detecting - explicit casting of built-in types within member list initialization. +

[clang-tools-extra] [clang-tidy] detect arithmetic operations within member list initialization in modernize-use-default-member-init check (PR #129370)

2025-03-22 Thread David Rivera via cfe-commits
https://github.com/RiverDave updated https://github.com/llvm/llvm-project/pull/129370 >From 4e5e44c721e1867b9263d0a0ea4669d0bd3bdd4a 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

[clang-tools-extra] [clang-tidy] detect arithmetic operations within member list initialization in modernize-use-default-member-init check (PR #129370)

2025-03-22 Thread David Rivera via cfe-commits
https://github.com/RiverDave updated https://github.com/llvm/llvm-project/pull/129370 >From c81ff04def9d2198c84b96fb5cfa1de90ca57a11 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

[clang-tools-extra] [clang-tidy][C++20] Add support for aggregate types within modernize-use-emplace (PR #131969)

2025-03-20 Thread David Rivera via cfe-commits
https://github.com/RiverDave edited https://github.com/llvm/llvm-project/pull/131969 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy][C++20] Add support for aggregate types within modernize-use-emplace (PR #131969)

2025-03-19 Thread David Rivera via cfe-commits
https://github.com/RiverDave edited https://github.com/llvm/llvm-project/pull/131969 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy][C++20] Add support for aggregate types within modernize-use-emplace (PR #131969)

2025-03-19 Thread David Rivera via cfe-commits
https://github.com/RiverDave edited https://github.com/llvm/llvm-project/pull/131969 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy][C++20] Add support for aggregate types within modernize-use-emplace (PR #131969)

2025-03-19 Thread David Rivera via cfe-commits
https://github.com/RiverDave edited https://github.com/llvm/llvm-project/pull/131969 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy][C++20] Add support for aggregate types within modernize-use-emplace (PR #131969)

2025-03-19 Thread David Rivera via cfe-commits
https://github.com/RiverDave edited https://github.com/llvm/llvm-project/pull/131969 ___ 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 aggregate types within modernize-use-emplace (PR #131969)

2025-03-18 Thread David Rivera via cfe-commits
https://github.com/RiverDave created https://github.com/llvm/llvm-project/pull/131969 Aims to address: #115841 C++20 introduced in-place initialization for aggregate types within `emplace_back` calls. I ensured to match any braced init expressions with temporals (and applied similar rules as

[clang-tools-extra] [clang-tidy][C++20] Add support for aggregate types within modernize-use-emplace (PR #131969)

2025-03-18 Thread David Rivera via cfe-commits
https://github.com/RiverDave edited https://github.com/llvm/llvm-project/pull/131969 ___ 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 aggregate types within modernize-use-emplace (PR #131969)

2025-03-18 Thread David Rivera via cfe-commits
https://github.com/RiverDave edited https://github.com/llvm/llvm-project/pull/131969 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy] detect arithmetic operations within member list initialization in modernize-use-default-member-init check (PR #129370)

2025-03-15 Thread David Rivera via cfe-commits
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

[clang-tools-extra] [clang-tidy] detect arithmetic operations within member list initialization in modernize-use-default-member-init check (PR #129370)

2025-03-15 Thread David Rivera via cfe-commits
https://github.com/RiverDave updated https://github.com/llvm/llvm-project/pull/129370 >From 85796af53e845110824b11b0f35c7ab24827c7d5 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

[clang-tools-extra] [clang-tidy] detect explicit casting within modernize-use-default-member-init (PR #129408)

2025-03-15 Thread David Rivera via 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

[clang-tools-extra] [clang-tidy] detect explicit casting within modernize-use-default-member-init (PR #129408)

2025-03-12 Thread David Rivera via cfe-commits
https://github.com/RiverDave updated https://github.com/llvm/llvm-project/pull/129408 >From 8995f2517be1235e01cd68d0d68199505b8ffaad Mon Sep 17 00:00:00 2001 From: David Rivera Date: Sat, 1 Mar 2025 19:22:25 -0500 Subject: [PATCH] [clang-tidy] detect explicit casting within modernize-use-defau

[clang-tools-extra] [clang-tidy] detect explicit casting within modernize-use-default-member-init (PR #129408)

2025-03-12 Thread David Rivera via cfe-commits
https://github.com/RiverDave updated https://github.com/llvm/llvm-project/pull/129408 >From a06de0100d34d3f18b8eca690161b3720620f4af Mon Sep 17 00:00:00 2001 From: David Rivera Date: Sat, 1 Mar 2025 19:22:25 -0500 Subject: [PATCH] [clang-tidy] detect explicit casting within modernize-use-defau

[clang-tools-extra] [clang-tidy] detect explicit casting within modernize-use-default-member-init (PR #129408)

2025-03-12 Thread David Rivera via cfe-commits
@@ -158,6 +158,10 @@ Changes in existing checks ` check by matching ``constexpr`` and ``static`` values on member initialization. +- Improved :doc:`modernize-use-default-member-init + ` check by detecting + explicit casting of built-in types within member list initializa

[clang-tools-extra] [clang-tidy] detect explicit casting within modernize-use-default-member-init (PR #129408)

2025-03-11 Thread David Rivera via cfe-commits
@@ -194,15 +199,21 @@ void UseDefaultMemberInitCheck::storeOptions( } void UseDefaultMemberInitCheck::registerMatchers(MatchFinder *Finder) { - auto InitBase = - anyOf(stringLiteral(), characterLiteral(), integerLiteral(), -unaryOperator(hasAnyOperatorName("+

[clang-tools-extra] [clang-tidy] detect explicit casting within modernize-use-default-member-init (PR #129408)

2025-03-11 Thread David Rivera via 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

[clang-tools-extra] [clang-tidy] detect explicit casting within modernize-use-default-member-init (PR #129408)

2025-03-11 Thread David Rivera via 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

[clang-tools-extra] [clang-tidy] detect explicit casting within modernize-use-default-member-init (PR #129408)

2025-03-11 Thread David Rivera via cfe-commits
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)) {} >

[clang-tools-extra] [clang-tidy] Add check on constexpr & static values in modernize-use-default-member-init (PR #129425)

2025-03-11 Thread David Rivera via 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

[clang-tools-extra] [clang-tidy] detect arithmetic operations within member list initialization in modernize-use-default-member-init check (PR #129370)

2025-03-09 Thread David Rivera via cfe-commits
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

[clang-tools-extra] [clang-tidy] detect arithmetic operations within member list initialization in modernize-use-default-member-init check (PR #129370)

2025-03-09 Thread David Rivera via cfe-commits
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

[clang-tools-extra] [clang-tidy] detect arithmetic operations within member list initialization in modernize-use-default-member-init check (PR #129370)

2025-03-09 Thread David Rivera via 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

[clang-tools-extra] [clang-tidy] Add check on constexpr & static values in modernize-use-default-member-init (PR #129425)

2025-03-08 Thread David Rivera via 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

[clang-tools-extra] [clang-tidy] detect arithmetic operations within member list initialization in modernize-use-default-member-init check (PR #129370)

2025-03-08 Thread David Rivera via 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

[clang-tools-extra] [clang-tidy] Add check on constexpr & static values in modernize-use-default-member-init (PR #129425)

2025-03-08 Thread David Rivera via cfe-commits
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

[clang-tools-extra] [clang-tidy] detect arithmetic operations within member list initialization in modernize-use-default-member-init check (PR #129370)

2025-03-08 Thread David Rivera via cfe-commits
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

[clang-tools-extra] [clang-tidy] detect arithmetic operations within member list initialization in modernize-use-default-member-init check (PR #129370)

2025-03-08 Thread David Rivera via cfe-commits
@@ -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'

[clang-tools-extra] [clang-tidy] detect arithmetic operations within member list initialization in modernize-use-default-member-init check (PR #129370)

2025-03-08 Thread David Rivera via cfe-commits
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

[clang-tools-extra] [clang-tidy] detect arithmetic operations within member list initialization in modernize-use-default-member-init check (PR #129370)

2025-03-08 Thread David Rivera via cfe-commits
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

[clang-tools-extra] [clang-tidy] detect explicit casting within modernize-use-default-member-init (PR #129408)

2025-03-08 Thread David Rivera via 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

[clang-tools-extra] [clang-tidy] detect arithmetic operations within member list initialization in modernize-use-default-member-init check (PR #129370)

2025-03-08 Thread David Rivera via cfe-commits
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

[clang-tools-extra] [clang-tidy] detect arithmetic operations within member list initialization in modernize-use-default-member-init check (PR #129370)

2025-03-01 Thread David Rivera via cfe-commits
@@ -202,7 +208,13 @@ void UseDefaultMemberInitCheck::registerMatchers(MatchFinder *Finder) { unaryOperator(hasAnyOperatorName("+", "-"), hasUnaryOperand(floatLiteral())), cxxBoolLiteral(), cxxNullPtrLiteralExpr(), implicitValue

[clang-tools-extra] [clang-tidy] detect arithmetic operations within member list initialization in modernize-use-default-member-init check (PR #129370)

2025-03-01 Thread David Rivera via 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

[clang-tools-extra] [clang-tidy] detect arithmetic operations within member list initialization in modernize-use-default-member-init check (PR #129370)

2025-03-01 Thread David Rivera via cfe-commits
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

[clang-tools-extra] [clang-tidy] detect arithmetic operations within member list initialization in modernize-use-default-member-init check (PR #129370)

2025-03-01 Thread David Rivera via 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

[clang-tools-extra] [clang-tidy] detect arithmetic operations within member list initialization in modernize-use-default-member-init check (PR #129370)

2025-03-01 Thread David Rivera via 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

[clang-tools-extra] [clang-tidy] detect arithmetic operations within member list initialization in modernize-use-default-member-init check (PR #129370)

2025-03-01 Thread David Rivera via cfe-commits
@@ -202,7 +208,13 @@ void UseDefaultMemberInitCheck::registerMatchers(MatchFinder *Finder) { unaryOperator(hasAnyOperatorName("+", "-"), hasUnaryOperand(floatLiteral())), cxxBoolLiteral(), cxxNullPtrLiteralExpr(), implicitValue

[clang-tools-extra] [clang-tidy] detect arithmetic operations within member list initialization in modernize-use-default-member-init check (PR #129370)

2025-03-01 Thread David Rivera via 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

[clang-tools-extra] [clang-tidy] detect arithmetic operations within member list initialization in modernize-use-default-member-init check (PR #129370)

2025-03-01 Thread David Rivera via 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

[clang-tools-extra] [clang-tidy] detect arithmetic operations within member list initialization in modernize-use-default-member-init check (PR #129370)

2025-03-01 Thread David Rivera via cfe-commits
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

[clang-tools-extra] [clang-tidy] detect arithmetic operations within member list initialization in modernize-use-default-member-init check (PR #129370)

2025-03-01 Thread David Rivera via cfe-commits
@@ -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

[clang-tools-extra] [clang-tidy] detect arithmetic operations within member list initialization in modernize-use-default-member-init check (PR #129370)

2025-03-01 Thread David Rivera via cfe-commits
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

[clang-tools-extra] [clang-tidy] detect arithmetic operations within member list initialization in modernize-use-default-member-init check (PR #129370)

2025-03-01 Thread David Rivera via 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

[clang-tools-extra] [clang-tidy] detect arithmetic operations within member list initialization in modernize-use-default-member-init check (PR #129370)

2025-02-28 Thread David Rivera via 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

[clang-tools-extra] [clang-tidy] detect arithmetic operations within member list initialization in modernize-use-default-member-init check (PR #129370)

2025-02-28 Thread David Rivera via 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

[clang-tools-extra] [clang-tidy] detect arithmetic operations within member list initialization in modernize-use-default-member-init check (PR #129370)

2025-02-28 Thread David Rivera via cfe-commits
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

[clang-tools-extra] [clang-tidy] Fix performance-move-const-arg false negative in ternary… (PR #128402)

2025-02-26 Thread David Rivera via 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-

[clang-tools-extra] [clang-tidy] Fix performance-move-const-arg false negative in ternary… (PR #128402)

2025-02-26 Thread David Rivera via cfe-commits
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

[clang-tools-extra] [clang-tidy] Fix performance-move-const-arg false negative in ternary… (PR #128402)

2025-02-26 Thread David Rivera via cfe-commits
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

[clang-tools-extra] [clang-tidy] Fix performance-move-const-arg false negative in ternary… (PR #128402)

2025-02-26 Thread David Rivera via 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

[clang-tools-extra] [clang-tidy] Fix performance-move-const-arg false negative in ternary… (PR #128402)

2025-02-26 Thread David Rivera via 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

[clang-tools-extra] [clang-tidy] Fix performance-move-const-arg false negative in ternary… (PR #128402)

2025-02-25 Thread David Rivera via 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

[clang-tools-extra] [clang-tidy] Fix performance-move-const-arg false negative in ternary… (PR #128402)

2025-02-23 Thread David Rivera via 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

[clang-tools-extra] [clang-tidy] Fix performance-move-const-arg false negative in ternary… (PR #128402)

2025-02-23 Thread David Rivera via 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

[clang-tools-extra] [clang-tidy] Fix performance-move-const-arg false negative in ternary… (PR #128402)

2025-02-23 Thread David Rivera via 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

[clang-tools-extra] [clang-tidy] Fix performance-move-const-arg false negative in ternary… (PR #128402)

2025-02-23 Thread David Rivera via 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

[clang-tools-extra] [clang-tidy] Fix performance-move-const-arg false negative in ternary… (PR #128402)

2025-02-23 Thread David Rivera via cfe-commits
@@ -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 = +

[clang-tools-extra] [clang-tidy] Fix performance-move-const-arg false negative in ternary… (PR #128402)

2025-02-22 Thread David Rivera via 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

  1   2   >