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

2024-01-12 Thread Bhuminjay Soni via cfe-commits
11happy wrote: @PiotrZSL can you please review the changes. thank you. 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] Add clang-tidy check to suggest replacement of conditional statement with std::min/std::max (PR #77816)

2024-01-12 Thread Bhuminjay Soni via cfe-commits
@@ -0,0 +1,31 @@ +.. title:: clang-tidy - readability-use-std-min-max + +readability-use-std-min-max +=== + +Replaces certain conditional statements with equivalent ``std::min`` or ``std::max`` expressions, +improving readability and promoting the use of

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

2024-01-12 Thread Bhuminjay Soni via cfe-commits
https://github.com/11happy updated https://github.com/llvm/llvm-project/pull/77816 >From 1883d987b2f83adaef05fdb47ae25c7b06582a64 Mon Sep 17 00:00:00 2001 From: 11happy Date: Fri, 12 Jan 2024 00:02:46 +0530 Subject: [PATCH 01/13] Add readability check to suggest replacement of conditional stat

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

2024-01-12 Thread Bhuminjay Soni via cfe-commits
https://github.com/11happy updated https://github.com/llvm/llvm-project/pull/77816 >From 1883d987b2f83adaef05fdb47ae25c7b06582a64 Mon Sep 17 00:00:00 2001 From: 11happy Date: Fri, 12 Jan 2024 00:02:46 +0530 Subject: [PATCH 01/12] Add readability check to suggest replacement of conditional stat

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

2024-01-12 Thread Bhuminjay Soni via cfe-commits
@@ -0,0 +1,27 @@ +// RUN: %check_clang_tidy %s readability-ConditionalToStdMinMax %t + +void foo() { + int value1,value2; + + // CHECK-MESSAGES: :[[@LINE+1]]:3: warning: use std::max instead of < [readability-ConditionalToStdMinMax] + if (value1 < value2) +value1 = value2;

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

2024-01-12 Thread Bhuminjay Soni via cfe-commits
https://github.com/11happy updated https://github.com/llvm/llvm-project/pull/77816 >From 1883d987b2f83adaef05fdb47ae25c7b06582a64 Mon Sep 17 00:00:00 2001 From: 11happy Date: Fri, 12 Jan 2024 00:02:46 +0530 Subject: [PATCH 01/11] Add readability check to suggest replacement of conditional stat

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

2024-01-12 Thread Bhuminjay Soni via cfe-commits
https://github.com/11happy updated https://github.com/llvm/llvm-project/pull/77816 >From 1883d987b2f83adaef05fdb47ae25c7b06582a64 Mon Sep 17 00:00:00 2001 From: 11happy Date: Fri, 12 Jan 2024 00:02:46 +0530 Subject: [PATCH 01/10] Add readability check to suggest replacement of conditional stat

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

2024-01-12 Thread Bhuminjay Soni via cfe-commits
11happy wrote: Thank you for all the suggestions , I think I have tried to incorporate all of them . https://github.com/llvm/llvm-project/pull/77816 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinf

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

2024-01-12 Thread Bhuminjay Soni via cfe-commits
https://github.com/11happy updated https://github.com/llvm/llvm-project/pull/77816 >From 1883d987b2f83adaef05fdb47ae25c7b06582a64 Mon Sep 17 00:00:00 2001 From: 11happy Date: Fri, 12 Jan 2024 00:02:46 +0530 Subject: [PATCH 1/9] Add readability check to suggest replacement of conditional statem

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

2024-01-11 Thread Bhuminjay Soni via cfe-commits
11happy wrote: Thank you for the suggestions and your guidance I will update it as soon as possible. https://github.com/llvm/llvm-project/pull/77816 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinf

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

2024-01-11 Thread Bhuminjay Soni via cfe-commits
https://github.com/11happy updated https://github.com/llvm/llvm-project/pull/77816 >From 1883d987b2f83adaef05fdb47ae25c7b06582a64 Mon Sep 17 00:00:00 2001 From: 11happy Date: Fri, 12 Jan 2024 00:02:46 +0530 Subject: [PATCH 1/3] Add readability check to suggest replacement of conditional statem

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

2024-01-11 Thread Bhuminjay Soni via cfe-commits
https://github.com/11happy created https://github.com/llvm/llvm-project/pull/77816 **Overview:** This pull request fixes #64914 where author suggests adding a readability check to propose the replacement of conditional statements with std::min/std::max for improved code readability. Additional

[clang-tools-extra] Add new check: do not return 0; at the end of main() in C++ (PR #77586)

2024-01-10 Thread Bhuminjay Soni via cfe-commits
11happy wrote: Sure Sure, I will take up another issue. https://github.com/llvm/llvm-project/pull/77586 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] Add new check: do not return 0; at the end of main() in C++ (PR #77586)

2024-01-10 Thread Bhuminjay Soni via cfe-commits
11happy wrote: > I agree with the opinions from Aaron And Piotr above - this check does the > opposite of readability: it forces people to waste time digging into the > Standard to find the quote that says the return is not needed. > > Could some argumentation be provided as to why this would

[clang-tools-extra] Add new check: do not return 0; at the end of main() in C++ (PR #77586)

2024-01-10 Thread Bhuminjay Soni via cfe-commits
11happy wrote: @PiotrZSL I have updated the code as per your suggestions. Can you please take a look at it? Thank you. https://github.com/llvm/llvm-project/pull/77586 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-b

[clang-tools-extra] Add new check: do not return 0; at the end of main() in C++ (PR #77586)

2024-01-10 Thread Bhuminjay Soni via cfe-commits
https://github.com/11happy updated https://github.com/llvm/llvm-project/pull/77586 >From bae95013cd7f937a5496cafcd40a77cc563addb0 Mon Sep 17 00:00:00 2001 From: 11happy Date: Wed, 10 Jan 2024 16:48:43 +0530 Subject: [PATCH 1/6] Added check for redundant return statement Signed-off-by: 11happy

[clang-tools-extra] Add new check: do not return 0; at the end of main() in C++ (PR #77586)

2024-01-10 Thread Bhuminjay Soni via cfe-commits
https://github.com/11happy updated https://github.com/llvm/llvm-project/pull/77586 >From bae95013cd7f937a5496cafcd40a77cc563addb0 Mon Sep 17 00:00:00 2001 From: 11happy Date: Wed, 10 Jan 2024 16:48:43 +0530 Subject: [PATCH 1/5] Added check for redundant return statement Signed-off-by: 11happy

[clang-tools-extra] Add new check: do not return 0; at the end of main() in C++ (PR #77586)

2024-01-10 Thread Bhuminjay Soni via cfe-commits
11happy wrote: > I'm not fan about this check. For me there is no use case for it. For sure > it's not readability, simply because explicit return is more readable, and > people who do not know that main by default will return 0 may even consider > this check a bug, as why all functions got re

[clang-tools-extra] Add new check: do not return 0; at the end of main() in C++ (PR #77586)

2024-01-10 Thread Bhuminjay Soni via cfe-commits
https://github.com/11happy updated https://github.com/llvm/llvm-project/pull/77586 >From bae95013cd7f937a5496cafcd40a77cc563addb0 Mon Sep 17 00:00:00 2001 From: 11happy Date: Wed, 10 Jan 2024 16:48:43 +0530 Subject: [PATCH 1/2] Added check for redundant return statement Signed-off-by: 11happy

[clang-tools-extra] Add new check: do not return 0; at the end of main() in C++ (PR #77586)

2024-01-10 Thread Bhuminjay Soni via cfe-commits
https://github.com/11happy created https://github.com/llvm/llvm-project/pull/77586 **Overview:** This pull request fixes #38469 where the issue proposes a new static analysis check in C++ to discourage the explicit return 0; statement at the end of the main() function. As C++ automatically ass

[clang] Changed Checks from TriviallyCopyable to TriviallyCopyConstructible (PR #77194)

2024-01-09 Thread Bhuminjay Soni via cfe-commits
11happy wrote: Are there any more changes for this PR required from my end? https://github.com/llvm/llvm-project/pull/77194 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Changed Checks from TriviallyCopyable to TriviallyCopyConstructible (PR #77194)

2024-01-07 Thread Bhuminjay Soni via cfe-commits
11happy wrote: Thanks, I am really grateful for your guidance. https://github.com/llvm/llvm-project/pull/77194 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Changed Checks from TriviallyCopyable to TriviallyCopyConstructible (PR #77194)

2024-01-07 Thread Bhuminjay Soni via cfe-commits
@@ -870,9 +870,9 @@ Bug Fixes to AST Handling - Fixed a bug where RecursiveASTVisitor fails to visit the initializer of a bitfield. `Issue 64916 `_ -- Fixed a bug where Template Instantiation failed to handle Lambda Express

[clang] Changed Checks from TriviallyCopyable to TriviallyCopyConstructible (PR #77194)

2024-01-07 Thread Bhuminjay Soni via cfe-commits
https://github.com/11happy updated https://github.com/llvm/llvm-project/pull/77194 >From 3c8dfcf96e732f4546f8019c0111fd873b233162 Mon Sep 17 00:00:00 2001 From: 11happy Date: Mon, 1 Jan 2024 19:53:45 +0530 Subject: [PATCH 01/28] Changed Checks from TriviallyCopyable to TriviallyCopyConstructib

[clang] Changed Checks from TriviallyCopyable to TriviallyCopyConstructible (PR #77194)

2024-01-06 Thread Bhuminjay Soni via cfe-commits
@@ -870,9 +870,9 @@ Bug Fixes to AST Handling - Fixed a bug where RecursiveASTVisitor fails to visit the initializer of a bitfield. `Issue 64916 `_ -- Fixed a bug where Template Instantiation failed to handle Lambda Express

[clang] Changed Checks from TriviallyCopyable to TriviallyCopyConstructible (PR #77194)

2024-01-06 Thread Bhuminjay Soni via cfe-commits
@@ -870,9 +870,9 @@ Bug Fixes to AST Handling - Fixed a bug where RecursiveASTVisitor fails to visit the initializer of a bitfield. `Issue 64916 `_ -- Fixed a bug where Template Instantiation failed to handle Lambda Express

[clang] Changed Checks from TriviallyCopyable to TriviallyCopyConstructible (PR #77194)

2024-01-06 Thread Bhuminjay Soni via cfe-commits
11happy wrote: Hello @Endilll Can you please look into this and request for reviews and review this. I am sorry for my mistake. https://github.com/llvm/llvm-project/pull/77194 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.

[clang] Changed Checks from TriviallyCopyable to TriviallyCopyConstructible (PR #77194)

2024-01-06 Thread Bhuminjay Soni via cfe-commits
11happy wrote: Hello @cor3ntin In my previous pull request I mistakenly added add the commits so I closed that one and opened this new one.Sorry for any inconvenience . https://github.com/llvm/llvm-project/pull/77194 ___ cfe-commits mailing list cfe-c

[clang] Changed Checks from TriviallyCopyable to TriviallyCopyConstructible (PR #77194)

2024-01-06 Thread Bhuminjay Soni via cfe-commits
https://github.com/11happy created https://github.com/llvm/llvm-project/pull/77194 **Overview:** This pull request fixes #47355 where in the Clang compiler's range-loop-analysis incorrectly checks for trivial copyability instead of trivial copy constructibility, leading to erroneous warnings.

[clang] Changed Checks from TriviallyCopyable to TriviallyCopyConstructible (PR #76680)

2024-01-06 Thread Bhuminjay Soni via cfe-commits
11happy wrote: Thank you @cor3ntin for your guidance being a new contributor to LLVM your guidance was very helpful and as my First PR gets approved this makes me more excited to work and contribute more to the org. https://github.com/llvm/llvm-project/pull/76680

[clang] Changed Checks from TriviallyCopyable to TriviallyCopyConstructible (PR #76680)

2024-01-06 Thread Bhuminjay Soni via cfe-commits
https://github.com/11happy updated https://github.com/llvm/llvm-project/pull/76680 >From 3c8dfcf96e732f4546f8019c0111fd873b233162 Mon Sep 17 00:00:00 2001 From: 11happy Date: Mon, 1 Jan 2024 19:53:45 +0530 Subject: [PATCH 01/13] Changed Checks from TriviallyCopyable to TriviallyCopyConstructib

[clang] Changed Checks from TriviallyCopyable to TriviallyCopyConstructible (PR #76680)

2024-01-05 Thread Bhuminjay Soni via cfe-commits
https://github.com/11happy updated https://github.com/llvm/llvm-project/pull/76680 >From 3c8dfcf96e732f4546f8019c0111fd873b233162 Mon Sep 17 00:00:00 2001 From: 11happy Date: Mon, 1 Jan 2024 19:53:45 +0530 Subject: [PATCH 01/12] Changed Checks from TriviallyCopyable to TriviallyCopyConstructib

[clang] Changed Checks from TriviallyCopyable to TriviallyCopyConstructible (PR #76680)

2024-01-05 Thread Bhuminjay Soni via cfe-commits
11happy wrote: The release notes being quite extensive where should I add it, In bug fixes? or in improvements? https://github.com/llvm/llvm-project/pull/76680 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mail

[clang] Changed Checks from TriviallyCopyable to TriviallyCopyConstructible (PR #76680)

2024-01-05 Thread Bhuminjay Soni via cfe-commits
https://github.com/11happy updated https://github.com/llvm/llvm-project/pull/76680 >From 3c8dfcf96e732f4546f8019c0111fd873b233162 Mon Sep 17 00:00:00 2001 From: 11happy Date: Mon, 1 Jan 2024 19:53:45 +0530 Subject: [PATCH 01/11] Changed Checks from TriviallyCopyable to TriviallyCopyConstructib

[clang] Changed Checks from TriviallyCopyable to TriviallyCopyConstructible (PR #76680)

2024-01-05 Thread Bhuminjay Soni via cfe-commits
https://github.com/11happy updated https://github.com/llvm/llvm-project/pull/76680 >From 3c8dfcf96e732f4546f8019c0111fd873b233162 Mon Sep 17 00:00:00 2001 From: 11happy Date: Mon, 1 Jan 2024 19:53:45 +0530 Subject: [PATCH 01/10] Changed Checks from TriviallyCopyable to TriviallyCopyConstructib

[clang] Changed Checks from TriviallyCopyable to TriviallyCopyConstructible (PR #76680)

2024-01-04 Thread Bhuminjay Soni via cfe-commits
https://github.com/11happy updated https://github.com/llvm/llvm-project/pull/76680 >From 3c8dfcf96e732f4546f8019c0111fd873b233162 Mon Sep 17 00:00:00 2001 From: 11happy Date: Mon, 1 Jan 2024 19:53:45 +0530 Subject: [PATCH 1/9] Changed Checks from TriviallyCopyable to TriviallyCopyConstructible

[clang] Changed Checks from TriviallyCopyable to TriviallyCopyConstructible (PR #76680)

2024-01-04 Thread Bhuminjay Soni via cfe-commits
11happy wrote: Hello @cor3ntin I have made changes as you suggested. Thank you https://github.com/llvm/llvm-project/pull/76680 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Changed Checks from TriviallyCopyable to TriviallyCopyConstructible (PR #76680)

2024-01-04 Thread Bhuminjay Soni via cfe-commits
https://github.com/11happy updated https://github.com/llvm/llvm-project/pull/76680 >From 3c8dfcf96e732f4546f8019c0111fd873b233162 Mon Sep 17 00:00:00 2001 From: 11happy Date: Mon, 1 Jan 2024 19:53:45 +0530 Subject: [PATCH 1/8] Changed Checks from TriviallyCopyable to TriviallyCopyConstructible

[clang] Changed Checks from TriviallyCopyable to TriviallyCopyConstructible (PR #76680)

2024-01-04 Thread Bhuminjay Soni via cfe-commits
11happy wrote: sorry from my end I will correct them and make a commit,Thank you https://github.com/llvm/llvm-project/pull/76680 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Changed Checks from TriviallyCopyable to TriviallyCopyConstructible (PR #76680)

2024-01-04 Thread Bhuminjay Soni via cfe-commits
https://github.com/11happy updated https://github.com/llvm/llvm-project/pull/76680 >From 3c8dfcf96e732f4546f8019c0111fd873b233162 Mon Sep 17 00:00:00 2001 From: 11happy Date: Mon, 1 Jan 2024 19:53:45 +0530 Subject: [PATCH 1/5] Changed Checks from TriviallyCopyable to TriviallyCopyConstructible

[clang] Changed Checks from TriviallyCopyable to TriviallyCopyConstructible (PR #76680)

2024-01-04 Thread Bhuminjay Soni via cfe-commits
https://github.com/11happy updated https://github.com/llvm/llvm-project/pull/76680 >From 3c8dfcf96e732f4546f8019c0111fd873b233162 Mon Sep 17 00:00:00 2001 From: 11happy Date: Mon, 1 Jan 2024 19:53:45 +0530 Subject: [PATCH 1/3] Changed Checks from TriviallyCopyable to TriviallyCopyConstructible

[clang] Changed Checks from TriviallyCopyable to TriviallyCopyConstructible (PR #76680)

2024-01-03 Thread Bhuminjay Soni via cfe-commits
@@ -2644,6 +2644,49 @@ bool QualType::isTriviallyCopyableType(const ASTContext &Context) const { return false; } +bool QualType::isTriviallyCopyConstructibleType( 11happy wrote: Yes I think that would be good, so should I do that? https://github.com/llvm/

[clang] Changed Checks from TriviallyCopyable to TriviallyCopyConstructible (PR #76680)

2024-01-02 Thread Bhuminjay Soni via cfe-commits
11happy wrote: Hello @Endilll Can I work on some other issues also till this PR get reviewed? Thank you https://github.com/llvm/llvm-project/pull/76680 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listi

[clang] Changed Checks from TriviallyCopyable to TriviallyCopyConstructible (PR #76680)

2024-01-01 Thread Bhuminjay Soni via cfe-commits
11happy wrote: I have added the tests as well. https://github.com/llvm/llvm-project/pull/76680 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Changed Checks from TriviallyCopyable to TriviallyCopyConstructible (PR #76680)

2024-01-01 Thread Bhuminjay Soni via cfe-commits
https://github.com/11happy updated https://github.com/llvm/llvm-project/pull/76680 >From 3c8dfcf96e732f4546f8019c0111fd873b233162 Mon Sep 17 00:00:00 2001 From: 11happy Date: Mon, 1 Jan 2024 19:53:45 +0530 Subject: [PATCH 1/2] Changed Checks from TriviallyCopyable to TriviallyCopyConstructible

[clang] Changed Checks from TriviallyCopyable to TriviallyCopyConstructible (PR #76680)

2024-01-01 Thread Bhuminjay Soni via cfe-commits
11happy wrote: Sure I can , I have also tested the code that was giving erroneous warnings, so should I add that example as well?? https://github.com/llvm/llvm-project/pull/76680 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.l

[clang] Changed Checks from TriviallyCopyable to TriviallyCopyConstructible (PR #76680)

2024-01-01 Thread Bhuminjay Soni via cfe-commits
https://github.com/11happy created https://github.com/llvm/llvm-project/pull/76680 **Overview:** This pull request fixes #47355 where in the Clang compiler's range-loop-analysis incorrectly checks for trivial copyability instead of trivial copy constructibility, leading to erroneous warnings.

<    1   2   3