[clang-tools-extra] [clang-tidy] Correcting issues in `readability-implicit-bool-conversion` on C23 (PR #92241)

2024-05-22 Thread Björn Svensson via cfe-commits
https://github.com/bjosv updated https://github.com/llvm/llvm-project/pull/92241 From 44ae41f00064dc477db0eb00b45fceff811cadec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Svensson?= Date: Mon, 29 Apr 2024 12:49:59 +0200 Subject: [PATCH 1/5] [clang-tidy] Use C-style casts on C23 in

[clang-tools-extra] [clang-tidy] Correcting issues in `readability-implicit-bool-conversion` on C23 (PR #92241)

2024-05-16 Thread Björn Svensson via cfe-commits
https://github.com/bjosv updated https://github.com/llvm/llvm-project/pull/92241 From 44ae41f00064dc477db0eb00b45fceff811cadec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Svensson?= Date: Mon, 29 Apr 2024 12:49:59 +0200 Subject: [PATCH 1/4] [clang-tidy] Use C-style casts on C23 in

[clang-tools-extra] [clang-tidy] Correcting issues in `readability-implicit-bool-conversion` on C23 (PR #92241)

2024-05-16 Thread Björn Svensson via cfe-commits
@@ -368,7 +368,8 @@ Changes in existing checks - Improved :doc:`readability-implicit-bool-conversion ` check to provide valid fix suggestions for ``static_cast`` without a preceding space and - fixed problem with duplicate parentheses in double implicit casts. + fixed

[clang-tools-extra] [clang-tidy] Correcting issues in `readability-implicit-bool-conversion` on C23 (PR #92241)

2024-05-15 Thread Björn Svensson via cfe-commits
https://github.com/bjosv created https://github.com/llvm/llvm-project/pull/92241 `readability-implicit-bool-conversion` supports language-versions with `LangOpts.Bool` which includes C23. This PR corrects an issue that the fixer suggests `static_cast<>()` which is not available in C23, and

[clang-tools-extra] [clang-tidy] Enable C23 support in modernize-use-nullptr (PR #89990)

2024-04-24 Thread Björn Svensson via cfe-commits
https://github.com/bjosv updated https://github.com/llvm/llvm-project/pull/89990 From 5e4df733dbbf830b712c5a22e16173e851736a98 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Svensson?= Date: Wed, 24 Apr 2024 22:39:48 +0200 Subject: [PATCH] [clang-tidy] Enable C23 support in

[clang-tools-extra] [clang-tidy] Enable C23 support in modernize-use-nullptr (PR #89990)

2024-04-24 Thread Björn Svensson via cfe-commits
https://github.com/bjosv created https://github.com/llvm/llvm-project/pull/89990 C23 introduces the `nullptr` constant similar to C++11 which means that the checker `modernize-use-nullptr` can be used on C23 code as well. This PR enables the checker to be run on C23 and adds testcases. See

[clang-tools-extra] [clang-tidy] Add check hicpp-ignored-remove-result (PR #73119)

2023-12-08 Thread Björn Svensson via cfe-commits
bjosv wrote: Thanks for the informative review comments @PiotrZSL, much appreciated. https://github.com/llvm/llvm-project/pull/73119 ___ 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 hicpp-ignored-remove-result (PR #73119)

2023-12-07 Thread Björn Svensson via cfe-commits
https://github.com/bjosv updated https://github.com/llvm/llvm-project/pull/73119 From 91cf412abcfd231ab399c3e44c6a9bc14109537c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Svensson?= Date: Tue, 21 Nov 2023 23:30:07 +0100 Subject: [PATCH 1/5] [clang-tidy] Add check

[clang-tools-extra] [clang-tidy] Add check hicpp-ignored-remove-result (PR #73119)

2023-12-07 Thread Björn Svensson via cfe-commits
https://github.com/bjosv edited https://github.com/llvm/llvm-project/pull/73119 ___ 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 hicpp-ignored-remove-result (PR #73119)

2023-12-06 Thread Björn Svensson via cfe-commits
@@ -133,6 +133,11 @@ UnusedReturnValueCheck::UnusedReturnValueCheck(llvm::StringRef Name, "::boost::system::error_code"))), AllowCastToVoid(Options.get("AllowCastToVoid", false)) {}

[clang-tools-extra] [clang-tidy] Add check hicpp-ignored-remove-result (PR #73119)

2023-12-06 Thread Björn Svensson via cfe-commits
@@ -0,0 +1,17 @@ +.. title:: clang-tidy - hicpp-ignored-remove-result + +hicpp-ignored-remove-result +=== + +Ensure that the result of ``std::remove``, ``std::remove_if`` and ``std::unique`` +are not ignored according to +`rule 17.5.1

[clang-tools-extra] [clang-tidy] Add check hicpp-ignored-remove-result (PR #73119)

2023-12-06 Thread Björn Svensson via cfe-commits
@@ -0,0 +1,28 @@ +//===--- IgnoredRemoveResultCheck.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 check hicpp-ignored-remove-result (PR #73119)

2023-12-06 Thread Björn Svensson via cfe-commits
https://github.com/bjosv updated https://github.com/llvm/llvm-project/pull/73119 From 91cf412abcfd231ab399c3e44c6a9bc14109537c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Svensson?= Date: Tue, 21 Nov 2023 23:30:07 +0100 Subject: [PATCH 1/4] [clang-tidy] Add check

[clang-tools-extra] [clang-tidy] Add check hicpp-ignored-remove-result (PR #73119)

2023-12-05 Thread Björn Svensson via cfe-commits
bjosv wrote: Updated the check to be derived from the original check instead of an alias. https://github.com/llvm/llvm-project/pull/73119 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang-tools-extra] [clang-tidy] Add check hicpp-ignored-remove-result (PR #73119)

2023-12-05 Thread Björn Svensson via cfe-commits
https://github.com/bjosv updated https://github.com/llvm/llvm-project/pull/73119 From 91cf412abcfd231ab399c3e44c6a9bc14109537c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Svensson?= Date: Tue, 21 Nov 2023 23:30:07 +0100 Subject: [PATCH 1/3] [clang-tidy] Add check

[clang-tools-extra] [clang-tidy] Add check hicpp-ignored-remove-result (PR #73119)

2023-11-23 Thread Björn Svensson via cfe-commits
bjosv wrote: Great, I'll have a go at it to move it into a separate check. I used `cert-err33-c` as a blueprint and maybe that check can be updated later as well if we find a good model. https://github.com/llvm/llvm-project/pull/73119 ___ cfe-commits

[clang-tools-extra] [clang-tidy] Add check hicpp-ignored-remove-result (PR #73119)

2023-11-23 Thread Björn Svensson via cfe-commits
https://github.com/bjosv updated https://github.com/llvm/llvm-project/pull/73119 From 91cf412abcfd231ab399c3e44c6a9bc14109537c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Svensson?= Date: Tue, 21 Nov 2023 23:30:07 +0100 Subject: [PATCH 1/2] [clang-tidy] Add check

[lld] [clang-tools-extra] [mlir] [clang] [llvm] [flang] [clangtidy] Allow safe suspensions in coroutine-hostile-raii check (PR #72954)

2023-11-22 Thread Björn Svensson via cfe-commits
@@ -52,27 +52,42 @@ AST_MATCHER_P(Stmt, forEachPrevStmt, ast_matchers::internal::Matcher, } return IsHostile; } + +// Matches the expression awaited by the `co_await`. +AST_MATCHER_P(CoawaitExpr, awaiatable, ast_matchers::internal::Matcher, bjosv wrote:

[llvm] [lld] [flang] [clang-tools-extra] [clang] [mlir] [clangtidy] Allow safe suspensions in coroutine-hostile-raii check (PR #72954)

2023-11-22 Thread Björn Svensson via cfe-commits
https://github.com/bjosv commented: Nice. Added a naming comment/nit. https://github.com/llvm/llvm-project/pull/72954 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[mlir] [llvm] [flang] [lld] [clang-tools-extra] [clang] [clangtidy] Allow safe suspensions in coroutine-hostile-raii check (PR #72954)

2023-11-22 Thread Björn Svensson via cfe-commits
https://github.com/bjosv edited https://github.com/llvm/llvm-project/pull/72954 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang] [clang-tidy] Added new check to detect redundant inline keyword (PR #73069)

2023-11-22 Thread Björn Svensson via cfe-commits
@@ -0,0 +1,99 @@ +//===--- RedundantInlineSpecifierCheck.cpp - +// clang-tidy--===// bjosv wrote: Removing 3 `-` should make the formatter happy and making it look more like the rest of our comment. ```suggestion //===---

[clang-tools-extra] [clang] [clang-tidy] Added new check to detect redundant inline keyword (PR #73069)

2023-11-22 Thread Björn Svensson via cfe-commits
https://github.com/bjosv commented: Added some nit/low-prio comments. https://github.com/llvm/llvm-project/pull/73069 ___ 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] Added new check to detect redundant inline keyword (PR #73069)

2023-11-22 Thread Björn Svensson via cfe-commits
@@ -0,0 +1,35 @@ +.. title:: clang-tidy - readability-redundant-inline-specifier + +readability-redundant-inline-specifier +== + +Checks for instances of the `inline` keyword in code where it is redundant +and recommends its removal. +

[clang] [clang-tools-extra] [clang-tidy] Added new check to detect redundant inline keyword (PR #73069)

2023-11-22 Thread Björn Svensson via cfe-commits
https://github.com/bjosv edited https://github.com/llvm/llvm-project/pull/73069 ___ 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 hicpp-ignored-remove-result (PR #73119)

2023-11-22 Thread Björn Svensson via cfe-commits
https://github.com/bjosv created https://github.com/llvm/llvm-project/pull/73119 This check implements the [rule 17.5.1](https://www.perforce.com/resources/qac/high-integrity-cpp-coding-standard/standard-library) of the HICPP standard which states: - Do not ignore the result of std::remove,

[clang-tools-extra] [clang-tidy][NFC][DOC] Add missing HICPP rule id's (PR #72553)

2023-11-17 Thread Björn Svensson via cfe-commits
https://github.com/bjosv updated https://github.com/llvm/llvm-project/pull/72553 From 2644f2a71fb144190f67dfd515746f9d185496c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Svensson?= Date: Thu, 16 Nov 2023 18:36:34 +0100 Subject: [PATCH 1/2] [clang-tidy][NFC][DOC] Add missing HICPP

[clang-tools-extra] [clang-tidy][NFC][DOC] Add missing HICPP rule id's (PR #72553)

2023-11-16 Thread Björn Svensson via cfe-commits
https://github.com/bjosv created https://github.com/llvm/llvm-project/pull/72553 Add HICPP rule identities to the documentation for `hicpp-avoid-c-arrays` and `hicpp-no-assembler`. Includes an update of `hicpp-avoid-goto` to look like other aliased checks. References: * avoid-c-arrays