[clang-tools-extra] Add clang-tidy external examples (PR #106675)

2024-09-23 Thread Danny Mösch via cfe-commits
https://github.com/SimplyDanny closed https://github.com/llvm/llvm-project/pull/106675 ___ 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 external examples (PR #106675)

2024-09-22 Thread Danny Mösch via cfe-commits
SimplyDanny wrote: There is an error in doc generation. Is it caused by the new file being added? Is there a configuration that needs adaption? https://github.com/llvm/llvm-project/pull/106675 ___ cfe-commits mailing list cfe-commits@lists.llvm.org ht

[clang-tools-extra] [clang-tidy][readability-container-contains] Use hasOperands when possible (PR #109178)

2024-09-18 Thread Danny Mösch via cfe-commits
https://github.com/SimplyDanny approved this pull request. https://github.com/llvm/llvm-project/pull/109178 ___ 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-container-contains] Extend to any class with contains (PR #107521)

2024-09-18 Thread Danny Mösch via cfe-commits
https://github.com/SimplyDanny approved this pull request. https://github.com/llvm/llvm-project/pull/107521 ___ 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 external examples (PR #106675)

2024-09-18 Thread Danny Mösch via cfe-commits
https://github.com/SimplyDanny edited https://github.com/llvm/llvm-project/pull/106675 ___ 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 external examples (PR #106675)

2024-09-18 Thread Danny Mösch via cfe-commits
@@ -0,0 +1,30 @@ + +External Clang-Tidy Examples + + +Introduction + + +This page provides examples of what people have done with :program:`clang-tidy` that +might serve as useful guides (or starting points) to

[clang-tools-extra] Add clang-tidy external examples (PR #106675)

2024-09-18 Thread Danny Mösch via cfe-commits
https://github.com/SimplyDanny approved this pull request. One more nit. Otherwise looks good to me. https://github.com/llvm/llvm-project/pull/106675 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinf

[clang-tools-extra] [clang-tidy] add default error message for performance-avoid-endl (PR #107867)

2024-09-12 Thread Danny Mösch via cfe-commits
https://github.com/SimplyDanny approved this pull request. https://github.com/llvm/llvm-project/pull/107867 ___ 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 default error message for performance-avoid-endl (PR #107867)

2024-09-12 Thread Danny Mösch via cfe-commits
@@ -46,14 +46,15 @@ void AvoidEndlCheck::check(const MatchFinder::MatchResult &Result) { // Handle the more common streaming '... << std::endl' case const CharSourceRange TokenRange = CharSourceRange::getTokenRange(Expression->getSourceRange()); -const Stri

[clang-tools-extra] [clang-tidy] fix false positive in modernize-min-max-use-initializer-list (PR #107649)

2024-09-11 Thread Danny Mösch via cfe-commits
https://github.com/SimplyDanny approved this pull request. https://github.com/llvm/llvm-project/pull/107649 ___ 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 external examples (PR #106675)

2024-09-11 Thread Danny Mösch via cfe-commits
@@ -0,0 +1,32 @@ + +External Clang-Tidy Examples + + +Introduction + + +This page provides examples of what people have done with :program:`clang-tidy` that +might serve as useful guides (or starting points) to

[clang-tools-extra] Add clang-tidy external examples (PR #106675)

2024-09-11 Thread Danny Mösch via cfe-commits
@@ -0,0 +1,32 @@ + +External Clang-Tidy Examples + + +Introduction + + +This page provides examples of what people have done with :program:`clang-tidy` that +might serve as useful guides (or starting points) to

[clang-tools-extra] [clang-tidy] add default error message for performance-avoid-endl (PR #107867)

2024-09-10 Thread Danny Mösch via cfe-commits
@@ -225,3 +225,14 @@ void bad_custom_stream() { // CHECK-MESSAGES: :[[@LINE-1]]:13: warning: do not use 'std::endl' with streams; use '\n' instead [performance-avoid-endl] // CHECK-FIXES: logger << '\n'; } + +namespace gh107859 { + +#define ENDL std::endl; + +void bad_macr

[clang-tools-extra] [NFC][clang-tidy] fix tests of deleted functions for missing-std-forward (PR #106861)

2024-09-09 Thread Danny Mösch via cfe-commits
https://github.com/SimplyDanny approved this pull request. https://github.com/llvm/llvm-project/pull/106861 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][docs] Add clang-tutor to ExternalClangExamples. (PR #107665)

2024-09-09 Thread Danny Mösch via cfe-commits
SimplyDanny wrote: Merged. Thank you for the addition, @c8ef! https://github.com/llvm/llvm-project/pull/107665 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][docs] Add clang-tutor to ExternalClangExamples. (PR #107665)

2024-09-09 Thread Danny Mösch via cfe-commits
https://github.com/SimplyDanny closed https://github.com/llvm/llvm-project/pull/107665 ___ 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 default error message for performance-avoid-endl (PR #107867)

2024-09-09 Thread Danny Mösch via cfe-commits
@@ -225,3 +225,14 @@ void bad_custom_stream() { // CHECK-MESSAGES: :[[@LINE-1]]:13: warning: do not use 'std::endl' with streams; use '\n' instead [performance-avoid-endl] // CHECK-FIXES: logger << '\n'; } + +namespace gh107859 { + +#define ENDL std::endl; + +void bad_macr

[clang-tools-extra] [clang-tidy] add default error message for performance-avoid-endl (PR #107867)

2024-09-09 Thread Danny Mösch via cfe-commits
@@ -225,3 +225,14 @@ void bad_custom_stream() { // CHECK-MESSAGES: :[[@LINE-1]]:13: warning: do not use 'std::endl' with streams; use '\n' instead [performance-avoid-endl] // CHECK-FIXES: logger << '\n'; } + +namespace gh107859 { + +#define ENDL std::endl; + +void bad_macr

[clang] [clang][docs] Add clang-tutor to ExternalClangExamples. (PR #107665)

2024-09-07 Thread Danny Mösch via cfe-commits
https://github.com/SimplyDanny approved this pull request. https://github.com/llvm/llvm-project/pull/107665 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [NFC][clang-tidy] reword diagnostic note in definitions-in-headers (PR #106862)

2024-09-07 Thread Danny Mösch via cfe-commits
https://github.com/SimplyDanny approved this pull request. https://github.com/llvm/llvm-project/pull/106862 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy] only diagnose definitions in readability-enum-initial-value (PR #107652)

2024-09-07 Thread Danny Mösch via cfe-commits
https://github.com/SimplyDanny approved this pull request. https://github.com/llvm/llvm-project/pull/107652 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][docs] Add clang-tutor to ExternalClangExamples. (PR #107665)

2024-09-07 Thread Danny Mösch via cfe-commits
@@ -98,3 +98,6 @@ List of projects and tools uses of reserved identifiers to ensuring that code adheres to lifecycle protocols for certain LibreOffice-specific classes. They may serve as examples for writing RecursiveASTVisitor-based plugins." + +`

[clang-tools-extra] [clang-tidy] fix false positive in modernize-min-max-use-initializer-list (PR #107649)

2024-09-07 Thread Danny Mösch via cfe-commits
@@ -72,11 +72,10 @@ static FindArgsResult findArgs(const CallExpr *Call) { return Result; } -static SmallVector -generateReplacements(const MatchFinder::MatchResult &Match, - const CallExpr *TopCall, const FindArgsResult &Result, - con

[clang-tools-extra] [clang-tidy] fix false positive in modernize-min-max-use-initializer-list (PR #107649)

2024-09-07 Thread Danny Mösch via cfe-commits
@@ -168,9 +170,11 @@ generateReplacements(const MatchFinder::MatchResult &Match, CharSourceRange::getTokenRange(InnerResult.First->getEndLoc(; } -const SmallVector InnerReplacements = generateReplacements( +const auto [FoundNestedCallInner, InnerRepla

[clang-tools-extra] [NFC][clang-tidy] document fix to bugprone-return-const-ref-from-parameter (PR #107641)

2024-09-07 Thread Danny Mösch via cfe-commits
https://github.com/SimplyDanny approved this pull request. https://github.com/llvm/llvm-project/pull/107641 ___ 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 Danny Mösch via cfe-commits
https://github.com/SimplyDanny approved this pull request. 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] let UseAfterMoveFinder::find() return an optional (PR #98100)

2024-07-09 Thread Danny Mösch via cfe-commits
https://github.com/SimplyDanny approved this pull request. 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

[clang-tools-extra] [clang-tidy] add option to avoid "no checks enabled" error (PR #96122)

2024-06-22 Thread Danny Mösch via cfe-commits
@@ -125,6 +125,9 @@ Improvements to clang-tidy - Added argument `--exclude-header-filter` and config option `ExcludeHeaderFilterRegex` to exclude headers from analysis via a RegEx. +- Added argument `--allow-no-checks` to suppress "no checks enabled" error + when disabling

[clang-tools-extra] [clang-tidy] add option to avoid "no checks enabled" error (PR #96122)

2024-06-22 Thread Danny Mösch via cfe-commits
https://github.com/SimplyDanny edited https://github.com/llvm/llvm-project/pull/96122 ___ 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 option to avoid "no checks enabled" error (PR #96122)

2024-06-22 Thread Danny Mösch via cfe-commits
https://github.com/SimplyDanny approved this pull request. https://github.com/llvm/llvm-project/pull/96122 ___ 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 option to avoid "no checks enabled" error (PR #96122)

2024-06-19 Thread Danny Mösch via cfe-commits
@@ -325,6 +325,14 @@ option is recognized. )"), cl::init(false), cl::cat(ClangTidyCategory)); +static cl::opt AllowEmptyCheckList("allow-empty-checks", desc(R"( SimplyDanny wrote: Should the option names be in sync? ```sugges

[clang-tools-extra] [clang-tidy] Clarify diagnostics of bugprone-sizeof-expression (PR #95550)

2024-06-18 Thread Danny Mösch via cfe-commits
SimplyDanny wrote: > If there is no feedback on the separator mark bikeshedding (which is > understandable -- it's a very minor question), I'll merge this commit on > Thursday. The reason for the colon appears plausible to me. What I can't judge is if this is contradicting the style typically

[clang-tools-extra] [clang-tidy] Option to ignore anonymous namespaces in avoid-non-const-global-variables (PR #93827)

2024-06-15 Thread Danny Mösch via cfe-commits
@@ -7,21 +7,30 @@ //===--===// #include "AvoidNonConstGlobalVariablesCheck.h" -#include "clang/AST/ASTContext.h" #include "clang/ASTMatchers/ASTMatchFinder.h" #include "clang/ASTMatchers/ASTMatchers.h" u

[clang-tools-extra] [clang-tidy] Option to ignore anonymous namespaces in avoid-non-const-global-variables (PR #93827)

2024-06-15 Thread Danny Mösch via cfe-commits
https://github.com/SimplyDanny approved this pull request. https://github.com/llvm/llvm-project/pull/93827 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy] Option to ignore anonymous namespaces in avoid-non-const-global-variables (PR #93827)

2024-06-15 Thread Danny Mösch via cfe-commits
https://github.com/SimplyDanny edited https://github.com/llvm/llvm-project/pull/93827 ___ 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 false positives of the result of std::move() is used as rvalue for performance-move-const-arg (PR #95633)

2024-06-15 Thread Danny Mösch via cfe-commits
@@ -387,6 +387,10 @@ Changes in existing checks - Improved :doc:`modernize-use-using ` check by adding support for detection of typedefs declared on function level. +- Improved :doc:`performance-move-const-arg + ` check ignoring the result + of ``std::move()`` is used as r

[clang-tools-extra] [clang-tidy]fix false positives of the result of std::move() is used as rvalue for performance-move-const-arg (PR #95633)

2024-06-15 Thread Danny Mösch via cfe-commits
https://github.com/SimplyDanny edited https://github.com/llvm/llvm-project/pull/95633 ___ 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 false positives of the result of std::move() is used as rvalue for performance-move-const-arg (PR #95633)

2024-06-15 Thread Danny Mösch via cfe-commits
https://github.com/SimplyDanny approved this pull request. https://github.com/llvm/llvm-project/pull/95633 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy] Clarify diagnostics of bugprone-sizeof-expression (PR #95550)

2024-06-15 Thread Danny Mösch via cfe-commits
https://github.com/SimplyDanny approved this pull request. https://github.com/llvm/llvm-project/pull/95550 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

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

2024-05-17 Thread Danny Mösch via cfe-commits
https://github.com/SimplyDanny approved this pull request. https://github.com/llvm/llvm-project/pull/92241 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

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

2024-05-17 Thread Danny Mösch 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 pro

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

2024-05-16 Thread Danny Mösch 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 pro

[clang-tools-extra] [clang-tidy] Ignore `if consteval` in else-after-return (PR #91588)

2024-05-13 Thread Danny Mösch via cfe-commits
SimplyDanny wrote: Thank you, @JoverZhang! https://github.com/llvm/llvm-project/pull/91588 ___ 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 `if consteval` in else-after-return (PR #91588)

2024-05-13 Thread Danny Mösch via cfe-commits
https://github.com/SimplyDanny closed https://github.com/llvm/llvm-project/pull/91588 ___ 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 `if consteval` in else-after-return (PR #91588)

2024-05-13 Thread Danny Mösch via cfe-commits
https://github.com/SimplyDanny approved this pull request. https://github.com/llvm/llvm-project/pull/91588 ___ 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 `if consteval` in else-after-return (PR #91588)

2024-05-13 Thread Danny Mösch via cfe-commits
@@ -337,6 +337,10 @@ Changes in existing checks ` check by excluding include directives that form the filename using macro. +- Improved :doc:`readability-else-after-return + ` check to ignore + `consteval if` condition, where need to retain the else statement. --

[clang-tools-extra] [clang-tidy] support expect no diagnosis test (PR #91293)

2024-05-09 Thread Danny Mösch via cfe-commits
@@ -226,6 +226,11 @@ def run_clang_tidy(self): print("--") return clang_tidy_output +def check_no_diagnosis(self, clang_tidy_output): +print(clang_tidy_output) +if clang_tidy_o

[clang-tools-extra] [clang-tidy] support expect no diagnosis test (PR #91293)

2024-05-09 Thread Danny Mösch via cfe-commits
https://github.com/SimplyDanny approved this pull request. I like this much more than an explicit option. However, consider my feedback as suggestions only as I don't have that much of experience with the project. I might miss or misinterpret something. https://github.com/llvm/llvm-project/pul

[clang-tools-extra] [clang-tidy] support expect no diagnosis test (PR #91293)

2024-05-09 Thread Danny Mösch via cfe-commits
https://github.com/SimplyDanny edited https://github.com/llvm/llvm-project/pull/91293 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy] support expect no diagnosis test (PR #91293)

2024-05-09 Thread Danny Mösch via cfe-commits
SimplyDanny wrote: > If nothing is provided, then nothing can be detected. And why is this not a valid test? No `CHECK-*` comments in the reference file, so no violations from `clang-tidy` are expected? > `not` will treat non-zero return code as success. It is totally different > thing. 👍

[clang-tools-extra] [clang-tidy] support expect no diagnosis test (PR #91293)

2024-05-08 Thread Danny Mösch via cfe-commits
SimplyDanny wrote: Why can the tests not just accept reference files that do not contain any `CHECK-*` comments? Then, no separate argument would be needed. In fact, I still sometimes struggle to find the correct options, command line and `CHECK-*` syntax. More options further complicate the s

[clang] [NFC] Use `const&` avoiding copies (PR #90334)

2024-05-06 Thread Danny Mösch via cfe-commits
https://github.com/SimplyDanny closed https://github.com/llvm/llvm-project/pull/90334 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [NFC] Use `const&` avoiding copies (PR #90334)

2024-05-06 Thread Danny Mösch via cfe-commits
https://github.com/SimplyDanny updated https://github.com/llvm/llvm-project/pull/90334 From bf9a6bb1e899b756d2d9e795f689947f2f5d6a00 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Danny=20M=C3=B6sch?= Date: Sat, 27 Apr 2024 11:38:20 +0200 Subject: [PATCH] [NFC] Use const& avoiding copies --- clang/

[clang] [NFC] Use `const&` avoiding copies (PR #90334)

2024-05-04 Thread Danny Mösch via cfe-commits
https://github.com/SimplyDanny updated https://github.com/llvm/llvm-project/pull/90334 From e8420d3d39d729ee83e187913bb3a8d790f5779d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Danny=20M=C3=B6sch?= Date: Sat, 27 Apr 2024 11:38:20 +0200 Subject: [PATCH] [NFC] Use const& avoiding copies --- clang/

[clang-tools-extra] [clang-tidy] new check misc-use-internal-linkage (PR #90830)

2024-05-04 Thread Danny Mösch via cfe-commits
@@ -0,0 +1,79 @@ +//===--- UseInternalLinkageCheck.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] new check misc-use-internal-linkage (PR #90830)

2024-05-04 Thread Danny Mösch via cfe-commits
https://github.com/SimplyDanny approved this pull request. https://github.com/llvm/llvm-project/pull/90830 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy] new check misc-use-internal-linkage (PR #90830)

2024-05-04 Thread Danny Mösch via cfe-commits
https://github.com/SimplyDanny edited https://github.com/llvm/llvm-project/pull/90830 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [NFC] Use `const&` avoiding copies (PR #90334)

2024-05-04 Thread Danny Mösch via cfe-commits
https://github.com/SimplyDanny updated https://github.com/llvm/llvm-project/pull/90334 From 5b74f02a766d66cfdd97adf4e89c091b9aa1823d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Danny=20M=C3=B6sch?= Date: Sat, 27 Apr 2024 11:38:20 +0200 Subject: [PATCH] [NFC] Use const& avoiding copies --- clang/

[clang] [NFC] Use `const&` avoiding copies (PR #90334)

2024-05-04 Thread Danny Mösch via cfe-commits
SimplyDanny wrote: > This change seems to be unrelated to the platform, and I don't think it's the > change that caused the CI error. From the compiled log, it seems that there > is not enough memory space. width="1499" > src="https://private-user-images.githubusercontent.com/22370779/3279381

[clang] [NFC] Use `const&` avoiding copies (PR #90334)

2024-05-03 Thread Danny Mösch via cfe-commits
SimplyDanny wrote: The failing Windows tests seem to be related to my change, yet I can't see what actually failed. Can you help me figure out what's wrong, @lipracer? https://github.com/llvm/llvm-project/pull/90334 ___ cfe-commits mailing list cfe-co

[clang-tools-extra] [clang-tidy] new check readability-mark-static (PR #90830)

2024-05-03 Thread Danny Mösch via cfe-commits
@@ -151,6 +151,11 @@ New checks Enforces consistent style for enumerators' initialization, covering three styles: none, first only, or all initialized explicitly. +- New :doc:`readability-unnecessary-external-linkage + ` check. + + Detects variable and function can be ma

[clang-tools-extra] [clang-tidy] new check readability-mark-static (PR #90830)

2024-05-03 Thread Danny Mösch via cfe-commits
@@ -0,0 +1,80 @@ +//===--- UnnecessaryExternalLinkageCheck.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

[clang-tools-extra] [clang-tidy] new check readability-mark-static (PR #90830)

2024-05-03 Thread Danny Mösch via cfe-commits
@@ -0,0 +1,80 @@ +//===--- UnnecessaryExternalLinkageCheck.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

[clang-tools-extra] [clang-tidy] new check readability-mark-static (PR #90830)

2024-05-03 Thread Danny Mösch via cfe-commits
@@ -0,0 +1,26 @@ +.. title:: clang-tidy - readability-unnecessary-external-linkage + +readability-unnecessary-external-linkage + + +Detects variable and function can be marked as static. + +Static functions and variables are scoped to a sing

[clang-tools-extra] [clang-tidy] new check readability-mark-static (PR #90830)

2024-05-03 Thread Danny Mösch via cfe-commits
@@ -0,0 +1,80 @@ +//===--- UnnecessaryExternalLinkageCheck.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

[clang] [NFC] Use `const&` avoiding copies (PR #90334)

2024-05-01 Thread Danny Mösch via cfe-commits
https://github.com/SimplyDanny updated https://github.com/llvm/llvm-project/pull/90334 From 5b74f02a766d66cfdd97adf4e89c091b9aa1823d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Danny=20M=C3=B6sch?= Date: Sat, 27 Apr 2024 11:38:20 +0200 Subject: [PATCH] [NFC] Use const& avoiding copies --- clang/

[clang-tools-extra] [clang-tidy] Relax readability-const-return-type (PR #90560)

2024-04-30 Thread Danny Mösch via cfe-commits
https://github.com/SimplyDanny approved this pull request. https://github.com/llvm/llvm-project/pull/90560 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [NFC] Use `const&` avoiding copies (PR #90334)

2024-04-29 Thread Danny Mösch via cfe-commits
https://github.com/SimplyDanny edited https://github.com/llvm/llvm-project/pull/90334 ___ 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-format check (PR #90397)

2024-04-29 Thread Danny Mösch via cfe-commits
@@ -0,0 +1,107 @@ +//===--- UseStdFormatCheck.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-format check (PR #90397)

2024-04-28 Thread Danny Mösch via cfe-commits
@@ -0,0 +1,84 @@ +.. title:: clang-tidy - modernize-use-std-format + +modernize-use-std-format + + +Converts calls to ``absl::StrFormat``, or other functions via +configuration options, to C++20's ``std::format``, or another function +via a configuration op

[clang-tools-extra] [clang-tidy] Add modernize-use-std-format check (PR #90397)

2024-04-28 Thread Danny Mösch via cfe-commits
@@ -0,0 +1,107 @@ +//===--- UseStdFormatCheck.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-format check (PR #90397)

2024-04-28 Thread Danny Mösch via cfe-commits
@@ -0,0 +1,84 @@ +.. title:: clang-tidy - modernize-use-std-format + +modernize-use-std-format + + +Converts calls to ``absl::StrFormat``, or other functions via +configuration options, to C++20's ``std::format``, or another function +via a configuration op

[clang-tools-extra] [clang-tidy] Add modernize-use-std-format check (PR #90397)

2024-04-28 Thread Danny Mösch via cfe-commits
@@ -0,0 +1,84 @@ +.. title:: clang-tidy - modernize-use-std-format + +modernize-use-std-format + + +Converts calls to ``absl::StrFormat``, or other functions via +configuration options, to C++20's ``std::format``, or another function +via a configuration op

[clang-tools-extra] [clang-tidy] Add modernize-use-std-format check (PR #90397)

2024-04-28 Thread Danny Mösch via cfe-commits
@@ -0,0 +1,107 @@ +//===--- UseStdFormatCheck.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-format check (PR #90397)

2024-04-28 Thread Danny Mösch via cfe-commits
https://github.com/SimplyDanny edited https://github.com/llvm/llvm-project/pull/90397 ___ 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-format check (PR #90397)

2024-04-28 Thread Danny Mösch via cfe-commits
https://github.com/SimplyDanny approved this pull request. Only a few nits concerning non-functional code/text. Other than that LGTM. https://github.com/llvm/llvm-project/pull/90397 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.

[clang] [NFC] Use `const&` avoiding copies (PR #90334)

2024-04-27 Thread Danny Mösch via cfe-commits
https://github.com/SimplyDanny created https://github.com/llvm/llvm-project/pull/90334 None From 35eed2c0faf74b241ee5e765dbc9f7ca115b9fba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Danny=20M=C3=B6sch?= Date: Sat, 27 Apr 2024 11:38:20 +0200 Subject: [PATCH] [NFC] Use const& avoiding copies ---

[clang-tools-extra] [clang-tidy] Ensure nullable variable is not accessed without validity test (PR #90173)

2024-04-27 Thread Danny Mösch via cfe-commits
https://github.com/SimplyDanny closed https://github.com/llvm/llvm-project/pull/90173 ___ 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 false-positives for templates in `bugprone-return-const-ref-from-parameter` (PR #90273)

2024-04-27 Thread Danny Mösch via cfe-commits
https://github.com/SimplyDanny approved this pull request. https://github.com/llvm/llvm-project/pull/90273 ___ 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 false-positives for templates in `bugprone-return-const-ref-from-parameter` (PR #90273)

2024-04-27 Thread Danny Mösch via cfe-commits
SimplyDanny wrote: > Do we add `improvement` documentation for checks that landed in the same > release cycle? I don't think that's needed. https://github.com/llvm/llvm-project/pull/90273 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https:

[clang-tools-extra] [clang-tidy] Add fix-its to `readability-avoid-return-with-void-value` check (PR #81420)

2024-04-25 Thread Danny Mösch via cfe-commits
@@ -42,10 +44,30 @@ void AvoidReturnWithVoidValueCheck::check( const auto *VoidReturn = Result.Nodes.getNodeAs("void_return"); if (IgnoreMacros && VoidReturn->getBeginLoc().isMacroID()) return; - if (!StrictMode && !Result.Nodes.getNodeAs("compound_parent")) + const a

[clang-tools-extra] [clang-tidy] Ensure nullable variable is not accessed without validity test (PR #90173)

2024-04-25 Thread Danny Mösch via cfe-commits
https://github.com/SimplyDanny created https://github.com/llvm/llvm-project/pull/90173 None From f8e0509e0586ae7cb1a236e27b8be27a94bf7cf5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Danny=20M=C3=B6sch?= Date: Fri, 26 Apr 2024 08:38:40 +0200 Subject: [PATCH] [clang-tidy] Ensure nullable variable i

[clang-tools-extra] [tidy] add new check bugprone-return-const-ref-from-parameter (PR #89497)

2024-04-22 Thread Danny Mösch via cfe-commits
@@ -112,6 +112,13 @@ New checks Detects error-prone Curiously Recurring Template Pattern usage, when the CRTP can be constructed outside itself and the derived class. +- New :doc:`bugprone-return-const-ref-from-parameter + ` check. + + Detects return statements that retu

[clang-tools-extra] [tidy] add new check bugprone-return-const-ref-from-parameter (PR #89497)

2024-04-22 Thread Danny Mösch via cfe-commits
@@ -0,0 +1,40 @@ +//===--- ReturnConstRefFromParameterCheck.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] [tidy] add new check bugprone-return-const-ref-from-parameter (PR #89497)

2024-04-22 Thread Danny Mösch via cfe-commits
https://github.com/SimplyDanny approved this pull request. Only a few more nits from my side. https://github.com/llvm/llvm-project/pull/89497 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-co

[clang-tools-extra] [tidy] add new check bugprone-return-const-ref-from-parameter (PR #89497)

2024-04-22 Thread Danny Mösch via cfe-commits
@@ -0,0 +1,31 @@ +.. title:: clang-tidy - bugprone-return-const-ref-from-parameter + +bugprone-return-const-ref-from-parameter + + +Detects return statements that return a constant reference parameter as constant +reference. This may cause

[clang-tools-extra] [tidy] add new check bugprone-return-const-ref-from-parameter (PR #89497)

2024-04-22 Thread Danny Mösch via cfe-commits
https://github.com/SimplyDanny edited https://github.com/llvm/llvm-project/pull/89497 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [tidy] add new check bugprone-return-const-ref-from-parameter (PR #89497)

2024-04-22 Thread Danny Mösch via cfe-commits
@@ -0,0 +1,34 @@ +//===--- ReturnConstRefFromParameterCheck.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] [tidy] add new check bugprone-return-const-ref-from-parameter (PR #89497)

2024-04-21 Thread Danny Mösch via cfe-commits
@@ -0,0 +1,34 @@ +//===--- ReturnConstRefFromParameterCheck.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] [tidy] add new check bugprone-return-const-ref-from-parameter (PR #89497)

2024-04-21 Thread Danny Mösch via cfe-commits
@@ -0,0 +1,31 @@ +.. title:: clang-tidy - bugprone-return-const-ref-from-parameter + +bugprone-return-const-ref-from-parameter + + +Detects return statements that return constant reference parameter as constant SimplyDanny w

[clang-tools-extra] [tidy] add new check bugprone-return-const-ref-from-parameter (PR #89497)

2024-04-21 Thread Danny Mösch via cfe-commits
@@ -0,0 +1,35 @@ +//===--- ReturnConstRefFromParameterCheck.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] [tidy] add new check bugprone-return-const-ref-from-parameter (PR #89497)

2024-04-20 Thread Danny Mösch via cfe-commits
@@ -341,9 +342,9 @@ Clang-Tidy Checks :doc:`portability-std-allocator-const `, :doc:`readability-avoid-const-params-in-decls `, "Yes" :doc:`readability-avoid-nested-conditional-operator `, - :doc:`readability-avoid-return-with-void-value `, + :doc:`readability-a

[clang-tools-extra] [tidy] add new check bugprone-return-const-ref-from-parameter (PR #89497)

2024-04-20 Thread Danny Mösch via cfe-commits
@@ -0,0 +1,41 @@ +//===--- ReturnConstRefFromParameterCheck.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] [tidy] add new check bugprone-return-const-ref-from-parameter (PR #89497)

2024-04-20 Thread Danny Mösch via cfe-commits
@@ -0,0 +1,41 @@ +//===--- ReturnConstRefFromParameterCheck.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] [tidy] add new check bugprone-return-const-ref-from-parameter (PR #89497)

2024-04-20 Thread Danny Mösch via cfe-commits
@@ -0,0 +1,30 @@ +.. title:: clang-tidy - bugprone-return-const-ref-from-parameter + +bugprone-return-const-ref-from-parameter + + +Detects the function which returns the const reference from parameter which +causes potential use after free

[clang-tools-extra] [tidy] add new check bugprone-return-const-ref-from-parameter (PR #89497)

2024-04-20 Thread Danny Mösch via cfe-commits
@@ -0,0 +1,35 @@ +//===--- ReturnConstRefFromParameterCheck.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] Ignore non-forwarded arguments if they are unnamed (PR #87832)

2024-04-08 Thread Danny Mösch via cfe-commits
https://github.com/SimplyDanny closed https://github.com/llvm/llvm-project/pull/87832 ___ 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 non-forwarded arguments if they are unnamed (PR #87832)

2024-04-08 Thread Danny Mösch via cfe-commits
https://github.com/SimplyDanny updated https://github.com/llvm/llvm-project/pull/87832 From 229e1cb251139a32fc2e944b8d0f4d402987820f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Danny=20M=C3=B6sch?= Date: Fri, 5 Apr 2024 23:41:50 +0200 Subject: [PATCH 1/5] [clang-tidy] Ignore non-forwarded argument

[clang-tools-extra] [clang-tidy] Ignore non-forwarded arguments if they are unnamed (PR #87832)

2024-04-07 Thread Danny Mösch via cfe-commits
https://github.com/SimplyDanny updated https://github.com/llvm/llvm-project/pull/87832 From 2c4dd9281b1bf6bb02ff7efb6421f22bd35e27b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Danny=20M=C3=B6sch?= Date: Fri, 5 Apr 2024 23:41:50 +0200 Subject: [PATCH 1/5] [clang-tidy] Ignore non-forwarded argument

[clang-tools-extra] [clang-tidy] Ignore non-forwarded arguments if they are unnamed (PR #87832)

2024-04-07 Thread Danny Mösch via cfe-commits
https://github.com/SimplyDanny updated https://github.com/llvm/llvm-project/pull/87832 From 2c4dd9281b1bf6bb02ff7efb6421f22bd35e27b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Danny=20M=C3=B6sch?= Date: Fri, 5 Apr 2024 23:41:50 +0200 Subject: [PATCH 1/5] [clang-tidy] Ignore non-forwarded argument

  1   2   3   >