[clang-tools-extra] [clang-tidy][modernize-use-starts-ends-with] Add support for compare() (PR #89530)

2024-04-21 Thread Piotr Zegar via cfe-commits
https://github.com/PiotrZSL approved this pull request. Looks +- fine, I just worry a little bit about performance. But as "HasStringAndLengthArguments" will be executed only for an compare methods, then probably it could be fine. https://github.com/llvm/llvm-project/pull/89530

[clang-tools-extra] [clang-tidy][modernize-use-starts-ends-with] Add support for compare() (PR #89530)

2024-04-21 Thread Piotr Zegar via cfe-commits
@@ -298,6 +298,10 @@ Changes in existing checks check by resolving fix-it overlaps in template code by disregarding implicit instances. +- Improved :doc:`modernize-use-starts-ends-with + ` check to also handle + cases using `compare()`. PiotrZSL wrote:

[clang-tools-extra] [clang-tidy][modernize-use-starts-ends-with] Add support for compare() (PR #89530)

2024-04-21 Thread Piotr Zegar via cfe-commits
@@ -16,6 +16,49 @@ using namespace clang::ast_matchers; namespace clang::tidy::modernize { +namespace { +// Given two argument indices X and Y, matches when a call expression has a +// string at index X with an expression representing that string's length at +// index Y. The s

[clang-tools-extra] [clang-tidy][modernize-use-starts-ends-with] Add support for compare() (PR #89530)

2024-04-21 Thread Piotr Zegar via cfe-commits
@@ -16,6 +16,49 @@ using namespace clang::ast_matchers; namespace clang::tidy::modernize { +namespace { +// Given two argument indices X and Y, matches when a call expression has a +// string at index X with an expression representing that string's length at +// index Y. The s

[clang-tools-extra] [clang-tidy][modernize-use-starts-ends-with] Add support for compare() (PR #89530)

2024-04-21 Thread Piotr Zegar via cfe-commits
@@ -16,6 +16,75 @@ using namespace clang::ast_matchers; namespace clang::tidy::modernize { +namespace { +// Given two argument indices X and Y, matches when a call expression has a +// string at index X with an expression representing that string's length at +// index Y. The s

[clang-tools-extra] [clang-tidy] Avoid overflow when dumping unsigned integer values (PR #85060)

2024-04-22 Thread Piotr Zegar via cfe-commits
https://github.com/PiotrZSL approved this pull request. - One code duplication that could be avoided. - Add entry in release notes, about fixing issue with big unsigned config option values printed as negative numbers in --dump-config Overall, fine. As for misc-throw-by-value-catch-by-reference

[clang-tools-extra] [clang-tidy] Avoid overflow when dumping unsigned integer values (PR #85060)

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

[clang-tools-extra] [clang-tidy] Avoid overflow when dumping unsigned integer values (PR #85060)

2024-04-22 Thread Piotr Zegar via cfe-commits
@@ -422,7 +425,10 @@ class ClangTidyCheck : public ast_matchers::MatchFinder::MatchCallback { store(ClangTidyOptions::OptionMap &Options, StringRef LocalName, std::optional Value) const { if (Value) -storeInt(Options, LocalName, *Value); +if

[clang-tools-extra] [clang-tidy] check `std::string_view` and custom string-like classes in `readability-string-compare` (PR #88636)

2024-04-22 Thread Piotr Zegar via cfe-commits
https://github.com/PiotrZSL approved this pull request. Looks fine for me. https://github.com/llvm/llvm-project/pull/88636 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy] check `std::string_view` and custom string-like classes in `readability-string-compare` (PR #88636)

2024-04-22 Thread Piotr Zegar via cfe-commits
@@ -7,42 +7,70 @@ //===--===// #include "StringCompareCheck.h" -#include "../utils/FixItHintUtils.h" +#include "../utils/OptionsUtils.h" #include "clang/AST/ASTContext.h" #include "clang/ASTMatchers/ASTMatc

[clang-tools-extra] [clang-tidy] Avoid overflow when dumping unsigned integer values (PR #85060)

2024-04-22 Thread Piotr Zegar via cfe-commits
@@ -251,6 +251,9 @@ Miscellaneous option is specified. Now ``clang-apply-replacements`` applies formatting only with the option. +- Fixed bug where big values for unsigned check options overflowed into negative values + when being printed with ``--dump-config``. ---

[clang-tools-extra] [clang-tidy] Avoid overflow when dumping unsigned integer values (PR #85060)

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

[clang-tools-extra] [clang-tidy] Improved --verify-config when using literal style in config file (PR #85591)

2024-04-22 Thread Piotr Zegar via cfe-commits
=?utf-8?q?Félix-Antoine?= Constantin, =?utf-8?q?Félix-Antoine?= Constantin, =?utf-8?q?Félix-Antoine?= Constantin, =?utf-8?q?Félix-Antoine?= Constantin Message-ID: In-Reply-To: https://github.com/PiotrZSL closed https://github.com/llvm/llvm-project/pull/85591

[clang-tools-extra] [clang-tidy] Improved --verify-config when using literal style in config file (PR #85591)

2024-04-22 Thread Piotr Zegar via cfe-commits
=?utf-8?q?Félix-Antoine?= Constantin, =?utf-8?q?Félix-Antoine?= Constantin, =?utf-8?q?Félix-Antoine?= Constantin, =?utf-8?q?Félix-Antoine?= Constantin Message-ID: In-Reply-To: @@ -454,52 +454,31 @@ static constexpr StringLiteral VerifyConfigWarningEnd = " [-verify-config]\n";

[clang-tools-extra] [clang-tidy] Avoid overflow when dumping unsigned integer values (PR #85060)

2024-04-22 Thread Piotr Zegar via cfe-commits
PiotrZSL wrote: Unless you want this to be merged as 115098653+ealc...@users.noreply.github.com, change your email privacy settings. https://github.com/llvm/llvm-project/pull/85060 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.

[clang-tools-extra] [clang-tidy] Avoid overflow when dumping unsigned integer values (PR #85060)

2024-04-22 Thread Piotr Zegar via cfe-commits
https://github.com/PiotrZSL updated https://github.com/llvm/llvm-project/pull/85060 >From 07248879092c0e752811b4c33b98c50d42230d14 Mon Sep 17 00:00:00 2001 From: Daniel Alcaide Nombela Date: Wed, 13 Mar 2024 11:28:34 +0100 Subject: [PATCH] [clang-tidy] Avoid overflow when dumping unsigned integ

[clang-tools-extra] [clang-tidy] add check to suggest replacement of nested std::min or std::max with initializer lists (PR #85572)

2024-04-22 Thread Piotr Zegar via cfe-commits
@@ -0,0 +1,274 @@ +//===--- MinMaxUseInitializerListCheck.cpp - clang-tidy ---===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Ap

[clang-tools-extra] [clang-tidy] add check to suggest replacement of nested std::min or std::max with initializer lists (PR #85572)

2024-04-22 Thread Piotr Zegar via cfe-commits
https://github.com/PiotrZSL edited https://github.com/llvm/llvm-project/pull/85572 ___ 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 to suggest replacement of nested std::min or std::max with initializer lists (PR #85572)

2024-04-22 Thread Piotr Zegar via cfe-commits
https://github.com/PiotrZSL approved this pull request. Except few pointed out nits, looks fine to me. Would be nice to run it on some bigger project like llvm or something. https://github.com/llvm/llvm-project/pull/85572 ___ cfe-commits mailing list c

[clang-tools-extra] [clang-tidy] add check to suggest replacement of nested std::min or std::max with initializer lists (PR #85572)

2024-04-22 Thread Piotr Zegar via cfe-commits
@@ -0,0 +1,274 @@ +//===--- MinMaxUseInitializerListCheck.cpp - clang-tidy ---===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Ap

[clang-tools-extra] [clang-tidy] add check to suggest replacement of nested std::min or std::max with initializer lists (PR #85572)

2024-04-22 Thread Piotr Zegar via cfe-commits
@@ -0,0 +1,274 @@ +//===--- MinMaxUseInitializerListCheck.cpp - clang-tidy ---===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Ap

[clang-tools-extra] [clang-tidy] add check to suggest replacement of nested std::min or std::max with initializer lists (PR #85572)

2024-04-22 Thread Piotr Zegar via cfe-commits
@@ -0,0 +1,274 @@ +//===--- MinMaxUseInitializerListCheck.cpp - clang-tidy ---===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Ap

[clang-tools-extra] [clang-tidy] add check to suggest replacement of nested std::min or std::max with initializer lists (PR #85572)

2024-04-22 Thread Piotr Zegar via cfe-commits
@@ -0,0 +1,45 @@ +.. title:: clang-tidy - modernize-min-max-use-initializer-list + +modernize-min-max-use-initializer-list +== + +Replaces nested ``std::min`` and ``std::max`` calls with an initializer list where applicable. + +For instance, co

[clang-tools-extra] [clang-tidy] add check to suggest replacement of nested std::min or std::max with initializer lists (PR #85572)

2024-04-22 Thread Piotr Zegar via cfe-commits
@@ -0,0 +1,274 @@ +//===--- MinMaxUseInitializerListCheck.cpp - clang-tidy ---===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Ap

[clang-tools-extra] [clang-tidy] add check to suggest replacement of nested std::min or std::max with initializer lists (PR #85572)

2024-04-22 Thread Piotr Zegar via cfe-commits
@@ -0,0 +1,45 @@ +.. title:: clang-tidy - modernize-min-max-use-initializer-list + +modernize-min-max-use-initializer-list +== + +Replaces nested ``std::min`` and ``std::max`` calls with an initializer list where applicable. + +For instance, co

[clang-tools-extra] [clang-tidy] add check to suggest replacement of nested std::min or std::max with initializer lists (PR #85572)

2024-04-22 Thread Piotr Zegar via cfe-commits
@@ -0,0 +1,274 @@ +//===--- MinMaxUseInitializerListCheck.cpp - clang-tidy ---===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Ap

[clang-tools-extra] [clang-tidy] add check to suggest replacement of nested std::min or std::max with initializer lists (PR #85572)

2024-04-22 Thread Piotr Zegar via cfe-commits
@@ -80,27 +80,26 @@ static SmallVector generateReplacements(const MatchFinder::MatchResult &Match, const CallExpr *TopCall, const FindArgsResult &Result, const bool IgnoreNonTrivialTypes, - const unsigned long Ignore

[clang-tools-extra] [clang-tidy] add check to suggest replacement of nested std::min or std::max with initializer lists (PR #85572)

2024-04-22 Thread Piotr Zegar via cfe-commits
@@ -0,0 +1,56 @@ +//===--- MinMaxUseInitializerListCheck.h - clang-tidy ---*- C++ -*-===// +// +// 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: Apa

[clang-tools-extra] [clang-tidy] add check to suggest replacement of nested std::min or std::max with initializer lists (PR #85572)

2024-04-22 Thread Piotr Zegar via cfe-commits
@@ -0,0 +1,50 @@ +.. title:: clang-tidy - modernize-min-max-use-initializer-list + +modernize-min-max-use-initializer-list +== + +Replaces nested ``std::min`` and ``std::max`` calls with an initializer list +where applicable. + +For instance, c

[clang-tools-extra] [clang-tidy] add check to suggest replacement of nested std::min or std::max with initializer lists (PR #85572)

2024-04-22 Thread Piotr Zegar via cfe-commits
@@ -47,7 +47,7 @@ class MinMaxUseInitializerListCheck : public ClangTidyCheck { private: bool IgnoreNonTrivialTypes; - unsigned long IgnoreTrivialTypesOfSizeAbove; + long IgnoreTrivialTypesOfSizeAbove; PiotrZSL wrote: why change into signed ? Unsigned wer

[clang-tools-extra] [clang-tidy] add check to suggest replacement of nested std::min or std::max with initializer lists (PR #85572)

2024-04-22 Thread Piotr Zegar via cfe-commits
@@ -0,0 +1,274 @@ +//===--- MinMaxUseInitializerListCheck.cpp - clang-tidy ---===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Ap

[clang-tools-extra] [clang-tidy] add check to suggest replacement of nested std::min or std::max with initializer lists (PR #85572)

2024-04-22 Thread Piotr Zegar via cfe-commits
@@ -0,0 +1,274 @@ +//===--- MinMaxUseInitializerListCheck.cpp - clang-tidy ---===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Ap

[clang-tools-extra] [clang-tidy] add check to suggest replacement of nested std::min or std::max with initializer lists (PR #85572)

2024-04-22 Thread Piotr Zegar via cfe-commits
https://github.com/PiotrZSL requested changes to this pull request. Fix sanitizer issue. https://github.com/llvm/llvm-project/pull/85572 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy] Avoid overflow when dumping unsigned integer values (PR #85060)

2024-04-23 Thread Piotr Zegar via cfe-commits
https://github.com/PiotrZSL closed https://github.com/llvm/llvm-project/pull/85060 ___ 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-22 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] =?UTF-8?q?Revert=20"[clang-tidy]

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

2024-07-22 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] [clang-tidy] fix misc-const-correctness to work with function-try-blocks (PR #99925)

2024-07-22 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] 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] 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 LO

[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] 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, lang_re

[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] 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] 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
@@ -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 clea

[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] 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 &Indexes, } void UseRangesCheck::registerMatchers(MatchFinder *Finder) { - Replaces = getReplacerMap(); + auto Replaces = getReplacerMap(); ReverseDescriptor = getReverseDescriptor();

[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: still

[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 Se

[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] 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] [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] [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] 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-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 cf

[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 bugprone-use-after-mo

[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] 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] 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] [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 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] [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] [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 some

[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] [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] [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][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] [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] Add modernize-use-cpp-style-comments check (PR #99713)

2024-07-19 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 ma

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

2024-07-19 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 synchronize

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

2024-07-19 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 '/*...*/' [m

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

2024-07-19 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-19 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: A

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

2024-07-19 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: A

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

2024-07-19 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++ style

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

2024-07-19 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: Apa

[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] [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] 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] [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] [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 https://lists.ll

[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 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
@@ -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] [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 examp

[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 https://lists.llvm.org/cgi-bin/mailman/listin

[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
@@ -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 + ``CV`

[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] 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 https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-com

[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" :doc:`bugprone-narrowing-c

[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] [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: `f(i->get()->get()->getValue

[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] [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] [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 https://lists.llvm.org/cgi-

[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] 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: [

<    14   15   16   17   18   19   20   21   22   23   >