[clang-tools-extra] [clang] [clang-tidy] fix match for binaryOperator in ExprMutationAnalyzer for misc-const-correctness (PR #70559)

2023-11-08 Thread Julian Schmidt via cfe-commits
https://github.com/5chmidti updated https://github.com/llvm/llvm-project/pull/70559 >From b29eb35fe8597ceefc4c615817174181a16f3c4c Mon Sep 17 00:00:00 2001 From: Julian Schmidt <44101708+5chmi...@users.noreply.github.com> Date: Sat, 28 Oct 2023 18:08:51 +0200 Subject: [PATCH 1/3] [clang-tidy] fi

[clang-tools-extra] [clang] [clang-tidy] fix match for binaryOperator in ExprMutationAnalyzer for misc-const-correctness (PR #70559)

2023-11-08 Thread Julian Schmidt via cfe-commits
5chmidti wrote: > how about adding a function call like `f()`? will this can prevent clang > to emit empty function body? Yep, thanks. I went this route, but I had to define a conversion operator to compile and keep the `<<` a `BinaryOperator`. The CI now passes https://github.com/llvm/llvm-p

[clang-tools-extra] [clangd] Let DefineOutline tweak create a definition from scratch (PR #71950)

2023-11-10 Thread Julian Schmidt via cfe-commits
5chmidti wrote: This implements clangd/clangd#445 https://github.com/llvm/llvm-project/pull/71950 ___ 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 match for binaryOperator in ExprMutationAnalyzer for misc-const-correctness (PR #70559)

2023-11-12 Thread Julian Schmidt via cfe-commits
https://github.com/5chmidti updated https://github.com/llvm/llvm-project/pull/70559 >From b29eb35fe8597ceefc4c615817174181a16f3c4c Mon Sep 17 00:00:00 2001 From: Julian Schmidt <44101708+5chmi...@users.noreply.github.com> Date: Sat, 28 Oct 2023 18:08:51 +0200 Subject: [PATCH 1/4] [clang-tidy] fi

[clang] [clang][ASTMatcher] Add matchers for CXXFoldExpr (PR #71245)

2023-11-12 Thread Julian Schmidt via cfe-commits
5chmidti wrote: Could someone please reapply the `clang` label to trigger the pr subscriber action? https://github.com/llvm/llvm-project/pull/71245 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo

[clang-tools-extra] [clang] [clang-tidy] fix match for binaryOperator in ExprMutationAnalyzer for misc-const-correctness (PR #70559)

2023-11-12 Thread Julian Schmidt via cfe-commits
5chmidti wrote: > In tests we usually use `-fno-delayed-template-parsing` to overcome this > issue with templates and windows. Done. I changed the test in `ExprMutationAnalyzerTest.cpp` to use the flag, `const-correctness-templates.cpp` already had it, and I changed the tested code back to wh

[clang] [clang-tools-extra] [clang-tidy] fix match for binaryOperator in ExprMutationAnalyzer for misc-const-correctness (PR #70559)

2023-11-12 Thread Julian Schmidt via cfe-commits
https://github.com/5chmidti updated https://github.com/llvm/llvm-project/pull/70559 >From b29eb35fe8597ceefc4c615817174181a16f3c4c Mon Sep 17 00:00:00 2001 From: Julian Schmidt <44101708+5chmi...@users.noreply.github.com> Date: Sat, 28 Oct 2023 18:08:51 +0200 Subject: [PATCH 1/5] [clang-tidy] fi

[clang] [clang-tools-extra] [clang-tidy] fix match for binaryOperator in ExprMutationAnalyzer for misc-const-correctness (PR #70559)

2023-11-12 Thread Julian Schmidt via cfe-commits
@@ -308,6 +308,11 @@ Changes in existing checks ` check to avoid false positive when using pointer to member function. +- Improved :doc:`misc-const-correctness 5chmidti wrote: Done. I have also reworded the release note, I think it reads better now. htt

[clang] [clang-tools-extra] [clang-tidy] fix match for binaryOperator in ExprMutationAnalyzer for misc-const-correctness (PR #70559)

2023-11-13 Thread Julian Schmidt via cfe-commits
https://github.com/5chmidti updated https://github.com/llvm/llvm-project/pull/70559 >From b29eb35fe8597ceefc4c615817174181a16f3c4c Mon Sep 17 00:00:00 2001 From: Julian Schmidt <44101708+5chmi...@users.noreply.github.com> Date: Sat, 28 Oct 2023 18:08:51 +0200 Subject: [PATCH 1/6] [clang-tidy] fi

[clang] [clang-tools-extra] [clang-tidy] fix match for binaryOperator in ExprMutationAnalyzer for misc-const-correctness (PR #70559)

2023-11-13 Thread Julian Schmidt via cfe-commits
@@ -307,11 +307,9 @@ Changes in existing checks - Improved :doc:`misc-const-correctness ` check to avoid false positive when using pointer to member function. - -- Improved :doc:`misc-const-correctness - ` check to not warn on uses in - type-dependent binary operators, w

[clang-tools-extra] [clang-tidy] add modernize-use-std-numbers (PR #66583)

2023-12-04 Thread Julian Schmidt via cfe-commits
@@ -0,0 +1,58 @@ +.. title:: clang-tidy - modernize-use-std-numbers + +modernize-use-std-numbers += + +Finds constants and function calls to math functions that can be replaced +with c++20's mathematical constants from the ``numbers`` header and offers +fix

[clang-tools-extra] [clang-tidy] add modernize-use-std-numbers (PR #66583)

2023-12-04 Thread Julian Schmidt via cfe-commits
5chmidti wrote: Force push to resolve conflicts https://github.com/llvm/llvm-project/pull/66583 ___ 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-std-numbers (PR #66583)

2023-12-04 Thread Julian Schmidt via cfe-commits
5chmidti wrote: I fetched from the wrong remote. Conflicts are resolved. The options docs were added in 284fa1b94ef72c29f13a2ec50ca76b429c842b0c https://github.com/llvm/llvm-project/pull/66583 ___ cfe-commits mailing list cfe-commits@lists.llvm.org ht

[clang-tools-extra] [clang-tidy] add modernize-use-std-numbers (PR #66583)

2023-12-05 Thread Julian Schmidt via cfe-commits
5chmidti wrote: That email is fine with me https://github.com/llvm/llvm-project/pull/66583 ___ 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-std-numbers (PR #66583)

2023-12-05 Thread Julian Schmidt via cfe-commits
@@ -0,0 +1,74 @@ +.. title:: clang-tidy - modernize-use-std-numbers + +modernize-use-std-numbers += + +Finds constants and function calls to math functions that can be replaced +with c++20's mathematical constants from the ``numbers`` header and offers +fix

[clang-tools-extra] [clang-tidy] add modernize-use-std-numbers (PR #66583)

2023-12-05 Thread Julian Schmidt via cfe-commits
@@ -0,0 +1,74 @@ +.. title:: clang-tidy - modernize-use-std-numbers + +modernize-use-std-numbers += + +Finds constants and function calls to math functions that can be replaced +with c++20's mathematical constants from the ``numbers`` header and offers +fix

[clang-tools-extra] [clang-tidy] add modernize-use-std-numbers (PR #66583)

2023-12-05 Thread Julian Schmidt via cfe-commits
@@ -193,6 +193,13 @@ New checks replacing with ``starts_with`` when the method exists in the class. Notably, this will work with ``std::string`` and ``std::string_view``. +- New :doc:`modernize-use-std-numbers + ` check. + + Finds constants and function calls to math fun

[clang-tools-extra] [clang-tidy] add modernize-use-std-numbers (PR #66583)

2023-12-05 Thread Julian Schmidt via cfe-commits
@@ -5,7 +5,7 @@ modernize-use-std-numbers Finds constants and function calls to math functions that can be replaced with c++20's mathematical constants from the ``numbers`` header and offers fix-it hints. -Does not match the use of variables or macros with that value and inst

[clang-tools-extra] [clang-tidy] add modernize-use-std-numbers (PR #66583)

2023-12-05 Thread Julian Schmidt via cfe-commits
@@ -193,6 +193,13 @@ New checks replacing with ``starts_with`` when the method exists in the class. Notably, this will work with ``std::string`` and ``std::string_view``. +- New :doc:`modernize-use-std-numbers + ` check. + + Finds constants and function calls to math fun

[clang-tools-extra] [clang-tidy] add modernize-use-std-numbers (PR #66583)

2023-12-05 Thread Julian Schmidt via cfe-commits
@@ -0,0 +1,73 @@ +.. title:: clang-tidy - modernize-use-std-numbers + +modernize-use-std-numbers += + +Finds constants and function calls to math functions that can be replaced +with c++20's mathematical constants from the ``numbers`` header and offers

[clang-tools-extra] [clang-tidy] add modernize-use-std-numbers (PR #66583)

2023-12-05 Thread Julian Schmidt via cfe-commits
@@ -0,0 +1,73 @@ +.. title:: clang-tidy - modernize-use-std-numbers + +modernize-use-std-numbers += + +Finds constants and function calls to math functions that can be replaced +with c++20's mathematical constants from the ``numbers`` header and offers +fix

[clang-tools-extra] [clang-tidy] add modernize-use-std-numbers (PR #66583)

2023-12-05 Thread Julian Schmidt via cfe-commits
@@ -0,0 +1,73 @@ +.. title:: clang-tidy - modernize-use-std-numbers + +modernize-use-std-numbers += + +Finds constants and function calls to math functions that can be replaced +with c++20's mathematical constants from the ``numbers`` header and offers +fix

[clang-tools-extra] [clang-tidy] add modernize-use-std-numbers (PR #66583)

2023-12-06 Thread Julian Schmidt via cfe-commits
5chmidti wrote: Thank you for the reviews https://github.com/llvm/llvm-project/pull/66583 ___ 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-std-numbers (PR #66583)

2023-12-06 Thread Julian Schmidt via cfe-commits
5chmidti wrote: @PiotrZSL check out https://lab.llvm.org/buildbot/#/builders/230/builds/6, the bot was red on previous runs, but those are unrelated to how it fails now. The bot fails for this patch with the following build failure: ``` /home/buildbots/ppc64le-clang-test-suite/clang-ppc64le

[clang-tools-extra] [clang-tidy] add modernize-use-std-numbers (PR #66583)

2023-12-06 Thread Julian Schmidt via cfe-commits
5chmidti wrote: Thanks https://github.com/llvm/llvm-project/pull/66583 ___ 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-std-numbers (PR #66583)

2023-11-19 Thread Julian Schmidt via cfe-commits
5chmidti wrote: @PiotrZSL I have implemented the changes you have requested, but because of #72536, I am not going to push those changes yet, unless you prefer it if I do. I might take a look into fixing this issue. I came across this when I checked what would happen when the big templated fun

[clang-tools-extra] [clang-tidy] add modernize-use-std-numbers (PR #66583)

2023-10-27 Thread Julian Schmidt via cfe-commits
https://github.com/5chmidti updated https://github.com/llvm/llvm-project/pull/66583 >From 8f5e9e6024b0db8f251625669adbc5d607da83cb Mon Sep 17 00:00:00 2001 From: Julian Schmidt <44101708+5chmi...@users.noreply.github.com> Date: Sat, 16 Sep 2023 16:24:13 +0200 Subject: [PATCH 01/15] [clang-tidy]

[clang-tools-extra] [clang-tidy] add modernize-use-std-numbers (PR #66583)

2023-10-27 Thread Julian Schmidt via cfe-commits
https://github.com/5chmidti updated https://github.com/llvm/llvm-project/pull/66583 >From 8f5e9e6024b0db8f251625669adbc5d607da83cb Mon Sep 17 00:00:00 2001 From: Julian Schmidt <44101708+5chmi...@users.noreply.github.com> Date: Sat, 16 Sep 2023 16:24:13 +0200 Subject: [PATCH 01/16] [clang-tidy]

[clang-tools-extra] [clang-tidy] add modernize-use-std-numbers (PR #66583)

2023-10-27 Thread Julian Schmidt via cfe-commits
https://github.com/5chmidti updated https://github.com/llvm/llvm-project/pull/66583 >From 8f5e9e6024b0db8f251625669adbc5d607da83cb Mon Sep 17 00:00:00 2001 From: Julian Schmidt <44101708+5chmi...@users.noreply.github.com> Date: Sat, 16 Sep 2023 16:24:13 +0200 Subject: [PATCH 01/17] [clang-tidy]

[clang-tools-extra] [clang-tidy] add modernize-use-std-numbers (PR #66583)

2023-10-27 Thread Julian Schmidt via cfe-commits
https://github.com/5chmidti edited https://github.com/llvm/llvm-project/pull/66583 ___ 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-std-numbers (PR #66583)

2023-10-27 Thread Julian Schmidt via cfe-commits
https://github.com/5chmidti updated https://github.com/llvm/llvm-project/pull/66583 >From 8f5e9e6024b0db8f251625669adbc5d607da83cb Mon Sep 17 00:00:00 2001 From: Julian Schmidt <44101708+5chmi...@users.noreply.github.com> Date: Sat, 16 Sep 2023 16:24:13 +0200 Subject: [PATCH 01/19] [clang-tidy]

[clang-tools-extra] [clang-tidy] add modernize-use-std-numbers (PR #66583)

2023-10-28 Thread Julian Schmidt via cfe-commits
https://github.com/5chmidti updated https://github.com/llvm/llvm-project/pull/66583 >From 8b8acedc0e6c432545744a113128cfcb4f2da7e5 Mon Sep 17 00:00:00 2001 From: Julian Schmidt <44101708+5chmi...@users.noreply.github.com> Date: Sat, 16 Sep 2023 16:24:13 +0200 Subject: [PATCH 01/19] [clang-tidy]

[clang-tools-extra] [clang-tidy] add modernize-use-std-numbers (PR #66583)

2023-10-28 Thread Julian Schmidt via cfe-commits
5chmidti wrote: I rebased and force-pushed my branch to fix the formatting CI (fetch depth for comparison with head was too big). I pushed no actual changes in that force-push (one documentation ordering change in `fix lexicographical ordering in some places after rename` became redundant). @E

[clang-tools-extra] [clang-tidy] add modernize-use-std-numbers (PR #66583)

2023-10-28 Thread Julian Schmidt via cfe-commits
5chmidti wrote: Nice, the rebase fixed the Windows failure https://github.com/llvm/llvm-project/pull/66583 ___ 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 match for binaryOperator in ExprMutationAnalyzer for misc-const-correctness (PR #70559)

2023-10-28 Thread Julian Schmidt via cfe-commits
https://github.com/5chmidti created https://github.com/llvm/llvm-project/pull/70559 The `ExprMutationAnalyzer`s matcher of `binaryOperator`s that contained the variable expr, were previously narrowing the variable to be type dependent, when the `binaryOperator` should have been narrowed as depen

[clang-tools-extra] [clang-tidy] fix match for binaryOperator in ExprMutationAnalyzer for misc-const-correctness (PR #70559)

2023-10-28 Thread Julian Schmidt via cfe-commits
5chmidti wrote: CC @JonasToth for your work on `ExprMutationAnalyzer` https://github.com/llvm/llvm-project/pull/70559 ___ 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 match for binaryOperator in ExprMutationAnalyzer for misc-const-correctness (PR #70559)

2023-10-28 Thread Julian Schmidt via cfe-commits
https://github.com/5chmidti updated https://github.com/llvm/llvm-project/pull/70559 >From b29eb35fe8597ceefc4c615817174181a16f3c4c Mon Sep 17 00:00:00 2001 From: Julian Schmidt <44101708+5chmi...@users.noreply.github.com> Date: Sat, 28 Oct 2023 18:08:51 +0200 Subject: [PATCH 1/2] [clang-tidy] fi

[clang-tools-extra] [clang-tidy] fix match for binaryOperator in ExprMutationAnalyzer for misc-const-correctness (PR #70559)

2023-10-28 Thread Julian Schmidt via cfe-commits
@@ -683,6 +683,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 ``ExprMutationAnalyzer`` did not find a potential muta

[clang] [clang-tidy] fix match for binaryOperator in ExprMutationAnalyzer for misc-const-correctness (PR #70559)

2023-10-28 Thread Julian Schmidt via cfe-commits
5chmidti wrote: The top-level Linux and Windows tests work, but inside the `Trigger Build`/`clang-ci` run, the windows test step fails. I'm not sure what the difference is between these two Windows tests. https://github.com/llvm/llvm-project/pull/70559 _

[clang-tools-extra] [clang-tidy] add modernize-use-std-numbers (PR #66583)

2023-11-02 Thread Julian Schmidt via cfe-commits
https://github.com/5chmidti updated https://github.com/llvm/llvm-project/pull/66583 >From 8b8acedc0e6c432545744a113128cfcb4f2da7e5 Mon Sep 17 00:00:00 2001 From: Julian Schmidt <44101708+5chmi...@users.noreply.github.com> Date: Sat, 16 Sep 2023 16:24:13 +0200 Subject: [PATCH 01/20] [clang-tidy]

[clang-tools-extra] [clang] [clang-tidy] fix match for binaryOperator in ExprMutationAnalyzer for misc-const-correctness (PR #70559)

2023-11-03 Thread Julian Schmidt via cfe-commits
5chmidti wrote: I found the issue, but I have not looked for a solution. See https://godbolt.org/z/or4EnMfWj and #71203. When using clang with `-target` to specify `x86_64-pc-win32` and `x86_64-linux`, the body for the function `f` is `NULL` in the AST with the windows target. This only happens

[clang] [clang][ASTMatcher] Add matchers for CXXFoldExpr (PR #71245)

2023-11-03 Thread Julian Schmidt via cfe-commits
https://github.com/5chmidti created https://github.com/llvm/llvm-project/pull/71245 None >From 17cec21d5a92a2f1e09f7294d7990b0b584e5ec8 Mon Sep 17 00:00:00 2001 From: Julian Schmidt <44101708+5chmi...@users.noreply.github.com> Date: Fri, 3 Nov 2023 21:51:57 +0100 Subject: [PATCH] [clang][ASTMat

[clang] [clang][ASTMatcher] Add matchers for CXXFoldExpr (PR #71245)

2023-11-03 Thread Julian Schmidt via cfe-commits
https://github.com/5chmidti updated https://github.com/llvm/llvm-project/pull/71245 >From 6a0a568fe0887c9665aa78bd51610e063d022c19 Mon Sep 17 00:00:00 2001 From: Julian Schmidt <44101708+5chmi...@users.noreply.github.com> Date: Fri, 3 Nov 2023 21:51:57 +0100 Subject: [PATCH] [clang][ASTMatcher]

[clang-tools-extra] [clang-tidy] add modernize-use-std-numbers (PR #66583)

2023-11-03 Thread Julian Schmidt via cfe-commits
@@ -0,0 +1,284 @@ +//===--- UseStdNumbersCheck.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 modernize-use-std-numbers (PR #66583)

2023-11-03 Thread Julian Schmidt via cfe-commits
@@ -0,0 +1,284 @@ +//===--- UseStdNumbersCheck.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 modernize-use-std-numbers (PR #66583)

2023-11-03 Thread Julian Schmidt via cfe-commits
@@ -0,0 +1,28 @@ +.. title:: clang-tidy - modernize-use-std-numbers + +modernize-use-std-numbers += + +Finds constants and function calls to math functions that can be replaced +with c++20's mathematical constants from the ``numbers`` header and offers fix

[clang-tools-extra] [clang-tidy] add modernize-use-std-numbers (PR #66583)

2023-11-03 Thread Julian Schmidt via cfe-commits
@@ -0,0 +1,284 @@ +//===--- UseStdNumbersCheck.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 modernize-use-std-numbers (PR #66583)

2023-11-03 Thread Julian Schmidt via cfe-commits
https://github.com/5chmidti edited https://github.com/llvm/llvm-project/pull/66583 ___ 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-std-numbers (PR #66583)

2023-11-03 Thread Julian Schmidt via cfe-commits
@@ -0,0 +1,28 @@ +.. title:: clang-tidy - modernize-use-std-numbers + +modernize-use-std-numbers += + +Finds constants and function calls to math functions that can be replaced +with c++20's mathematical constants from the ``numbers`` header and offers fix

[clang] [clang][ASTMatcher] Add matchers for CXXFoldExpr (PR #71245)

2023-11-03 Thread Julian Schmidt via cfe-commits
https://github.com/5chmidti updated https://github.com/llvm/llvm-project/pull/71245 >From bd26678cd8a444aac6c7362df7eadedbb614b7fe Mon Sep 17 00:00:00 2001 From: Julian Schmidt <44101708+5chmi...@users.noreply.github.com> Date: Fri, 3 Nov 2023 21:51:57 +0100 Subject: [PATCH] [clang][ASTMatcher]

[clang] [clang][ASTMatcher] Add matchers for CXXFoldExpr (PR #71245)

2023-11-03 Thread Julian Schmidt via cfe-commits
https://github.com/5chmidti updated https://github.com/llvm/llvm-project/pull/71245 >From ae352f244a031b587d136423e0e3ef51f522c771 Mon Sep 17 00:00:00 2001 From: Julian Schmidt <44101708+5chmi...@users.noreply.github.com> Date: Fri, 3 Nov 2023 21:51:57 +0100 Subject: [PATCH] [clang][ASTMatcher]

[clang-tools-extra] [clangd] Extract Function: add hoisting support (PR #75533)

2023-12-14 Thread Julian Schmidt via cfe-commits
https://github.com/5chmidti created https://github.com/llvm/llvm-project/pull/75533 Adds support to hoist variables declared inside the selected region and used afterwards back out of the extraced function for later use. Uses the explicit variable type if only one decl needs hoisting, otherwise

[clang-tools-extra] [clangd] Extract Function: add hoisting support (PR #75533)

2023-12-14 Thread Julian Schmidt via cfe-commits
5chmidti wrote: This is a revival of https://reviews.llvm.org/D138499. There was no previous review on phabricator. Open questions: - I think that ``/`` should be included if a `tuple` or `pair` is used, but couldn't figure out a clean way to include the headers. It looks like the way to go wo

[clang-tools-extra] [clangd] Extract Function: add hoisting support (PR #75533)

2023-12-14 Thread Julian Schmidt via cfe-commits
https://github.com/5chmidti updated https://github.com/llvm/llvm-project/pull/75533 >From 2c3668f590645859d4e70b7c675bda21212d1a89 Mon Sep 17 00:00:00 2001 From: Julian Schmidt <44101708+5chmi...@users.noreply.github.com> Date: Sat, 21 Jan 2023 14:49:58 +0100 Subject: [PATCH] [clangd] Extract Fu

[clang-tools-extra] [clangd] Extract Function: add hoisting support (PR #75533)

2023-12-14 Thread Julian Schmidt via cfe-commits
https://github.com/5chmidti updated https://github.com/llvm/llvm-project/pull/75533 >From 02d70bf388b08f8b659c38495b63d39b2e9e80d8 Mon Sep 17 00:00:00 2001 From: Julian Schmidt <44101708+5chmi...@users.noreply.github.com> Date: Sat, 21 Jan 2023 14:49:58 +0100 Subject: [PATCH] [clangd] Extract Fu

[clang-tools-extra] [clangd] Extract Function: add hoisting support (PR #75533)

2023-12-14 Thread Julian Schmidt via cfe-commits
@@ -367,14 +374,17 @@ struct NewFunction { bool Static = false; ConstexprSpecKind Constexpr = ConstexprSpecKind::Unspecified; bool Const = false; + const HoistSet &ToHoist; 5chmidti wrote: The `const&` `HoistSet` I mentioned https://github.com/llvm/llv

[clang] [clang][ASTMatcher] Add matchers for CXXFoldExpr (PR #71245)

2023-12-14 Thread Julian Schmidt via cfe-commits
5chmidti wrote: Ping https://github.com/llvm/llvm-project/pull/71245 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clangd] don't lower severity of clang-tidy modernize-* checks to remarks (PR #75706)

2023-12-16 Thread Julian Schmidt via cfe-commits
https://github.com/5chmidti created https://github.com/llvm/llvm-project/pull/75706 Starting with a59b24be47ed6263c254d168567b9ebba391fac9, the severity of diagnostics that have the 'Deprecated' tag is lowered to 'Remark'. Because the `Deprecated` tag is applied to clang-tidy checks in the moder

[clang-tools-extra] [clangd] don't lower severity of clang-tidy modernize-* checks to remarks (PR #75706)

2023-12-16 Thread Julian Schmidt via cfe-commits
5chmidti wrote: Explicitly pinging @kadircet and @sam-mccall for your involvement in the mentioned commit. What are your thoughts on this? I looked into this because someone on discord asked about this difference. https://github.com/llvm/llvm-project/pull/75706

[clang-tools-extra] [clangd] don't lower severity of clang-tidy modernize-* checks to remarks (PR #75706)

2023-12-16 Thread Julian Schmidt via cfe-commits
5chmidti wrote: The tag for `modernize-*` checks gets added here: https://github.com/llvm/llvm-project/blob/f49e2b05bf3ececa2fe20c5d658ab92ab974dc36/clang-tools-extra/clangd/Diagnostics.cpp#L392-L397 https://github.com/llvm/llvm-project/pull/75706 ___

[clang-tools-extra] [clangd] don't lower severity of clang-tidy modernize-* checks to remarks (PR #75706)

2023-12-16 Thread Julian Schmidt via cfe-commits
@@ -1811,10 +1811,10 @@ TEST(ParsedASTTest, ModuleSawDiag) { TestTU TU; auto AST = TU.build(); -#if 0 +#if 0 5chmidti wrote: This formatting change slipped through, should I remove it? https://github.com/llvm/llvm-project/pull/75706 _

[clang] [clang][ASTMatcher] Add matchers for CXXFoldExpr (PR #71245)

2023-11-24 Thread Julian Schmidt via cfe-commits
5chmidti wrote: @EugeneZelenko sorry for the direct ping, but I know you are one of the people that are active with labels (thanks btw). Could you please reapply the `clang` (or maybe the `clang:frontend` is a better fit) label to this pr? A now fixed issue with the pr subscriber notification

[clang] [clang][ASTMatcher] Add matchers for CXXFoldExpr (PR #71245)

2023-11-24 Thread Julian Schmidt via cfe-commits
https://github.com/5chmidti edited https://github.com/llvm/llvm-project/pull/71245 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][ASTMatcher] Add matchers for CXXFoldExpr (PR #71245)

2023-11-24 Thread Julian Schmidt via cfe-commits
https://github.com/5chmidti updated https://github.com/llvm/llvm-project/pull/71245 >From ae352f244a031b587d136423e0e3ef51f522c771 Mon Sep 17 00:00:00 2001 From: Julian Schmidt <44101708+5chmi...@users.noreply.github.com> Date: Fri, 3 Nov 2023 21:51:57 +0100 Subject: [PATCH 1/5] [clang][ASTMatch

[clang] [clang][ASTMatcher] Add matchers for CXXFoldExpr (PR #71245)

2023-11-24 Thread Julian Schmidt via cfe-commits
5chmidti wrote: > Pull request doesn't say anything. Fixed, I just listed the matchers that were added/adjusted for `CXXFoldExpr` support. > Whats a purpose of those matchers (except only to have them). Sorry, forgot to add that comment. I didn't want that to be part of the pr description (b

[clang] [clang][ASTMatcher] Add matchers for CXXFoldExpr (PR #71245)

2023-11-24 Thread Julian Schmidt via cfe-commits
@@ -319,6 +319,7 @@ RegistryMaps::RegistryMaps() { REGISTER_MATCHER(hasExplicitSpecifier); REGISTER_MATCHER(hasExternalFormalLinkage); REGISTER_MATCHER(hasFalseExpression); + REGISTER_MATCHER(hasFoldInit); 5chmidti wrote: done https://github.com/llvm/l

[clang] [clang][ASTMatcher] Add matchers for CXXFoldExpr (PR #71245)

2023-11-24 Thread Julian Schmidt via cfe-commits
@@ -4532,6 +4563,139 @@ AST_POLYMORPHIC_MATCHER_P2(hasArgument, return InnerMatcher.matches(*Arg->IgnoreParenImpCasts(), Finder, Builder); } +/// Matches the operand that does not contain the parameter pack. +/// +/// Example matches `(0 + ... + args)` and `(args * ... * 1)`

[clang] [clang][ASTMatcher] Add matchers for CXXFoldExpr (PR #71245)

2023-11-24 Thread Julian Schmidt via cfe-commits
@@ -658,27 +658,27 @@ void check_match_co_return() { co_return 1; } )cpp"; - EXPECT_TRUE(matchesConditionally(CoReturnCode, - coreturnStmt(isExpansionInMainFile()), - true, {"-std=c++20", "-I/"}, M)); + E

[clang-tools-extra] [clang-tidy] add modernize-use-std-numbers (PR #66583)

2023-12-03 Thread Julian Schmidt via cfe-commits
5chmidti wrote: It looks like GitHub decided to not list all new commits in the conversation view... there are a few more in the commits tab. The newly pushed changes start at commit [refactor from using transformer to a normal check](https://github.com/llvm/llvm-project/pull/66583/commits/b1a

[clang-tools-extra] [clang-tidy] add modernize-use-std-numbers (PR #66583)

2023-12-03 Thread Julian Schmidt via cfe-commits
@@ -128,169 +128,169 @@ void foo(){ const auto Actually2 = 2; bar::sqrt(Actually2); -// CHECK-MESSAGES: :[[@LINE-1]]:5: warning: prefer std::numbers math constant [modernize-use-std-numbers] +// CHECK-MESSAGES: :[[@LINE-1]]:5: warning: prefer 'std::numbers::sq

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

2023-12-04 Thread Julian Schmidt via cfe-commits
5chmidti wrote: > but there appears to be no way to introspect the UnresolvedLookupExpr to > ensure I'm matching calls to `std::move` Try searching for `unresolvedLookupExpr` & `UnresolvedLookupExpr` in the clang-tidy directory. There is a high probability that another check has done somethin

[clang-tools-extra] [clangd] don't lower severity of clang-tidy modernize-* checks to remarks (PR #75706)

2024-01-02 Thread Julian Schmidt via cfe-commits
5chmidti wrote: There is also the use-case to keep a relatively modern code-base in a modern state. In that case, the user might want to know about modernizations/deprecations right in the editor. Example (vscode): ![image](https://github.com/llvm/llvm-project/assets/44101708/e66b4fc8-7e3a-4edb

[clang] [clang][ASTMatcher] Add matchers for CXXFoldExpr (PR #71245)

2024-01-11 Thread Julian Schmidt via cfe-commits
5chmidti wrote: > @5chmidti do you need us to merge that for you? ^^ coincidentally, I got access today. Given that the branch is from November, should I use the update branch feature beforehand, or do you think it's fine to merge it like this? https://github.com/llvm/llvm-project/pull/71245

[clang-tools-extra] [clangd] Extract Function: add hoisting support (PR #75533)

2024-01-11 Thread Julian Schmidt via cfe-commits
5chmidti wrote: Ping https://github.com/llvm/llvm-project/pull/75533 ___ 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-unused-return-value ignore `++` and `--` operator overloading (PR #84922)

2024-03-14 Thread Julian Schmidt via cfe-commits
https://github.com/5chmidti commented: Should this check really ignore postfix increment/decrement? Or maybe this check ignores it and a new check diagnoses `it++` vs `++it` (where possible). What are your thoughts on this? https://github.com/llvm/llvm-project/pull/84922 __

[clang-tools-extra] [clang-tidy]bugprone-unused-return-value ignore `++` and `--` operator overloading (PR #84922)

2024-03-14 Thread Julian Schmidt via cfe-commits
https://github.com/5chmidti edited https://github.com/llvm/llvm-project/pull/84922 ___ 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-unused-return-value ignore `++` and `--` operator overloading (PR #84922)

2024-03-14 Thread Julian Schmidt via cfe-commits
@@ -169,16 +176,13 @@ void UnusedReturnValueCheck::registerMatchers(MatchFinder *Finder) { callee(functionDecl( // Don't match void overloads of checked functions. unless(returns(voidType())), - // Don't match copy or move ass

[clang-tools-extra] [clang-tidy]bugprone-unused-return-value ignore `++` and `--` operator overloading (PR #84922)

2024-03-14 Thread Julian Schmidt via cfe-commits
5chmidti wrote: > @5chmidti What does `a new check diagnoses `it++`vs`++it` (where possible)` > mean? I mean this pattern: ```c++ void foo(std::string str) { auto iter = str.begin(); iter++; // prefer ++iter; ++iter; sink(iter++); sink(++iter); for (auto i = str.begin(); i != str

[clang-tools-extra] Add clang-tidy check readability-math-missing-parentheses (PR #84481)

2024-03-14 Thread Julian Schmidt via cfe-commits
https://github.com/5chmidti requested changes to this pull request. This is going in the right direction. You can omit `clang::` (e.g., `SourceLocation`), because you already are inside the `clang` namespace. https://github.com/llvm/llvm-project/pull/84481 _

[clang-tools-extra] Add clang-tidy check readability-math-missing-parentheses (PR #84481)

2024-03-14 Thread Julian Schmidt via cfe-commits
https://github.com/5chmidti edited https://github.com/llvm/llvm-project/pull/84481 ___ 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 readability-math-missing-parentheses (PR #84481)

2024-03-14 Thread Julian Schmidt via cfe-commits
@@ -0,0 +1,68 @@ +//===--- MathMissingParenthesesCheck.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: Apa

[clang-tools-extra] Add clang-tidy check readability-math-missing-parentheses (PR #84481)

2024-03-14 Thread Julian Schmidt via cfe-commits
@@ -0,0 +1,68 @@ +//===--- MathMissingParenthesesCheck.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: Apa

[clang-tools-extra] Add clang-tidy check readability-math-missing-parentheses (PR #84481)

2024-03-14 Thread Julian Schmidt via cfe-commits
@@ -0,0 +1,68 @@ +//===--- MathMissingParenthesesCheck.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: Apa

[clang-tools-extra] Add clang-tidy check readability-math-missing-parentheses (PR #84481)

2024-03-14 Thread Julian Schmidt via cfe-commits
@@ -0,0 +1,68 @@ +//===--- MathMissingParenthesesCheck.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: Apa

[clang-tools-extra] Add clang-tidy check readability-math-missing-parentheses (PR #84481)

2024-03-14 Thread Julian Schmidt via cfe-commits
@@ -0,0 +1,68 @@ +//===--- MathMissingParenthesesCheck.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: Apa

[clang-tools-extra] Add clang-tidy check readability-math-missing-parentheses (PR #84481)

2024-03-14 Thread Julian Schmidt via cfe-commits
@@ -0,0 +1,74 @@ +// RUN: %check_clang_tidy %s readability-math-missing-parentheses %t + +// FIXME: Add something that triggers the check here. + +int foo(){ +return 5; +} + +int bar(){ +return 4; +} + +class fun{ +public: +int A; +double B; +fun(){ +

[clang-tools-extra] Add clang-tidy check readability-math-missing-parentheses (PR #84481)

2024-03-14 Thread Julian Schmidt via cfe-commits
@@ -0,0 +1,68 @@ +//===--- MathMissingParenthesesCheck.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: Apa

[clang-tools-extra] Add clang-tidy check readability-math-missing-parentheses (PR #84481)

2024-03-14 Thread Julian Schmidt via cfe-commits
@@ -0,0 +1,68 @@ +//===--- MathMissingParenthesesCheck.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: Apa

[clang-tools-extra] Add clang-tidy check readability-math-missing-parentheses (PR #84481)

2024-03-14 Thread Julian Schmidt via cfe-commits
@@ -0,0 +1,68 @@ +//===--- MathMissingParenthesesCheck.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: Apa

[clang-tools-extra] Add clang-tidy check readability-math-missing-parentheses (PR #84481)

2024-03-14 Thread Julian Schmidt via cfe-commits
@@ -0,0 +1,68 @@ +//===--- MathMissingParenthesesCheck.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: Apa

[clang-tools-extra] Add clang-tidy check readability-math-missing-parentheses (PR #84481)

2024-03-14 Thread Julian Schmidt via cfe-commits
@@ -0,0 +1,68 @@ +//===--- MathMissingParenthesesCheck.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: Apa

[clang-tools-extra] Add clang-tidy check readability-math-missing-parentheses (PR #84481)

2024-03-14 Thread Julian Schmidt via cfe-commits
@@ -0,0 +1,68 @@ +//===--- MathMissingParenthesesCheck.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: Apa

[clang-tools-extra] Add clang-tidy check readability-math-missing-parentheses (PR #84481)

2024-03-14 Thread Julian Schmidt via cfe-commits
@@ -0,0 +1,74 @@ +// RUN: %check_clang_tidy %s readability-math-missing-parentheses %t + +// FIXME: Add something that triggers the check here. 5chmidti wrote: Left-over from the check template https://github.com/llvm/llvm-project/pull/84481

[clang-tools-extra] Add clang-tidy check readability-math-missing-parentheses (PR #84481)

2024-03-14 Thread Julian Schmidt via cfe-commits
https://github.com/5chmidti edited https://github.com/llvm/llvm-project/pull/84481 ___ 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-unused-return-value ignore `++` and `--` operator overloading (PR #84922)

2024-03-14 Thread Julian Schmidt via cfe-commits
https://github.com/5chmidti approved this pull request. LGTM from my side, please wait for @PiotrZSL to reconfirm approval/finish review https://github.com/llvm/llvm-project/pull/84922 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lis

[clang-tools-extra] Add clang-tidy check readability-math-missing-parentheses (PR #84481)

2024-03-15 Thread Julian Schmidt via cfe-commits
https://github.com/5chmidti edited https://github.com/llvm/llvm-project/pull/84481 ___ 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 readability-math-missing-parentheses (PR #84481)

2024-03-22 Thread Julian Schmidt via cfe-commits
@@ -0,0 +1,68 @@ +//===--- MathMissingParenthesesCheck.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: Apa

[clang-tools-extra] Add clang-tidy check readability-math-missing-parentheses (PR #84481)

2024-03-22 Thread Julian Schmidt via cfe-commits
@@ -0,0 +1,68 @@ +//===--- MathMissingParenthesesCheck.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: Apa

[clang-tools-extra] [clang-tidy] Ignore expresions in unevaluated context in bugprone-inc-dec-in-conditions (PR #85849)

2024-03-22 Thread Julian Schmidt via cfe-commits
https://github.com/5chmidti requested changes to this pull request. Looks good, but the `operand` node may also be in an unevaluated context, you only guard against the non `++/--` expr being in an unevaluated context here. Fix: add `unless(IsInUnevaluatedContext)` to both `expr().bind("operand

[clang-tools-extra] [clang-tidy] add new check readability-enum-initial-value (PR #86129)

2024-03-22 Thread Julian Schmidt via cfe-commits
@@ -0,0 +1,27 @@ +// RUN: %check_clang_tidy %s readability-enum-initial-value %t + +enum EError { + // CHECK-MESSAGES: :[[@LINE-1]]:1: warning: inital value in enum EError has readability issue, explicit initialization of all of enumerators + EError_a = 1, + EError_b, + // CH

  1   2   3   4   5   6   7   8   9   10   >