[clang-tools-extra] [clang-tidy] Fix crash in C language in readability-non-const-parameter (PR #100461)

2024-07-25 Thread Piotr Zegar via cfe-commits
https://github.com/PiotrZSL closed https://github.com/llvm/llvm-project/pull/100461 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] Fix crash in modernize-use-ranges (PR #100427)

2024-07-25 Thread Piotr Zegar via cfe-commits
https://github.com/PiotrZSL closed https://github.com/llvm/llvm-project/pull/100427 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] Fix crash in modernize-use-ranges (PR #100427)

2024-07-25 Thread Piotr Zegar via cfe-commits
PiotrZSL wrote: Fix is reported to work, so lets merge it. https://github.com/llvm/llvm-project/pull/100427 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy] Fix crash in C language in readability-non-const-parameter (PR #100461)

2024-07-24 Thread Piotr Zegar via cfe-commits
https://github.com/PiotrZSL created https://github.com/llvm/llvm-project/pull/100461 Fix crash that happen when redeclaration got different number of parameters than definition. No release notes, as this will be backported. Fixes #100340 >From 253e132b022a4f2b454869eed416fd6966f35dd3 Mon

[clang-tools-extra] clang-tidy: readability-redundant-smartptr-get does not remove (#97964) (PR #100177)

2024-07-24 Thread Piotr Zegar via cfe-commits
@@ -104,6 +104,296 @@ New check aliases Changes in existing checks ^^ +- Improved :doc:`bugprone-assert-side-effect + ` check by detecting side + effect from calling a method with non-const reference parameters. PiotrZSL wrote:

[clang-tools-extra] Fix crash in modernize-use-ranges (PR #100427)

2024-07-24 Thread Piotr Zegar via cfe-commits
@@ -123,32 +108,34 @@ makeMatcherPair(StringRef State, const UseRangesCheck::Indexes , } void UseRangesCheck::registerMatchers(MatchFinder *Finder) { - Replaces = getReplacerMap(); + auto Replaces = getReplacerMap(); ReverseDescriptor = getReverseDescriptor(); auto

[clang-tools-extra] Fix crash in modernize-use-ranges (PR #100427)

2024-07-24 Thread Piotr Zegar via cfe-commits
https://github.com/PiotrZSL approved this pull request. https://github.com/llvm/llvm-project/pull/100427 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] clang-tidy: readability-redundant-smartptr-get does not remove (#97964) (PR #100177)

2024-07-23 Thread Piotr Zegar via cfe-commits
@@ -498,6 +498,10 @@ Changes in existing checks false-positives when type of the member does not match the type of the initializer. +- Improved :doc:`readability-redundant-smartptr-get PiotrZSL wrote: you may need to rebase, as release notes has been

[clang-tools-extra] clang-tidy: readability-redundant-smartptr-get does not remove (#97964) (PR #100177)

2024-07-23 Thread Piotr Zegar via cfe-commits
https://github.com/PiotrZSL edited https://github.com/llvm/llvm-project/pull/100177 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] clang-tidy: readability-redundant-smartptr-get does not remove (#97964) (PR #100177)

2024-07-23 Thread Piotr Zegar via cfe-commits
https://github.com/PiotrZSL commented: Except release notes, looks fine. https://github.com/llvm/llvm-project/pull/100177 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] Extend support for specifying languages and version in add_new_check.py (PR #100129)

2024-07-23 Thread Piotr Zegar via cfe-commits
https://github.com/PiotrZSL approved this pull request. https://github.com/llvm/llvm-project/pull/100129 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] Extend support for specifying languages and version in add_new_check.py (PR #100129)

2024-07-23 Thread Piotr Zegar via cfe-commits
@@ -53,7 +55,18 @@ def adapt_cmake(module_path, check_name_camel): # Adds a header for the new check. -def write_header(module_path, module, namespace, check_name, check_name_camel): +def write_header( +module_path, module, namespace, check_name, check_name_camel,

[clang-tools-extra] Add a description parameter to the add_new_check script (PR #100111)

2024-07-23 Thread Piotr Zegar via cfe-commits
https://github.com/PiotrZSL approved this pull request. https://github.com/llvm/llvm-project/pull/100111 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] 26c99c4 - [clang-tidy] fix misc-const-correctness to work with function-try-blocks (#99925)

2024-07-23 Thread Piotr Zegar via cfe-commits
Author: Thomas Schenker Date: 2024-07-23T07:38:49Z New Revision: 26c99c421794902b0d929fd9eff81314da55675c URL: https://github.com/llvm/llvm-project/commit/26c99c421794902b0d929fd9eff81314da55675c DIFF: https://github.com/llvm/llvm-project/commit/26c99c421794902b0d929fd9eff81314da55675c.diff

[clang-tools-extra] 2dd82c5 - [clang-tidy][NFC] Added -fexceptions to const-correctness-values.cp

2024-07-23 Thread Piotr Zegar via cfe-commits
Author: Piotr Zegar Date: 2024-07-23T07:38:49Z New Revision: 2dd82c5ac56623d38de977ef027b252b4908e4c5 URL: https://github.com/llvm/llvm-project/commit/2dd82c5ac56623d38de977ef027b252b4908e4c5 DIFF: https://github.com/llvm/llvm-project/commit/2dd82c5ac56623d38de977ef027b252b4908e4c5.diff LOG:

[clang-tools-extra] [clang-tidy] fix misc-const-correctness to work with function-try-blocks (PR #99925)

2024-07-23 Thread Piotr Zegar via cfe-commits
PiotrZSL wrote: Looks like missing -fexceptions https://github.com/llvm/llvm-project/pull/99925 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] Revert "[clang-tidy] fix misc-const-correctness to work with function-try-blocks" (PR #100069)

2024-07-23 Thread Piotr Zegar via cfe-commits
https://github.com/PiotrZSL closed https://github.com/llvm/llvm-project/pull/100069 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] Revert "[clang-tidy] fix misc-const-correctness to work with function-try-blocks" (PR #100069)

2024-07-23 Thread Piotr Zegar via cfe-commits
https://github.com/PiotrZSL created https://github.com/llvm/llvm-project/pull/100069 Reverts llvm/llvm-project#99925 >From a96af6c18ea45269c4d2e1fd762a14d763be0358 Mon Sep 17 00:00:00 2001 From: Piotr Zegar Date: Tue, 23 Jul 2024 08:46:14 +0200 Subject: [PATCH]

[clang-tools-extra] [libc] clang-tidy: readability-redundant-smartptr-get does not remove -> (#97964) (PR #98757)

2024-07-22 Thread Piotr Zegar via cfe-commits
@@ -235,3 +276,13 @@ void Negative() { if (MACRO(x) == nullptr) ; } + +void test_redundant_get() { + std::vector> v; + auto f = [](int) {}; + for (auto i = v.begin(); i != v.end(); ++i) { +f(*i->get()); PiotrZSL wrote: Try with:

[clang-tools-extra] d48d480 - [clang-tidy][NFC] Fix tiny bug in areStatementsIdentical

2024-07-22 Thread Piotr Zegar via cfe-commits
Author: Piotr Zegar Date: 2024-07-22T20:46:48Z New Revision: d48d4805f792adbdac58d480f890449def4964ea URL: https://github.com/llvm/llvm-project/commit/d48d4805f792adbdac58d480f890449def4964ea DIFF: https://github.com/llvm/llvm-project/commit/d48d4805f792adbdac58d480f890449def4964ea.diff LOG:

[clang-tools-extra] [clang-tidy] fix misc-const-correctness to work with function-try-blocks (PR #99925)

2024-07-22 Thread Piotr Zegar via cfe-commits
https://github.com/PiotrZSL approved this pull request. LGTM https://github.com/llvm/llvm-project/pull/99925 ___ 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 misc-const-correctness to work with function-try-blocks (PR #99925)

2024-07-22 Thread Piotr Zegar via cfe-commits
https://github.com/PiotrZSL requested changes to this pull request. Release notes need small fix, except that looks fine https://github.com/llvm/llvm-project/pull/99925 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang-tools-extra] [clang-tidy] fix misc-const-correctness to work with function-try-blocks (PR #99925)

2024-07-22 Thread Piotr Zegar via cfe-commits
@@ -120,6 +120,9 @@ Improvements to clang-tidy - Improved :program:`check_clang_tidy.py` script. Added argument `-export-fixes` to aid in clang-tidy and test development. +- Improved :doc:`misc-const-correctness PiotrZSL wrote: wrong place, this should be

[clang-tools-extra] 04d5003 - [clang-tidy][DOC] Update check documentation

2024-07-22 Thread Piotr Zegar via cfe-commits
Author: Piotr Zegar Date: 2024-07-22T19:31:00Z New Revision: 04d5003f59c1ef10a036d2158f1aa61de506e707 URL: https://github.com/llvm/llvm-project/commit/04d5003f59c1ef10a036d2158f1aa61de506e707 DIFF: https://github.com/llvm/llvm-project/commit/04d5003f59c1ef10a036d2158f1aa61de506e707.diff LOG:

[clang-tools-extra] [libc] clang-tidy: readability-redundant-smartptr-get does not remove -> (#97964) (PR #98757)

2024-07-22 Thread Piotr Zegar via cfe-commits
@@ -235,3 +276,13 @@ void Negative() { if (MACRO(x) == nullptr) ; } + +void test_redundant_get() { + std::vector> v; + auto f = [](int) {}; + for (auto i = v.begin(); i != v.end(); ++i) { +f(*i->get()); PiotrZSL wrote:

[clang-tools-extra] [libc] clang-tidy: readability-redundant-smartptr-get does not remove -> (#97964) (PR #98757)

2024-07-22 Thread Piotr Zegar via cfe-commits
https://github.com/PiotrZSL edited https://github.com/llvm/llvm-project/pull/98757 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] Draft: Create a new check to look for mis-use in calls that take iterators (PR #99917)

2024-07-22 Thread Piotr Zegar via cfe-commits
@@ -400,15 +401,14 @@ Clang-Tidy Checks :doc:`readability-use-std-min-max `, "Yes" :doc:`zircon-temporary-objects `, -Check aliases -- -.. csv-table:: +.. csv-table:: Aliases.. :header: "Name", "Redirect", "Offers fixes"

[clang-tools-extra] [clang-tidy] Add bugprone-move-shared-pointer-contents check. (PR #67467)

2024-07-22 Thread Piotr Zegar via cfe-commits
PiotrZSL wrote: Looks like there are still some merge conflicts, duplicated lines and so on. https://github.com/llvm/llvm-project/pull/67467 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang-tools-extra] [clang-tidy][performance-unnecessary-value-param] Make `handleMoveFix` virtual (PR #99867)

2024-07-22 Thread Piotr Zegar via cfe-commits
https://github.com/PiotrZSL approved this pull request. Please note that at any time in future those functions could be changed no non-virtual again, as there are no tests to guard this. I'm fine with the change, as it provides tiny refactoring. https://github.com/llvm/llvm-project/pull/99867

[clang-tools-extra] [clang-tidy] `bugprone-exception-escape` didn't detech catching of an exception with pointer type by `void *` exception handler (PR #99773)

2024-07-22 Thread Piotr Zegar via cfe-commits
@@ -245,6 +245,10 @@ Changes in existing checks where source is already a ``void``` pointer, making middle ``void`` pointer casts bug-free. +- Improved :doc:`exception-escape ` + check to correctly detect exception handler of type ``CV void *`` as catching all +

[clang-tools-extra] [clang-tidy] `bugprone-exception-escape` didn't detech catching of an exception with pointer type by `void *` exception handler (PR #99773)

2024-07-22 Thread Piotr Zegar via cfe-commits
https://github.com/PiotrZSL edited https://github.com/llvm/llvm-project/pull/99773 ___ 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-exception-escape` didn't detech catching of an exception with pointer type by `void *` exception handler (PR #99773)

2024-07-22 Thread Piotr Zegar via cfe-commits
https://github.com/PiotrZSL approved this pull request. Except bug in release notes looks fine for me. https://github.com/llvm/llvm-project/pull/99773 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang-tools-extra] [libc] clang-tidy: readability-redundant-smartptr-get does not remove -> (#97964) (PR #98757)

2024-07-22 Thread Piotr Zegar via cfe-commits
@@ -235,3 +276,13 @@ void Negative() { if (MACRO(x) == nullptr) ; } + +void test_redundant_get() { + std::vector> v; + auto f = [](int) {}; + for (auto i = v.begin(); i != v.end(); ++i) { +f(*i->get()); PiotrZSL wrote: add method getValue in

[clang-tools-extra] [clang-tidy][cppcoreguidelines-missing-std-forward] Do not warn when the parameter is used in a `static_cast`. (PR #99477)

2024-07-22 Thread Piotr Zegar via cfe-commits
@@ -38,3 +38,14 @@ Example: This check implements `F.19 `_ from the C++ Core Guidelines. + + +Options +--- + +.. option:: IgnoreStaticCasts + +Boolean flag to allow users who want to use the forwarding

[clang-tools-extra] [clang-tidy][cppcoreguidelines-missing-std-forward] Do not warn when the parameter is used in a `static_cast`. (PR #99477)

2024-07-22 Thread Piotr Zegar via cfe-commits
https://github.com/PiotrZSL edited https://github.com/llvm/llvm-project/pull/99477 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy][cppcoreguidelines-missing-std-forward] Do not warn when the parameter is used in a `static_cast`. (PR #99477)

2024-07-22 Thread Piotr Zegar via cfe-commits
@@ -129,15 +131,25 @@ void MissingStdForwardCheck::registerMatchers(MatchFinder *Finder) { unless(anyOf(hasAncestor(typeLoc()), hasAncestor(expr(hasUnevaluatedContext()); + auto StaticCast = + Options.get("IgnoreStaticCasts", false)

[clang-tools-extra] [clang-tidy][cppcoreguidelines-missing-std-forward] Do not warn when the parameter is used in a `static_cast`. (PR #99477)

2024-07-22 Thread Piotr Zegar via cfe-commits
https://github.com/PiotrZSL requested changes to this pull request. Option should be implemented properly, except that, looks fine https://github.com/llvm/llvm-project/pull/99477 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [clang-tools-extra] [llvm] [mlir] [clang][lldb][mlir] Fix some identical sub-expressions warnings (NFC) (PR #95715)

2024-07-22 Thread Piotr Zegar via cfe-commits
@@ -96,7 +96,7 @@ bool areStatementsIdentical(const Stmt *FirstStmt, const Stmt *SecondStmt, if (FirstStmt == SecondStmt) return true; - if (FirstStmt->getStmtClass() != FirstStmt->getStmtClass()) + if (FirstStmt->getStmtClass() != SecondStmt->getStmtClass())

[clang-tools-extra] Ensure functions are anchored in the global namespace (for cert-err-33) (PR #99380)

2024-07-22 Thread Piotr Zegar via cfe-commits
https://github.com/PiotrZSL closed https://github.com/llvm/llvm-project/pull/99380 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [run-clang-tidy.py] Refactor, add progress indicator, add type hints (PR #89490)

2024-07-22 Thread Piotr Zegar via cfe-commits
https://github.com/PiotrZSL closed https://github.com/llvm/llvm-project/pull/89490 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [run-clang-tidy.py] Refactor, add progress indicator, add type hints (PR #89490)

2024-07-21 Thread Piotr Zegar via cfe-commits
https://github.com/PiotrZSL approved this pull request. https://github.com/llvm/llvm-project/pull/89490 ___ 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 modernize-use-cpp-style-comments check (PR #99713)

2024-07-20 Thread Piotr Zegar via cfe-commits
@@ -0,0 +1,38 @@ +//===--- UseCppStyleCommentsCheck.h - 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:

[clang-tools-extra] [clang-tidy] Add modernize-use-cpp-style-comments check (PR #99713)

2024-07-20 Thread Piotr Zegar via cfe-commits
@@ -172,6 +172,11 @@ New checks Detects variables and functions that can be marked as static or moved into an anonymous namespace to enforce internal linkage. +- New :doc:`modernize-use-cpp-style-comments + ` check. + + Find C Style comments and suggests to use C++

[clang-tools-extra] [clang-tidy] Add modernize-use-cpp-style-comments check (PR #99713)

2024-07-20 Thread Piotr Zegar via cfe-commits
@@ -0,0 +1,67 @@ +//===--- UseCppStyleCommentsCheck.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:

[clang-tools-extra] [clang-tidy] Add modernize-use-cpp-style-comments check (PR #99713)

2024-07-20 Thread Piotr Zegar via cfe-commits
@@ -0,0 +1,67 @@ +//===--- UseCppStyleCommentsCheck.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:

[clang-tools-extra] [clang-tidy] Add modernize-use-cpp-style-comments check (PR #99713)

2024-07-20 Thread Piotr Zegar via cfe-commits
https://github.com/PiotrZSL edited https://github.com/llvm/llvm-project/pull/99713 ___ 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 modernize-use-cpp-style-comments check (PR #99713)

2024-07-20 Thread Piotr Zegar via cfe-commits
@@ -0,0 +1,16 @@ +// RUN: %check_clang_tidy -std=c++11 %s modernize-use-cpp-style-comments %t + +static auto PI = 3.14159265; /* value of pi upto 8 decimal places */ +// CHECK-MESSAGES: :[[@LINE-1]]:30: warning: use C++ style comments '//' instead of C style comments '/*...*/'

[clang-tools-extra] [clang-tidy] Add modernize-use-cpp-style-comments check (PR #99713)

2024-07-20 Thread Piotr Zegar via cfe-commits
@@ -0,0 +1,12 @@ +.. title:: clang-tidy - modernize-use-cpp-style-comments + +modernize-use-cpp-style-comments + + +Finds C-style comments and suggests to use C++ style comments `//`. PiotrZSL wrote: this line should be

[clang-tools-extra] [clang-tidy] Add modernize-use-cpp-style-comments check (PR #99713)

2024-07-20 Thread Piotr Zegar via cfe-commits
https://github.com/PiotrZSL requested changes to this pull request. Except nits: - check should fix comments, not delete them. - few tests are missing, with comments in a middle of code https://github.com/llvm/llvm-project/pull/99713 ___ cfe-commits

[clang-tools-extra] [run-clang-tidy.py] Refactor, add progress indicator, add type hints (PR #89490)

2024-07-18 Thread Piotr Zegar via cfe-commits
PiotrZSL wrote: Note: 4 days to branch-out https://github.com/llvm/llvm-project/pull/89490 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy][cppcoreguidelines-missing-std-forward] Do not warn when the parameter is used in a `static_cast`. (PR #99477)

2024-07-18 Thread Piotr Zegar via cfe-commits
https://github.com/PiotrZSL requested changes to this pull request. This shouldn't be default behavior. Add support for this behavior under dedicated option that need to be opt-in. For context, we had problem in our project with some other check recently. Simply check allowed to ignore return

[clang-tools-extra] [clang-tidy][NFC] Fix gsl::not_null template parameter (PR #99472)

2024-07-18 Thread Piotr Zegar via cfe-commits
https://github.com/PiotrZSL closed https://github.com/llvm/llvm-project/pull/99472 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy][NFC] Fix gsl::not_null template parameter (PR #99472)

2024-07-18 Thread Piotr Zegar via cfe-commits
https://github.com/PiotrZSL approved this pull request. https://github.com/llvm/llvm-project/pull/99472 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] 507c18b - [clang-tidy] Few tiny fixes after #99084

2024-07-18 Thread Piotr Zegar via cfe-commits
Author: Piotr Zegar Date: 2024-07-18T18:19:37Z New Revision: 507c18b445ef88d985d95181db8107f669aed998 URL: https://github.com/llvm/llvm-project/commit/507c18b445ef88d985d95181db8107f669aed998 DIFF: https://github.com/llvm/llvm-project/commit/507c18b445ef88d985d95181db8107f669aed998.diff LOG:

[clang-tools-extra] [libc] clang-tidy: readability-redundant-smartptr-get does not remove -> (#97964) (PR #98757)

2024-07-17 Thread Piotr Zegar via cfe-commits
@@ -235,3 +276,13 @@ void Negative() { if (MACRO(x) == nullptr) ; } + +void test_redundant_get() { + std::vector> v; + auto f = [](int) {}; + for (auto i = v.begin(); i != v.end(); ++i) { +f(*i->get()); PiotrZSL wrote: try also do a test with

[clang-tools-extra] [libc] clang-tidy: readability-redundant-smartptr-get does not remove -> (#97964) (PR #98757)

2024-07-17 Thread Piotr Zegar via cfe-commits
@@ -502,6 +502,12 @@ Changes in existing checks usages of ``std::string_view::compare``. Added a `StringLikeClasses` option to detect usages of ``compare`` method in custom string-like classes. +- Improved :doc:`readability-redundant-smartptr-get + ` identify

[clang-tools-extra] [libc] clang-tidy: readability-redundant-smartptr-get does not remove -> (#97964) (PR #98757)

2024-07-17 Thread Piotr Zegar via cfe-commits
@@ -502,6 +502,12 @@ Changes in existing checks usages of ``std::string_view::compare``. Added a `StringLikeClasses` option to detect usages of ``compare`` method in custom string-like classes. +- Improved :doc:`readability-redundant-smartptr-get + ` identify

[clang-tools-extra] [libc] clang-tidy: readability-redundant-smartptr-get does not remove -> (#97964) (PR #98757)

2024-07-17 Thread Piotr Zegar via cfe-commits
@@ -502,6 +502,12 @@ Changes in existing checks usages of ``std::string_view::compare``. Added a `StringLikeClasses` option to detect usages of ``compare`` method in custom string-like classes. +- Improved :doc:`readability-redundant-smartptr-get + ` identify

[clang-tools-extra] Ensure functions are anchored in the global namespace (PR #99084)

2024-07-17 Thread Piotr Zegar via cfe-commits
https://github.com/PiotrZSL closed https://github.com/llvm/llvm-project/pull/99084 ___ 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 modernize-use-std-print/format for fmt (PR #99021)

2024-07-17 Thread Piotr Zegar via cfe-commits
https://github.com/PiotrZSL closed https://github.com/llvm/llvm-project/pull/99021 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] Ensure functions are anchored in the global namespace (PR #99084)

2024-07-17 Thread Piotr Zegar via cfe-commits
https://github.com/PiotrZSL approved this pull request. https://github.com/llvm/llvm-project/pull/99084 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] Add support for std::rotate(_copy) and inplace_merge to modernize-use-ranges (PR #99057)

2024-07-17 Thread Piotr Zegar via cfe-commits
https://github.com/PiotrZSL closed https://github.com/llvm/llvm-project/pull/99057 ___ 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 smart pointers handling in bugprone-use-after-move (PR #94869)

2024-07-16 Thread Piotr Zegar via cfe-commits
https://github.com/PiotrZSL edited https://github.com/llvm/llvm-project/pull/94869 ___ 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 smart pointers handling in bugprone-use-after-move (PR #94869)

2024-07-16 Thread Piotr Zegar via cfe-commits
https://github.com/PiotrZSL updated https://github.com/llvm/llvm-project/pull/94869 >From ceeb4006d54b40a226a7a1f4f78f7f5f9d9dd7a1 Mon Sep 17 00:00:00 2001 From: Piotr Zegar Date: Tue, 16 Jul 2024 18:34:25 + Subject: [PATCH] [clang-tidy] Fix smart pointers handling in

[clang-tools-extra] Add support for std::rotate(_copy) and inplace_merge to modernize-use-ranges (PR #99057)

2024-07-16 Thread Piotr Zegar via cfe-commits
https://github.com/PiotrZSL approved this pull request. LGTM, some tests for rotate_copy and implace_merge would be welcome but it isn't must as it work similar to rotate. https://github.com/llvm/llvm-project/pull/99057 ___ cfe-commits mailing list

[clang-tools-extra] [clang-tidy] Fix modernize-use-std-print/format for fmt (PR #99021)

2024-07-16 Thread Piotr Zegar via cfe-commits
https://github.com/PiotrZSL approved this pull request. LGTM https://github.com/llvm/llvm-project/pull/99021 ___ 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 false in unnecessary-value-param inside templates (PR #98488)

2024-07-15 Thread Piotr Zegar via cfe-commits
https://github.com/PiotrZSL commented: Release notes entry is missing. https://github.com/llvm/llvm-project/pull/98488 ___ 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-implicit-widening ignores const exprs that fit (PR #98352)

2024-07-15 Thread Piotr Zegar via cfe-commits
https://github.com/PiotrZSL closed https://github.com/llvm/llvm-project/pull/98352 ___ 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-implicit-widening ignores const exprs that fit (PR #98352)

2024-07-15 Thread Piotr Zegar via cfe-commits
@@ -0,0 +1,56 @@ +// RUN: %check_clang_tidy %s bugprone-implicit-widening-of-multiplication-result %t -- \ +// RUN: -config='{CheckOptions: { \ +// RUN: bugprone-implicit-widening-of-multiplication-result.IgnoreConstantIntExpr: true \ +// RUN: }}' -- -target

[clang-tools-extra] [clang-tidy] bugprone-implicit-widening ignores const exprs that fit (PR #98352)

2024-07-15 Thread Piotr Zegar via cfe-commits
https://github.com/PiotrZSL approved this pull request. I will merge this, as change looks fine at first glance. Any new fixes/changes please push in separate review. https://github.com/llvm/llvm-project/pull/98352 ___ cfe-commits mailing list

[clang-tools-extra] [clang-tidy] bugprone-implicit-widening ignores const exprs that fit (PR #98352)

2024-07-15 Thread Piotr Zegar via cfe-commits
https://github.com/PiotrZSL edited https://github.com/llvm/llvm-project/pull/98352 ___ 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-implicit-widening ignores const exprs that fit (PR #98352)

2024-07-15 Thread Piotr Zegar via cfe-commits
@@ -50,7 +50,7 @@ Options If the multiplication operands are compile-time constants (like literals or are ``constexpr``) and fit within the source expression type, do not emit a diagnostic or suggested fix. Only considers expressions where the source - expression

[clang-tools-extra] [libc] clang-tidy: readability-redundant-smartptr-get does not remove -> (#97964) (PR #98757)

2024-07-15 Thread Piotr Zegar via cfe-commits
@@ -18,7 +18,6 @@ add_entrypoint_object( SRCS libc_errno.cpp HDRS -errno.h PiotrZSL wrote: not related change, revert https://github.com/llvm/llvm-project/pull/98757 ___ cfe-commits mailing list

[clang-tools-extra] [libc] clang-tidy: readability-redundant-smartptr-get does not remove -> (#97964) (PR #98757)

2024-07-15 Thread Piotr Zegar via cfe-commits
@@ -502,6 +502,12 @@ Changes in existing checks usages of ``std::string_view::compare``. Added a `StringLikeClasses` option to detect usages of ``compare`` method in custom string-like classes. +- Improved :doc:`readability-redundant-smartptr-get + ` identify

[clang-tools-extra] [libc] clang-tidy: readability-redundant-smartptr-get does not remove -> (#97964) (PR #98757)

2024-07-15 Thread Piotr Zegar via cfe-commits
https://github.com/PiotrZSL edited https://github.com/llvm/llvm-project/pull/98757 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [libc] clang-tidy: readability-redundant-smartptr-get does not remove -> (#97964) (PR #98757)

2024-07-15 Thread Piotr Zegar via cfe-commits
https://github.com/PiotrZSL requested changes to this pull request. Fix release notes, and remove not related changed to errno (i assume due to merge). fell free to rebase branch if needed https://github.com/llvm/llvm-project/pull/98757 ___

[clang-tools-extra] Allow unnecessary-value-param to match templated functions including lambdas with auto. (PR #97767)

2024-07-15 Thread Piotr Zegar via cfe-commits
https://github.com/PiotrZSL closed https://github.com/llvm/llvm-project/pull/97767 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] Allow specifying pipe syntax for use-ranges checks (PR #98696)

2024-07-15 Thread Piotr Zegar via cfe-commits
https://github.com/PiotrZSL closed https://github.com/llvm/llvm-project/pull/98696 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] Allow specifying pipe syntax for use-ranges checks (PR #98696)

2024-07-15 Thread Piotr Zegar via cfe-commits
@@ -166,6 +166,15 @@ utils::UseRangesCheck::ReplacerMap UseRangesCheck::getReplacerMap() const { return Result; } +UseRangesCheck::UseRangesCheck(StringRef Name, ClangTidyContext *Context) +: utils::UseRangesCheck(Name, Context), +

[clang-tools-extra] Allow unnecessary-value-param to match templated functions including lambdas with auto. (PR #97767)

2024-07-15 Thread Piotr Zegar via cfe-commits
https://github.com/PiotrZSL approved this pull request. https://github.com/llvm/llvm-project/pull/97767 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] clang-tidy: readability-redundant-smartptr-get does not remove -> (#97964) (PR #98757)

2024-07-14 Thread Piotr Zegar via cfe-commits
PiotrZSL wrote: > can you tell me where to add test case and release notes entry Tests: clang-tools-extra/test/clang-tidy/checkers/readability/redundant-smartptr-get.cpp Release notes: clang-tools-extra/docs/ReleaseNotes.rst https://github.com/llvm/llvm-project/pull/98757

[clang-tools-extra] clang-tidy: readability-redundant-smartptr-get does not remove -> (#97964) (PR #98757)

2024-07-14 Thread Piotr Zegar via cfe-commits
https://github.com/PiotrZSL edited https://github.com/llvm/llvm-project/pull/98757 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] clang-tidy: readability-redundant-smartptr-get does not remove -> (#97964) (PR #98757)

2024-07-13 Thread Piotr Zegar via cfe-commits
PiotrZSL wrote: > I am not sure if I need to write a test case for clang-tidy Yes, and release notes entry, https://github.com/llvm/llvm-project/pull/98757 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang-tools-extra] Allow specifying pipe syntax for use-ranges checks (PR #98696)

2024-07-13 Thread Piotr Zegar via cfe-commits
@@ -166,6 +166,15 @@ utils::UseRangesCheck::ReplacerMap UseRangesCheck::getReplacerMap() const { return Result; } +UseRangesCheck::UseRangesCheck(StringRef Name, ClangTidyContext *Context) +: utils::UseRangesCheck(Name, Context), +

[clang-tools-extra] Allow specifying pipe syntax for use-ranges checks (PR #98696)

2024-07-13 Thread Piotr Zegar via cfe-commits
@@ -170,3 +170,18 @@ Options If `true` (default value) the boost headers are included as system headers with angle brackets (`#include `), otherwise quotes are used (`#include "boost.hpp"`). + +.. option:: UseReversePipe + + When `true` (default `false`), fixes which

[clang-tools-extra] Allow specifying pipe syntax for use-ranges checks (PR #98696)

2024-07-13 Thread Piotr Zegar via cfe-commits
https://github.com/PiotrZSL approved this pull request. Looks fine, even in this state https://github.com/llvm/llvm-project/pull/98696 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] Allow specifying pipe syntax for use-ranges checks (PR #98696)

2024-07-13 Thread Piotr Zegar via cfe-commits
https://github.com/PiotrZSL edited https://github.com/llvm/llvm-project/pull/98696 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy] Ignore requires expr in bugprone-assignment-in-if-condition (PR #98079)

2024-07-12 Thread Piotr Zegar via cfe-commits
https://github.com/PiotrZSL closed https://github.com/llvm/llvm-project/pull/98079 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] Fix the docs for the boost/modernize use-ranges checks (PR #98662)

2024-07-12 Thread Piotr Zegar via cfe-commits
https://github.com/PiotrZSL closed https://github.com/llvm/llvm-project/pull/98662 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] Fix the docs for the boost/modernize use-ranges checks (PR #98662)

2024-07-12 Thread Piotr Zegar via cfe-commits
https://github.com/PiotrZSL approved this pull request. Those functions could be listed as an bullet points. But anyway lest, merge this and check if this fixes issues. https://github.com/llvm/llvm-project/pull/98662 ___ cfe-commits mailing list

[clang-tools-extra] [libc] Update libc namespace clang-tidy checks (PR #98424)

2024-07-11 Thread Piotr Zegar via cfe-commits
https://github.com/PiotrZSL approved this pull request. LGTM https://github.com/llvm/llvm-project/pull/98424 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [libc] Update libc namespace clang-tidy checks (PR #98424)

2024-07-11 Thread Piotr Zegar via cfe-commits
@@ -30,20 +30,35 @@ void ImplementationInNamespaceCheck::check( const auto *MatchedDecl = Result.Nodes.getNodeAs("child_of_translation_unit"); const auto *NS = dyn_cast(MatchedDecl); + + // LLVM libc declarations should be inside of a non-anonymous namespace. if

[clang-tools-extra] [clang-tidy] bugprone-implicit-widening ignores const exprs that fit (PR #98352)

2024-07-10 Thread Piotr Zegar via cfe-commits
PiotrZSL wrote: You could also mention in documentation of option that those issues are detected by compiler warning: `-Winteger-overflow` https://github.com/llvm/llvm-project/pull/98352 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang-tools-extra] [clang-tidy] bugprone-implicit-widening ignores const exprs that fit (PR #98352)

2024-07-10 Thread Piotr Zegar via cfe-commits
@@ -45,6 +45,12 @@ Options should header be suggested, or . Defaults to ``true``. +.. option:: IgnoreConstantIntExpr + + If the multiplication operands are compile-time constants (like literals or + are ``constexpr``) and fit within the source expression

[clang-tools-extra] [clang-tidy] bugprone-implicit-widening ignores const exprs that fit (PR #98352)

2024-07-10 Thread Piotr Zegar via cfe-commits
https://github.com/PiotrZSL edited https://github.com/llvm/llvm-project/pull/98352 ___ 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-implicit-widening ignores const exprs that fit (PR #98352)

2024-07-10 Thread Piotr Zegar via cfe-commits
@@ -84,6 +86,19 @@ void ImplicitWideningOfMultiplicationResultCheck::handleImplicitCastExpr( if (TgtWidth <= SrcWidth) return; + // Is the expression a compile-time constexpr that we know can fit in the + // source type? + if (IgnoreConstantIntExpr &&

[clang-tools-extra] [clang-tidy] bugprone-implicit-widening ignores const exprs that fit (PR #98352)

2024-07-10 Thread Piotr Zegar via cfe-commits
@@ -0,0 +1,81 @@ +// RUN: %check_clang_tidy -check-suffixes=ALL,NI %s bugprone-implicit-widening-of-multiplication-result %t -- -- -target x86_64-unknown-unknown -x c++ PiotrZSL wrote: i have feeling that this test isn't needed here at all, and second would be

[clang-tools-extra] [clang-tidy] bugprone-implicit-widening ignores const exprs that fit (PR #98352)

2024-07-10 Thread Piotr Zegar via cfe-commits
@@ -0,0 +1,81 @@ +// RUN: %check_clang_tidy -check-suffixes=ALL,NI %s bugprone-implicit-widening-of-multiplication-result %t -- -- -target x86_64-unknown-unknown -x c++ +// RUN: %check_clang_tidy -check-suffixes=ALL %s bugprone-implicit-widening-of-multiplication-result %t --

[clang-tools-extra] [clang-tidy] bugprone-implicit-widening ignores const exprs that fit (PR #98352)

2024-07-10 Thread Piotr Zegar via cfe-commits
https://github.com/PiotrZSL commented: Missing release notes entry about added new config options for check. https://github.com/llvm/llvm-project/pull/98352 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang-tools-extra] [clang-tidy] let UseAfterMoveFinder::find() return an optional (PR #98100)

2024-07-10 Thread Piotr Zegar via cfe-commits
https://github.com/PiotrZSL closed https://github.com/llvm/llvm-project/pull/98100 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

  1   2   3   4   5   6   7   8   9   10   >