[clang-tools-extra] [clang-tidy] Fix handling of members in readability-redundant-member-init (PR #93217)

2024-05-23 Thread Julian Schmidt via cfe-commits
https://github.com/5chmidti edited https://github.com/llvm/llvm-project/pull/93217 ___ 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 handling of members in readability-redundant-member-init (PR #93217)

2024-05-23 Thread Julian Schmidt via cfe-commits
https://github.com/5chmidti approved this pull request. LGTM, with a release note nit. https://github.com/llvm/llvm-project/pull/93217 ___ 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 handling of members in readability-redundant-member-init (PR #93217)

2024-05-23 Thread Julian Schmidt via cfe-commits
@@ -387,6 +387,11 @@ Changes in existing checks ` check to properly emit warnings for static data member with an in-class initializer. +- Improved :doc:`readability-redundant-member-init + ` check to avoid + false-positives when type of the member does not match type of

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

2024-05-26 Thread Julian Schmidt via cfe-commits
https://github.com/5chmidti edited 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-05-26 Thread Julian Schmidt via cfe-commits
@@ -501,70 +506,72 @@ def main(): # Build up a big regexy filter from all command line arguments. file_name_re = re.compile("|".join(args.files)) +files = {f for f in files if file_name_re.search(f)} -return_code = 0 +returncode = 0 try: -# S

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

2024-05-26 Thread Julian Schmidt via cfe-commits
@@ -501,70 +506,72 @@ def main(): # Build up a big regexy filter from all command line arguments. file_name_re = re.compile("|".join(args.files)) +files = {f for f in files if file_name_re.search(f)} -return_code = 0 +returncode = 0 try: -# S

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

2024-05-26 Thread Julian Schmidt via cfe-commits
https://github.com/5chmidti commented: Thanks for the cleanup, it looks overall good (w.r.t `asyncio`: I only know about `asyncio` what I read in this pr). > Only print the filename after completion, not the entire Clang-Tidy > invocation command. I find this neater but the behavior can easily

[clang-tools-extra] Update identifier-length.rst (PR #93467)

2024-05-27 Thread Julian Schmidt via cfe-commits
https://github.com/5chmidti approved this pull request. https://github.com/llvm/llvm-project/pull/93467 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][test] add TestLanguage.def to specify all tested language versions (PR #94243)

2024-08-24 Thread Julian Schmidt via cfe-commits
https://github.com/5chmidti updated https://github.com/llvm/llvm-project/pull/94243 >From 1ef1bc0bfebca8ca114a57ea2d5016418e36446d Mon Sep 17 00:00:00 2001 From: Julian Schmidt Date: Sat, 1 Jun 2024 17:38:37 +0200 Subject: [PATCH 1/3] [clang][test] add TestLanguage.def to specify all tested la

[clang] [clang][test] add TestLanguage.def to specify all tested language versions (PR #94243)

2024-08-24 Thread Julian Schmidt via cfe-commits
5chmidti wrote: rebase + ping. @AaronBallman could you check if this is okay now? I could merge the AST matcher doc testing stack if that is the case https://github.com/llvm/llvm-project/pull/94243 ___ cfe-commits mailing list cfe-commits@lists.llvm.o

[clang-tools-extra] [clang-tidy] Use upper case letters for bool conversion suffix (PR #104882)

2024-08-24 Thread Julian Schmidt via cfe-commits
@@ -108,6 +108,11 @@ Changes in existing checks ` check to remove `->`, when reduntant `get()` is removed. +- Improved :doc:`readablility-implicit-bool-conversion 5chmidti wrote: Please sort your entry before `readability-redundant-smartptr-get` https://

[clang-tools-extra] [clang-tidy] Use upper case letters for bool conversion suffix (PR #104882)

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

[clang-tools-extra] [clang-tidy] Use upper case letters for bool conversion suffix (PR #104882)

2024-08-24 Thread Julian Schmidt via cfe-commits
https://github.com/5chmidti approved this pull request. LGTM but with two nits https://github.com/llvm/llvm-project/pull/104882 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy] Use upper case letters for bool conversion suffix (PR #104882)

2024-08-24 Thread Julian Schmidt via cfe-commits
@@ -392,8 +402,16 @@ void ImplicitBoolConversionCheck::handleCastFromBool( if (const auto *BoolLiteral = dyn_cast(Cast->getSubExpr()->IgnoreParens())) { -Diag << tooling::fixit::createReplacement( -*Cast, getEquivalentForBoolLiteral(BoolLiteral, DestTyp

[clang-tools-extra] [clang-tidy] Fix for cppcoreguidelines-pro-type-union-access if memLoc is invalid (PR #104540)

2024-08-24 Thread Julian Schmidt via cfe-commits
https://github.com/5chmidti requested changes to this pull request. This is still missing a release note, see https://github.com/llvm/llvm-project/blob/40975da950c95124155b752cd683d945f7d203fd/clang-tools-extra/docs/ReleaseNotes.rst?plain=1#L104 for where to add it and how they look like Funct

[clang] [ASTMatchers] Extend hasName matcher when matching templates (PR #100349)

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

[clang] [ASTMatchers] Extend hasName matcher when matching templates (PR #100349)

2024-08-24 Thread Julian Schmidt via cfe-commits
@@ -638,6 +638,39 @@ bool HasNameMatcher::matchesNodeFullFast(const NamedDecl &Node) const { return Patterns.foundMatch(/*AllowFullyQualified=*/true); } +static std::optional consumePatternBack(StringRef Pattern, + StringRef

[clang] [ASTMatchers] Extend hasName matcher when matching templates (PR #100349)

2024-08-24 Thread Julian Schmidt via cfe-commits
@@ -638,6 +638,39 @@ bool HasNameMatcher::matchesNodeFullFast(const NamedDecl &Node) const { return Patterns.foundMatch(/*AllowFullyQualified=*/true); } +static std::optional consumePatternBack(StringRef Pattern, + StringRef

[clang] [ASTMatchers] Extend hasName matcher when matching templates (PR #100349)

2024-08-24 Thread Julian Schmidt via cfe-commits
@@ -638,6 +638,39 @@ bool HasNameMatcher::matchesNodeFullFast(const NamedDecl &Node) const { return Patterns.foundMatch(/*AllowFullyQualified=*/true); } +static std::optional consumePatternBack(StringRef Pattern, + StringRef

[clang] [ASTMatchers] Extend hasName matcher when matching templates (PR #100349)

2024-08-24 Thread Julian Schmidt via cfe-commits
https://github.com/5chmidti requested changes to this pull request. I think it does make sense to add this wildcard. The motivation to skip regex sounds like a good one, and it does make sense to special case templates specifically. The implementation looks correct to me. Just some small things

[clang] [ASTMatchers] Extend hasName matcher when matching templates (PR #100349)

2024-08-24 Thread Julian Schmidt via cfe-commits
@@ -653,10 +686,12 @@ bool HasNameMatcher::matchesNodeFullSlow(const NamedDecl &Node) const { for (const StringRef Pattern : Names) { if (Pattern.starts_with("::")) { -if (FullName == Pattern) +if (auto Result = consumePatternBack(Pattern, FullName);

[clang-tools-extra] [clang-tidy] Create bugprone-incorrect-enable-shared-from-this check (PR #102299)

2024-08-24 Thread Julian Schmidt via cfe-commits
5chmidti wrote: > for me oryginal version that used registerMatchers instead of visitor were > way better, specially that there are matchers that could be used for this, or > could be written. We do have the `isDerivedFrom` matcher, actually. > in most projects not many classes actually used

[clang-tools-extra] [clang-tidy] Update TODO comment check (PR #104868)

2024-08-24 Thread Julian Schmidt via cfe-commits
@@ -24,3 +24,7 @@ // TODO(b/12345): find the holy grail // TODO (b/12345): allow spaces before parentheses // TODO(asdf) allow missing semicolon +// TODO: bug 12345678 - Remove this after the 2047q4 compatibility window expires. +// TODO: example.com/my-design-doc - Manually f

[clang-tools-extra] [clang-tidy] Update TODO comment check (PR #104868)

2024-08-24 Thread Julian Schmidt via cfe-commits
@@ -9,6 +9,7 @@ #include "TodoCommentCheck.h" #include "clang/Frontend/CompilerInstance.h" #include "clang/Lex/Preprocessor.h" +#include 5chmidti wrote: Please remove this unused include https://github.com/llvm/llvm-project/pull/104868 __

[clang-tools-extra] [clang-tidy] Fix for cppcoreguidelines-pro-type-union-access if memLoc is invalid (PR #104540)

2024-08-24 Thread Julian Schmidt via cfe-commits
@@ -116,6 +116,10 @@ Changes in existing checks ` check to remove `->`, when redundant `get()` is removed. +- Fixed :doc:`cppcoreguidelines-pro-type-union-access + ` check to + report location even when member location is not valid. 5chmidti wrote: nit:

[clang-tools-extra] [clang-tidy] Fix for cppcoreguidelines-pro-type-union-access if memLoc is invalid (PR #104540)

2024-08-24 Thread Julian Schmidt via cfe-commits
https://github.com/5chmidti approved this pull request. https://github.com/llvm/llvm-project/pull/104540 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clangd] Let DefineOutline tweak handle member functions (PR #95235)

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

[clang-tools-extra] [clangd] Let DefineOutline tweak handle member functions (PR #95235)

2024-08-24 Thread Julian Schmidt via cfe-commits
https://github.com/5chmidti commented: >From a functionality standpoint, this looks good to me. I noted some small >things in the code, and this is also missing a release not entry. https://github.com/llvm/llvm-project/pull/95235 ___ cfe-commits maili

[clang-tools-extra] [clangd] Let DefineOutline tweak handle member functions (PR #95235)

2024-08-24 Thread Julian Schmidt via cfe-commits
@@ -212,9 +232,13 @@ getFunctionSourceCode(const FunctionDecl *FD, const DeclContext *TargetContext, } } const NamedDecl *ND = Ref.Targets.front(); -const std::string Qualifier = +std::string Qualifier = getQualification(A

[clang-tools-extra] [clangd] Let DefineOutline tweak handle member functions (PR #95235)

2024-08-24 Thread Julian Schmidt via cfe-commits
@@ -407,10 +431,21 @@ class DefineOutline : public Tweak { return !SameFile; } -// Bail out in templated classes, as it is hard to spell the class name, -// i.e if the template parameter is unnamed. -if (MD->getParent()->isTemplated()) - return false

[clang-tools-extra] [clangd] Let DefineOutline tweak handle member functions (PR #95235)

2024-08-24 Thread Julian Schmidt via cfe-commits
@@ -407,10 +431,21 @@ class DefineOutline : public Tweak { return !SameFile; } -// Bail out in templated classes, as it is hard to spell the class name, -// i.e if the template parameter is unnamed. -if (MD->getParent()->isTemplated()) - return false

[clang-tools-extra] [clangd] Let DefineOutline tweak handle member functions (PR #95235)

2024-08-24 Thread Julian Schmidt via cfe-commits
@@ -144,8 +144,13 @@ getQualification(ASTContext &Context, const DeclContext *DestContext, // since we stored inner-most parent first. std::string Result; llvm::raw_string_ostream OS(Result); - for (const auto *Parent : llvm::reverse(Parents)) + for (const auto *Parent

[clang-tools-extra] [clangd] Let DefineOutline tweak handle member functions (PR #95235)

2024-08-24 Thread Julian Schmidt via cfe-commits
@@ -128,7 +128,27 @@ getFunctionSourceAfterReplacements(const FunctionDecl *FD, SM.getBufferData(SM.getMainFileID()), Replacements); if (!QualifiedFunc) return QualifiedFunc.takeError(); - return QualifiedFunc->substr(FuncBegin, FuncEnd - FuncBegin + 1); + + std::

[clang-tools-extra] [clangd] Let DefineOutline tweak handle member functions (PR #95235)

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

[clang-tools-extra] [clang-tidy][run-clang-tidy] Fix minor shutdown noise (PR #105724)

2024-08-24 Thread Julian Schmidt via cfe-commits
https://github.com/5chmidti approved this pull request. Because the commit with asyncio is in llvm-19, could you please add a release note for this fix? @PiotrZSL wdyt about backporting this? 19.1.0 may be too late, but for 19.2.0 then https://github.com/llvm/llvm-project/pull/105724

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

2024-06-23 Thread Julian Schmidt via cfe-commits
@@ -0,0 +1,5 @@ +// RUN: not clang-tidy %s -checks='-*' +// RUN: clang-tidy %s -checks='-*' --allow-no-checks | FileCheck --match-full-lines %s + + +// CHECK: No checks enabled. 5chmidti wrote: missing newline https://github.com/llvm/llvm-project/pull/96122 ___

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

2024-06-23 Thread Julian Schmidt via cfe-commits
5chmidti wrote: the same should probably be done for `diff-clang-tidy.py` https://github.com/llvm/llvm-project/pull/96122 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/

[clang-tools-extra] [clang-tidy] add fixhint for misc-use-internal-linkage (PR #96203)

2024-06-23 Thread Julian Schmidt via cfe-commits
5chmidti wrote: The other two functions have fixes as well. I'd argue that template declarations don't need to be inside anonymous namespaces/`static`, but that's outside the scope of this pr. Either way, this pr should check that both have an attached fixit:

[clang-tools-extra] [clang-tidy] add fixhint for misc-use-internal-linkage (PR #96203)

2024-06-23 Thread Julian Schmidt via cfe-commits
@@ -82,11 +82,19 @@ static constexpr StringRef Message = void UseInternalLinkageCheck::check(const MatchFinder::MatchResult &Result) { if (const auto *FD = Result.Nodes.getNodeAs("fn")) { -diag(FD->getLocation(), Message) << "function" << FD; +DiagnosticBuilder DB =

[clang-tools-extra] [clang-tidy] align all help message in run-clang-tidy (PR #96199)

2024-06-23 Thread Julian Schmidt via cfe-commits
https://github.com/5chmidti commented: When you add a `.` to make the help messages sentences, then you might want to capitalize the first word as well. https://github.com/llvm/llvm-project/pull/96199 ___ cfe-commits mailing list cfe-commits@lists.llv

[clang-tools-extra] Enforce SL.con.3: Add check to replace operator[] with at() [Cont.] (PR #95220)

2024-06-23 Thread Julian Schmidt via cfe-commits
Paul =?utf-8?q?Heidekrüger?= , Paul =?utf-8?q?Heidekrüger?= , Paul =?utf-8?q?Heidekrüger?= , Paul =?utf-8?q?Heidekrüger?= , Paul =?utf-8?q?Heidekrüger?= , Paul =?utf-8?q?Heidekrüger?= , Paul =?utf-8?q?Heidekrüger?= , Paul =?utf-8?q?Heidekrüger?= , Paul =?utf-8?q?Heidekrüger?= , Paul =?utf-8?q?Heide

[clang-tools-extra] Enforce SL.con.3: Add check to replace operator[] with at() [Cont.] (PR #95220)

2024-06-23 Thread Julian Schmidt via cfe-commits
Paul =?utf-8?q?Heidekrüger?= , Paul =?utf-8?q?Heidekrüger?= , Paul =?utf-8?q?Heidekrüger?= , Paul =?utf-8?q?Heidekrüger?= , Paul =?utf-8?q?Heidekrüger?= , Paul =?utf-8?q?Heidekrüger?= , Paul =?utf-8?q?Heidekrüger?= , Paul =?utf-8?q?Heidekrüger?= , Paul =?utf-8?q?Heidekrüger?= , Paul =?utf-8?q?Heide

[clang-tools-extra] Enforce SL.con.3: Add check to replace operator[] with at() [Cont.] (PR #95220)

2024-06-23 Thread Julian Schmidt via cfe-commits
Paul =?utf-8?q?Heidekrüger?= , Paul =?utf-8?q?Heidekrüger?= , Paul =?utf-8?q?Heidekrüger?= , Paul =?utf-8?q?Heidekrüger?= , Paul =?utf-8?q?Heidekrüger?= , Paul =?utf-8?q?Heidekrüger?= , Paul =?utf-8?q?Heidekrüger?= , Paul =?utf-8?q?Heidekrüger?= , Paul =?utf-8?q?Heidekrüger?= , Paul =?utf-8?q?Heide

[clang-tools-extra] Enforce SL.con.3: Add check to replace operator[] with at() [Cont.] (PR #95220)

2024-06-23 Thread Julian Schmidt via cfe-commits
Paul =?utf-8?q?Heidekrüger?= , Paul =?utf-8?q?Heidekrüger?= , Paul =?utf-8?q?Heidekrüger?= , Paul =?utf-8?q?Heidekrüger?= , Paul =?utf-8?q?Heidekrüger?= , Paul =?utf-8?q?Heidekrüger?= , Paul =?utf-8?q?Heidekrüger?= , Paul =?utf-8?q?Heidekrüger?= , Paul =?utf-8?q?Heidekrüger?= , Paul =?utf-8?q?Heide

[clang-tools-extra] Enforce SL.con.3: Add check to replace operator[] with at() [Cont.] (PR #95220)

2024-06-23 Thread Julian Schmidt via cfe-commits
=��___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] Enforce SL.con.3: Add check to replace operator[] with at() [Cont.] (PR #95220)

2024-06-23 Thread Julian Schmidt via cfe-commits
Paul =?utf-8?q?Heidekrüger?= , Paul =?utf-8?q?Heidekrüger?= , Paul =?utf-8?q?Heidekrüger?= , Paul =?utf-8?q?Heidekrüger?= , Paul =?utf-8?q?Heidekrüger?= , Paul =?utf-8?q?Heidekrüger?= , Paul =?utf-8?q?Heidekrüger?= , Paul =?utf-8?q?Heidekrüger?= , Paul =?utf-8?q?Heidekrüger?= , Paul =?utf-8?q?Heide

[clang-tools-extra] Enforce SL.con.3: Add check to replace operator[] with at() [Cont.] (PR #95220)

2024-06-23 Thread Julian Schmidt via cfe-commits
Paul =?utf-8?q?Heidekrüger?= , Paul =?utf-8?q?Heidekrüger?= , Paul =?utf-8?q?Heidekrüger?= , Paul =?utf-8?q?Heidekrüger?= , Paul =?utf-8?q?Heidekrüger?= , Paul =?utf-8?q?Heidekrüger?= , Paul =?utf-8?q?Heidekrüger?= , Paul =?utf-8?q?Heidekrüger?= , Paul =?utf-8?q?Heidekrüger?= , Paul =?utf-8?q?Heide

[clang-tools-extra] Enforce SL.con.3: Add check to replace operator[] with at() [Cont.] (PR #95220)

2024-06-23 Thread Julian Schmidt via cfe-commits
=��___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] Enforce SL.con.3: Add check to replace operator[] with at() [Cont.] (PR #95220)

2024-06-23 Thread Julian Schmidt via cfe-commits
Paul =?utf-8?q?Heidekrüger?= , Paul =?utf-8?q?Heidekrüger?= , Paul =?utf-8?q?Heidekrüger?= , Paul =?utf-8?q?Heidekrüger?= , Paul =?utf-8?q?Heidekrüger?= , Paul =?utf-8?q?Heidekrüger?= , Paul =?utf-8?q?Heidekrüger?= , Paul =?utf-8?q?Heidekrüger?= , Paul =?utf-8?q?Heidekrüger?= , Paul =?utf-8?q?Heide

[clang-tools-extra] Enforce SL.con.3: Add check to replace operator[] with at() [Cont.] (PR #95220)

2024-06-23 Thread Julian Schmidt via cfe-commits
Paul =?utf-8?q?Heidekrüger?= , Paul =?utf-8?q?Heidekrüger?= , Paul =?utf-8?q?Heidekrüger?= , Paul =?utf-8?q?Heidekrüger?= , Paul =?utf-8?q?Heidekrüger?= , Paul =?utf-8?q?Heidekrüger?= , Paul =?utf-8?q?Heidekrüger?= , Paul =?utf-8?q?Heidekrüger?= , Paul =?utf-8?q?Heidekrüger?= , Paul =?utf-8?q?Heide

[clang-tools-extra] [clang-tidy] Add `bugprone-pointer-arithmetic-on-polymorphic-object` check (PR #91951)

2024-06-23 Thread Julian Schmidt via cfe-commits
@@ -0,0 +1,81 @@ +//===--- PointerArithmeticOnPolymorphicObjectCheck.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] Improve `container-data-pointer` check to use `c_str()` (PR #71304)

2024-06-23 Thread Julian Schmidt via cfe-commits
5chmidti wrote: No worries. Feel free to ask in reviews or in discord though. Feel free to close it if you don't want to work on this anymore. The pr will still be linked in the issue, in case someone wants to look at it. https://github.com/llvm/llvm-project/pull/71304

[clang-tools-extra] [clang-tidy] Added bugprone-exception-rethrow check (PR #86448)

2024-06-23 Thread Julian Schmidt via cfe-commits
https://github.com/5chmidti edited https://github.com/llvm/llvm-project/pull/86448 ___ 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-25 Thread Julian Schmidt via cfe-commits
https://github.com/5chmidti approved this pull request. LGTM 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] align all help message in run-clang-tidy (PR #96199)

2024-06-25 Thread Julian Schmidt via cfe-commits
https://github.com/5chmidti approved this pull request. https://github.com/llvm/llvm-project/pull/96199 ___ 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 fixhint for misc-use-internal-linkage (PR #96203)

2024-06-25 Thread Julian Schmidt via cfe-commits
https://github.com/5chmidti approved this pull request. LGTM from my side https://github.com/llvm/llvm-project/pull/96203 ___ 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 fixhint for misc-use-internal-linkage (PR #96203)

2024-06-25 Thread Julian Schmidt via cfe-commits
https://github.com/5chmidti edited https://github.com/llvm/llvm-project/pull/96203 ___ 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 fixhint for misc-use-internal-linkage (PR #96203)

2024-06-25 Thread Julian Schmidt via cfe-commits
@@ -25,3 +25,16 @@ Example: } // already declared as extern extern int v2; + +Options +--- + +.. option:: FixMode + + Selects the fix mode when fixing automatically. 5chmidti wrote: Not sure if it is better: `Selects what kind of a fix the check sho

[clang-tools-extra] [clang-tidy] Create bugprone-bit-cast-pointers check (PR #108083)

2024-09-11 Thread Julian Schmidt via cfe-commits
@@ -0,0 +1,32 @@ +//===--- BitCastPointersCheck.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] Create bugprone-bit-cast-pointers check (PR #108083)

2024-09-11 Thread Julian Schmidt via cfe-commits
@@ -0,0 +1,32 @@ +//===--- BitCastPointersCheck.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] remove type annotations that require python3.9 in add_new_check.py (PR #107850)

2024-09-12 Thread Julian Schmidt via cfe-commits
https://github.com/5chmidti closed https://github.com/llvm/llvm-project/pull/107850 ___ 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 Julian Schmidt 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] add default error message for performance-avoid-endl (PR #107867)

2024-09-12 Thread Julian Schmidt via cfe-commits
@@ -120,6 +120,10 @@ Changes in existing checks ` check to support replacing member function calls too. +- Improved :doc:`performance-avoid-endl + ` check by fixing incorrect + message. + 5chmidti wrote: This feels a bit terse to me. (possible change wo

[clang-tools-extra] [clang-tidy] Create bugprone-incorrect-enable-shared-from-this check (PR #102299)

2024-09-12 Thread Julian Schmidt via cfe-commits
@@ -0,0 +1,95 @@ +//===--- IncorrectEnableSharedFromThisCheck.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] Create bugprone-incorrect-enable-shared-from-this check (PR #102299)

2024-09-12 Thread Julian Schmidt via cfe-commits
@@ -0,0 +1,95 @@ +//===--- IncorrectEnableSharedFromThisCheck.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] Create bugprone-incorrect-enable-shared-from-this check (PR #102299)

2024-09-12 Thread Julian Schmidt via cfe-commits
@@ -0,0 +1,95 @@ +//===--- IncorrectEnableSharedFromThisCheck.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] Create bugprone-incorrect-enable-shared-from-this check (PR #102299)

2024-09-12 Thread Julian Schmidt via cfe-commits
@@ -0,0 +1,35 @@ +//===--- IncorrectEnableSharedFromThisCheck.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] Create bugprone-incorrect-enable-shared-from-this check (PR #102299)

2024-09-12 Thread Julian Schmidt via cfe-commits
5chmidti wrote: Please add tests with macros involved. https://github.com/llvm/llvm-project/pull/102299 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commi

[clang-tools-extra] [clang-tidy] Create bugprone-incorrect-enable-shared-from-this check (PR #102299)

2024-09-12 Thread Julian Schmidt via cfe-commits
@@ -0,0 +1,95 @@ +//===--- IncorrectEnableSharedFromThisCheck.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] Create bugprone-incorrect-enable-shared-from-this check (PR #102299)

2024-09-12 Thread Julian Schmidt via cfe-commits
@@ -0,0 +1,121 @@ +// RUN: %check_clang_tidy -std=c++11 %s bugprone-incorrect-enable-shared-from-this %t + +// NOLINTBEGIN +namespace std { +template class enable_shared_from_this {}; +} //namespace std +// NOLINTEND + +class BadClassExample : std::enable_shared_from_this {}

[clang-tools-extra] [clang-tidy] Create bugprone-incorrect-enable-shared-from-this check (PR #102299)

2024-09-12 Thread Julian Schmidt via cfe-commits
@@ -0,0 +1,95 @@ +//===--- IncorrectEnableSharedFromThisCheck.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] Create bugprone-incorrect-enable-shared-from-this check (PR #102299)

2024-09-12 Thread Julian Schmidt via cfe-commits
@@ -0,0 +1,95 @@ +//===--- IncorrectEnableSharedFromThisCheck.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] Add user-defined functions to `bugprone-unsafe-functions` check (PR #106350)

2024-09-12 Thread Julian Schmidt via cfe-commits
https://github.com/5chmidti approved this pull request. This looks good from my side. https://github.com/llvm/llvm-project/pull/106350 ___ 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 user-defined functions to `bugprone-unsafe-functions` check (PR #106350)

2024-09-12 Thread Julian Schmidt via cfe-commits
@@ -127,57 +134,137 @@ static bool isAnnexKAvailable(std::optional &CacheVar, Preprocessor *PP, return CacheVar.value(); } +static std::vector +parseCheckedFunctions(StringRef Option, ClangTidyContext *Context) { + const std::vector Functions = + utils::options::parse

[clang-tools-extra] [clang-tidy] Add user-defined functions to `bugprone-unsafe-functions` check (PR #106350)

2024-09-12 Thread Julian Schmidt via cfe-commits
@@ -127,57 +134,137 @@ static bool isAnnexKAvailable(std::optional &CacheVar, Preprocessor *PP, return CacheVar.value(); } +static std::vector +parseCheckedFunctions(StringRef Option, ClangTidyContext *Context) { + const std::vector Functions = + utils::options::parse

[clang-tools-extra] [clang-tidy] Add user-defined functions to `bugprone-unsafe-functions` check (PR #106350)

2024-09-12 Thread Julian Schmidt via cfe-commits
https://github.com/5chmidti edited https://github.com/llvm/llvm-project/pull/106350 ___ 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 `std::span` to default `bugprone-dangling-handle.HandleClasses` (PR #107711)

2024-09-12 Thread Julian Schmidt via cfe-commits
https://github.com/5chmidti approved this pull request. FYI: this is a partial fix of #75685 https://github.com/llvm/llvm-project/pull/107711 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-c

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

2024-09-13 Thread Julian Schmidt via cfe-commits
https://github.com/5chmidti edited 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-13 Thread Julian Schmidt via cfe-commits
@@ -123,6 +123,10 @@ Changes in existing checks ` check to support replacing member function calls too. +- Improved :doc:`performance-avoid-endl + ` check to use ``std::endl`` as + placeholder when lexer cannot get source text. 5chmidti wrote: Sounds be

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

2024-09-13 Thread Julian Schmidt via cfe-commits
https://github.com/5chmidti approved this pull request. LGTM 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]suggest use `std::span` as replacement of c array in C++20 for modernize-avoid-c-arrays (PR #108555)

2024-09-13 Thread Julian Schmidt via cfe-commits
@@ -38,6 +39,13 @@ AST_MATCHER(clang::ParmVarDecl, isArgvOfMain) { return FD ? FD->isMain() : false; } +AST_MATCHER_P(clang::TypeLoc, alwaysTrue, + clang::ast_matchers::internal::Matcher, + InnerMatcher) { + InnerMatcher.matches(Node, Finder, Build

[clang-tools-extra] [clang-tidy]suggest use `std::span` as replacement of c array in C++20 for modernize-avoid-c-arrays (PR #108555)

2024-09-13 Thread Julian Schmidt via cfe-commits
@@ -1,9 +1,9 @@ -// RUN: %check_clang_tidy %s modernize-avoid-c-arrays %t -- \ +// RUN: %check_clang_tidy -std=c++17 %s modernize-avoid-c-arrays %t -- \ // RUN: -config='{CheckOptions: { modernize-avoid-c-arrays.AllowStringArrays: true }}' const char name[] = "name"; const

[clang-tools-extra] [clang-tidy]suggest use `std::span` as replacement of c array in C++20 for modernize-avoid-c-arrays (PR #108555)

2024-09-13 Thread Julian Schmidt via cfe-commits
@@ -111,6 +111,10 @@ Changes in existing checks ` check to suggest replacing the offending code with ``reinterpret_cast``, to more clearly express intent. +- Improved :doc:`modernize-avoid-c-arrays + ` check to suggest use std::span + as replacement of c array in C++20.

[clang-tools-extra] [clang-tidy]suggest use `std::span` as replacement of c array in C++20 for modernize-avoid-c-arrays (PR #108555)

2024-09-13 Thread Julian Schmidt via cfe-commits
@@ -72,11 +81,24 @@ void AvoidCArraysCheck::registerMatchers(MatchFinder *Finder) { void AvoidCArraysCheck::check(const MatchFinder::MatchResult &Result) { const auto *ArrayType = Result.Nodes.getNodeAs("typeloc"); - + const bool IsInParam = + Result.Nodes.getNodeAs("

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

2024-09-13 Thread Julian Schmidt via cfe-commits
https://github.com/5chmidti closed 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] [llvm] [clangd] Add CodeAction to swap operands to binary operators (PR #78999)

2024-09-13 Thread Julian Schmidt via cfe-commits
@@ -0,0 +1,38 @@ +//===-- SwapBinaryOperandsTests.cpp -*- 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] [llvm] [clangd] Add CodeAction to swap operands to binary operators (PR #78999)

2024-09-13 Thread Julian Schmidt via cfe-commits
@@ -0,0 +1,210 @@ +//===--- SwapBinaryOperands.cpp --*- 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: Ap

[clang-tools-extra] [llvm] [clangd] Add CodeAction to swap operands to binary operators (PR #78999)

2024-09-13 Thread Julian Schmidt via cfe-commits
@@ -0,0 +1,210 @@ +//===--- SwapBinaryOperands.cpp --*- 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: Ap

[clang-tools-extra] [llvm] [clangd] Add CodeAction to swap operands to binary operators (PR #78999)

2024-09-13 Thread Julian Schmidt via cfe-commits
https://github.com/5chmidti commented: Could you add a release note for this as well? https://github.com/llvm/llvm-project/pull/78999 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [llvm] [clangd] Add CodeAction to swap operands to binary operators (PR #78999)

2024-09-13 Thread Julian Schmidt via cfe-commits
@@ -0,0 +1,210 @@ +//===--- SwapBinaryOperands.cpp --*- 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: Ap

[clang-tools-extra] [llvm] [clangd] Add CodeAction to swap operands to binary operators (PR #78999)

2024-09-13 Thread Julian Schmidt via cfe-commits
https://github.com/5chmidti edited https://github.com/llvm/llvm-project/pull/78999 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [llvm] [clangd] Add CodeAction to swap operands to binary operators (PR #78999)

2024-09-13 Thread Julian Schmidt via cfe-commits
@@ -0,0 +1,210 @@ +//===--- SwapBinaryOperands.cpp --*- 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: Ap

[clang-tools-extra] [llvm] [clangd] Add CodeAction to swap operands to binary operators (PR #78999)

2024-09-13 Thread Julian Schmidt via cfe-commits
@@ -0,0 +1,210 @@ +//===--- SwapBinaryOperands.cpp --*- 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: Ap

[clang-tools-extra] [llvm] [clangd] Add CodeAction to swap operands to binary operators (PR #78999)

2024-09-13 Thread Julian Schmidt via cfe-commits
https://github.com/5chmidti edited https://github.com/llvm/llvm-project/pull/78999 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [llvm] [clangd] Add CodeAction to swap operands to binary operators (PR #78999)

2024-09-13 Thread Julian Schmidt via cfe-commits
https://github.com/5chmidti edited https://github.com/llvm/llvm-project/pull/78999 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [llvm] [clangd] Add CodeAction to swap operands to binary operators (PR #78999)

2024-09-13 Thread Julian Schmidt via cfe-commits
https://github.com/5chmidti edited https://github.com/llvm/llvm-project/pull/78999 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy] Create bugprone-bit-cast-pointers check (PR #108083)

2024-09-15 Thread Julian Schmidt via cfe-commits
@@ -0,0 +1,32 @@ +//===--- BitCastPointersCheck.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] Create bugprone-bit-cast-pointers check (PR #108083)

2024-09-15 Thread Julian Schmidt via cfe-commits
@@ -0,0 +1,32 @@ +//===--- BitCastPointersCheck.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] Create bugprone-bit-cast-pointers check (PR #108083)

2024-09-15 Thread Julian Schmidt via cfe-commits
@@ -0,0 +1,32 @@ +//===--- BitCastPointersCheck.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] Create bugprone-bit-cast-pointers check (PR #108083)

2024-09-15 Thread Julian Schmidt via cfe-commits
@@ -0,0 +1,34 @@ +//===--- BitCastPointersCheck.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

<    3   4   5   6   7   8   9   10   11   12   >