[clang-tools-extra] create new clang-tidy check to add namespaces to symbol references (PR #70621)

2023-10-30 Thread Piotr Zegar via cfe-commits
@@ -0,0 +1,840 @@ +//===--- UseExplicitNamespacesCheck.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] create new clang-tidy check to add namespaces to symbol references (PR #70621)

2023-10-30 Thread Piotr Zegar via cfe-commits
@@ -0,0 +1,840 @@ +//===--- UseExplicitNamespacesCheck.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] create new clang-tidy check to add namespaces to symbol references (PR #70621)

2023-10-30 Thread Piotr Zegar via cfe-commits
@@ -0,0 +1,840 @@ +//===--- UseExplicitNamespacesCheck.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] create new clang-tidy check to add namespaces to symbol references (PR #70621)

2023-10-30 Thread Piotr Zegar via cfe-commits
@@ -0,0 +1,840 @@ +//===--- UseExplicitNamespacesCheck.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] create new clang-tidy check to add namespaces to symbol references (PR #70621)

2023-10-30 Thread Piotr Zegar via cfe-commits
@@ -0,0 +1,22 @@ +// RUN: %check_clang_tidy %s readability-use-explicit-namespaces %t + PiotrZSL wrote: Add tests with: - templates - operators - classes - fixes - ... https://github.com/llvm/llvm-project/pull/70621 __

[clang-tools-extra] create new clang-tidy check to add namespaces to symbol references (PR #70621)

2023-10-30 Thread Piotr Zegar via cfe-commits
@@ -0,0 +1,24 @@ +.. title:: clang-tidy - readability-use-explicit-namespaces + +readability-use-explicit-namespaces +=== + +This check detects and fixes references to members of namespaces where the namespace is not explicity specified in the refe

[clang-tools-extra] create new clang-tidy check to add namespaces to symbol references (PR #70621)

2023-10-30 Thread Piotr Zegar via cfe-commits
@@ -0,0 +1,64 @@ +//===--- UseExplicitNamespacesCheck.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] create new clang-tidy check to add namespaces to symbol references (PR #70621)

2023-10-30 Thread Piotr Zegar via cfe-commits
@@ -0,0 +1,840 @@ +//===--- UseExplicitNamespacesCheck.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] create new clang-tidy check to add namespaces to symbol references (PR #70621)

2023-10-30 Thread Piotr Zegar via cfe-commits
@@ -0,0 +1,840 @@ +//===--- UseExplicitNamespacesCheck.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] create new clang-tidy check to add namespaces to symbol references (PR #70621)

2023-10-30 Thread Piotr Zegar via cfe-commits
@@ -0,0 +1,840 @@ +//===--- UseExplicitNamespacesCheck.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] create new clang-tidy check to add namespaces to symbol references (PR #70621)

2023-10-30 Thread Piotr Zegar via cfe-commits
@@ -0,0 +1,840 @@ +//===--- UseExplicitNamespacesCheck.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] create new clang-tidy check to add namespaces to symbol references (PR #70621)

2023-10-30 Thread Piotr Zegar via cfe-commits
@@ -0,0 +1,840 @@ +//===--- UseExplicitNamespacesCheck.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] create new clang-tidy check to add namespaces to symbol references (PR #70621)

2023-10-30 Thread Piotr Zegar via cfe-commits
@@ -0,0 +1,840 @@ +//===--- UseExplicitNamespacesCheck.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] create new clang-tidy check to add namespaces to symbol references (PR #70621)

2023-10-30 Thread Piotr Zegar via cfe-commits
@@ -0,0 +1,840 @@ +//===--- UseExplicitNamespacesCheck.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] create new clang-tidy check to add namespaces to symbol references (PR #70621)

2023-10-30 Thread Piotr Zegar via cfe-commits
https://github.com/PiotrZSL requested changes to this pull request. I like an idea, but this check require lot of work. Todo: - Update to LLVM codding standard - https://llvm.org/docs/CodingStandards.html - Remove any custom diagnostic and things (noise) that aren't needed to make check function

[clang-tools-extra] [clang-tidy] Fix crash in modernize-use-trailing-return-type (PR #70709)

2023-10-30 Thread Piotr Zegar via cfe-commits
https://github.com/PiotrZSL created https://github.com/llvm/llvm-project/pull/70709 Resolved the crash that occurred during the use of a user-defined C-style string literal. The fix entails checking whether the identifier is non-empty before attempting to read its name. >From 05653ab752f43085

[clang-tools-extra] [clang-tidy] Fix crash in modernize-use-trailing-return-type (PR #70709)

2023-10-30 Thread Piotr Zegar via cfe-commits
PiotrZSL wrote: I'm not adding release notes because would be good to backport this fix to LLVM 17 branch. https://github.com/llvm/llvm-project/pull/70709 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/l

[clang-tools-extra] [clang-tidy] Fix crash in modernize-use-trailing-return-type (PR #70709)

2023-10-30 Thread Piotr Zegar via cfe-commits
https://github.com/PiotrZSL closed https://github.com/llvm/llvm-project/pull/70709 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-tools-extra] [clang][AST] Fix crash in MatchChildASTVisitor::TraverseLambdaExpr (PR #70962)

2023-11-01 Thread Piotr Zegar via cfe-commits
https://github.com/PiotrZSL created https://github.com/llvm/llvm-project/pull/70962 When a lambda expression captures a VLA array by reference, the 'capture_init' array contains one element, which is 'nullptr'. While traversing the AST with the 'IgnoreUnlessSpelledInSource' flag, there is a de

[clang-tools-extra] [NFC][clang-tidy]refactor isAssignmentToMemberOf in PreferMemberInitializerCheck (PR #71006)

2023-11-02 Thread Piotr Zegar via cfe-commits
@@ -216,11 +216,12 @@ void PreferMemberInitializerCheck::check( return; } -const FieldDecl *Field = nullptr; -const Expr *InitValue = nullptr; -std::tie(Field, InitValue) = isAssignmentToMemberOf(Class, S, Ctor); -if (!Field) +std::optional> +

[clang-tools-extra] [NFC][clang-tidy]refactor isAssignmentToMemberOf in PreferMemberInitializerCheck (PR #71006)

2023-11-02 Thread Piotr Zegar via cfe-commits
@@ -118,45 +118,45 @@ static void updateAssignmentLevel( } } -static std::pair +static std::optional> PiotrZSL wrote: Consider changing this std::pair into normal struct, in such way there will be no need to make aliases to fields later in check method ht

[clang-tools-extra] [NFC][clang-tidy]refactor isAssignmentToMemberOf in PreferMemberInitializerCheck (PR #71006)

2023-11-02 Thread Piotr Zegar via cfe-commits
https://github.com/PiotrZSL approved this pull request. +1, as it's better than was before. https://github.com/llvm/llvm-project/pull/71006 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-comm

[clang-tools-extra] [clang-tidy][libc] Ignore implicit function inline (PR #71095)

2023-11-02 Thread Piotr Zegar via cfe-commits
@@ -79,6 +79,10 @@ void InlineFunctionDeclCheck::check(const MatchFinder::MatchResult &Result) { if (MethodDecl->getParent()->isLambda()) return; + // Ignore implicit functions (e.g. implicit constructors or destructors) + if (FuncDecl->isImplicit()) -

[clang-tools-extra] [clang-tidy][libc] Ignore implicit function inline (PR #71095)

2023-11-02 Thread Piotr Zegar via cfe-commits
https://github.com/PiotrZSL approved this pull request. LGTM, Consider also adding tests for default and deleted constructors or assign operators, I think that they also could generate false-positive. https://github.com/llvm/llvm-project/pull/71095 _

[clang-tools-extra] [clang-tidy][libc] Ignore implicit function inline (PR #71095)

2023-11-02 Thread Piotr Zegar via cfe-commits
@@ -3,6 +3,7 @@ llvmlibc-inline-function-decl = -Checks that all implicit and explicit inline functions in header files are -tagged with the ``LIBC_INLINE`` macro. See the `libc style guide -`_ for more inf

[clang-tools-extra] [clang-tidy][libc] Ignore implicit function inline (PR #71095)

2023-11-02 Thread Piotr Zegar via cfe-commits
@@ -79,6 +79,10 @@ void InlineFunctionDeclCheck::check(const MatchFinder::MatchResult &Result) { if (MethodDecl->getParent()->isLambda()) return; + // Ignore functions that have been deleted. + if (FuncDecl->isDeleted()) PiotrZSL wrote: Instead o

[clang-tools-extra] [clang-tidy][libc] Ignore implicit function inline (PR #71095)

2023-11-02 Thread Piotr Zegar via cfe-commits
@@ -304,6 +304,10 @@ Changes in existing checks customizable namespace. This further allows for testing the libc when the system-libc is also LLVM's libc. +- Improved :doc:`llvmlibc-inline-function-decl + ` to properly ignore implicit PiotrZSL wrote: im

[clang-tools-extra] [clang] [clang][AST] Fix crash in MatchChildASTVisitor::TraverseLambdaExpr (PR #70962)

2023-11-02 Thread Piotr Zegar via cfe-commits
https://github.com/PiotrZSL updated https://github.com/llvm/llvm-project/pull/70962 >From 3e37e7e4afe806993acbba3d7663fdbfe80120c7 Mon Sep 17 00:00:00 2001 From: Piotr Zegar Date: Wed, 1 Nov 2023 17:01:25 + Subject: [PATCH 1/2] [clang][AST] Fix crash in MatchChildASTVisitor::TraverseLambda

[clang-tools-extra] [clang-tidy] Improve modernize-make-shared check (PR #70600)

2023-11-03 Thread Piotr Zegar via cfe-commits
https://github.com/PiotrZSL closed https://github.com/llvm/llvm-project/pull/70600 ___ 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 Piotr Zegar 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 Piotr Zegar 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 Piotr Zegar 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 Piotr Zegar 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] Improve `container-data-pointer` check to use `c_str()` (PR #71304)

2023-11-04 Thread Piotr Zegar via cfe-commits
@@ -3,13 +3,9 @@ readability-container-data-pointer == -Finds cases where code could use ``data()`` rather than the address of the -element at index 0 in a container. This pattern is commonly used to materialize -a pointer to the backing data of

[clang-tools-extra] [clang-tidy] Improve `container-data-pointer` check to use `c_str()` (PR #71304)

2023-11-04 Thread Piotr Zegar via cfe-commits
https://github.com/PiotrZSL requested changes to this pull request. It's not so easy, because if result of &[] is used as non-const, then using c_str will make code non-compilable. Some additional checks wuold be required, like checking if object is const, or checking if there is implicit cast

[clang-tools-extra] Allow to pass config file to clang-tidy-diff (PR #75457)

2023-12-14 Thread Piotr Zegar via cfe-commits
PiotrZSL wrote: > Note: This file lacks a `SPDX-FileCopyrightText:` in the header. Is this on > purpose? Looks like llvm does not use SPDX-FileCopyrightText. https://llvm.org/docs/DeveloperPolicy.html#copyright As for change looks, fine but please update release notes entry in clang-tools-ext

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

2023-12-14 Thread Piotr Zegar via cfe-commits
https://github.com/PiotrZSL approved this pull request. LGTM 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] [clang-tidy][misleading-indentation]ignore false-positives for line started with empty macro (PR #75061)

2023-12-17 Thread Piotr Zegar via cfe-commits
@@ -51,8 +52,22 @@ void MisleadingIndentationCheck::danglingElseCheck(const SourceManager &SM, diag(ElseLoc, "different indentation for 'if' and corresponding 'else'"); } -void MisleadingIndentationCheck::missingBracesCheck(const SourceManager &SM, -

[clang-tools-extra] [clang-tidy][misleading-indentation]ignore false-positives for line started with empty macro (PR #75061)

2023-12-17 Thread Piotr Zegar via cfe-commits
@@ -51,8 +52,22 @@ void MisleadingIndentationCheck::danglingElseCheck(const SourceManager &SM, diag(ElseLoc, "different indentation for 'if' and corresponding 'else'"); } -void MisleadingIndentationCheck::missingBracesCheck(const SourceManager &SM, -

[clang-tools-extra] [clang-tidy][misleading-indentation]ignore false-positives for line started with empty macro (PR #75061)

2023-12-17 Thread Piotr Zegar via cfe-commits
@@ -51,8 +52,22 @@ void MisleadingIndentationCheck::danglingElseCheck(const SourceManager &SM, diag(ElseLoc, "different indentation for 'if' and corresponding 'else'"); } -void MisleadingIndentationCheck::missingBracesCheck(const SourceManager &SM, -

[clang-tools-extra] [clang-tidy][misleading-indentation]ignore false-positives for line started with empty macro (PR #75061)

2023-12-17 Thread Piotr Zegar via cfe-commits
https://github.com/PiotrZSL requested changes to this pull request. +- fine, fix pointed out nits and could land https://github.com/llvm/llvm-project/pull/75061 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mail

[clang-tools-extra] Allow to pass config file to clang-tidy-diff (PR #75457)

2023-12-18 Thread Piotr Zegar via cfe-commits
@@ -128,6 +128,11 @@ Improvements to clang-tidy as a value for `-export-fixes` to export individual yaml files for each compilation unit. +- Improved :program:`clang-tidy-diff.py` script. It now accepts a `-config-file` option PiotrZSL wrote: There is al

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

2023-11-23 Thread Piotr Zegar via cfe-commits
=?utf-8?q?Björn?= Svensson Message-ID: In-Reply-To: PiotrZSL wrote: by separate check I mean "Create class that derive from oryginal check, move some code in oryginal check (config) to protected methods (mainly storeConfig) and just override config in parent class. SImply if you call --dump

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

2023-11-23 Thread Piotr Zegar via cfe-commits
=?utf-8?q?Félix-Antoine?= Constantin, =?utf-8?q?Félix-Antoine?= Constantin, =?utf-8?q?Félix-Antoine?= Constantin, =?utf-8?q?Félix-Antoine?= Constantin Message-ID: In-Reply-To: @@ -0,0 +1,109 @@ +//===--- RedundantInlineSpecifierCheck.cpp - clang-tidy===// +/

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

2023-11-23 Thread Piotr Zegar via cfe-commits
=?utf-8?q?Félix-Antoine?= Constantin, =?utf-8?q?Félix-Antoine?= Constantin, =?utf-8?q?Félix-Antoine?= Constantin, =?utf-8?q?Félix-Antoine?= Constantin Message-ID: In-Reply-To: @@ -0,0 +1,109 @@ +//===--- RedundantInlineSpecifierCheck.cpp - clang-tidy===// +/

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

2023-11-23 Thread Piotr Zegar via cfe-commits
=?utf-8?q?Félix-Antoine?= Constantin, =?utf-8?q?Félix-Antoine?= Constantin, =?utf-8?q?Félix-Antoine?= Constantin, =?utf-8?q?Félix-Antoine?= Constantin Message-ID: In-Reply-To: @@ -0,0 +1,110 @@ +// RUN: %check_clang_tidy %s readability-redundant-inline-specifier %t + +template

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

2023-11-23 Thread Piotr Zegar via cfe-commits
=?utf-8?q?Félix-Antoine?= Constantin, =?utf-8?q?Félix-Antoine?= Constantin, =?utf-8?q?Félix-Antoine?= Constantin, =?utf-8?q?Félix-Antoine?= Constantin Message-ID: In-Reply-To: @@ -0,0 +1,109 @@ +//===--- RedundantInlineSpecifierCheck.cpp - clang-tidy===// +/

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

2023-11-23 Thread Piotr Zegar via cfe-commits
=?utf-8?q?Félix-Antoine?= Constantin, =?utf-8?q?Félix-Antoine?= Constantin, =?utf-8?q?Félix-Antoine?= Constantin, =?utf-8?q?Félix-Antoine?= Constantin Message-ID: In-Reply-To: @@ -0,0 +1,109 @@ +//===--- RedundantInlineSpecifierCheck.cpp - clang-tidy===// +/

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

2023-11-23 Thread Piotr Zegar via cfe-commits
=?utf-8?q?Félix-Antoine?= Constantin, =?utf-8?q?Félix-Antoine?= Constantin, =?utf-8?q?Félix-Antoine?= Constantin, =?utf-8?q?Félix-Antoine?= Constantin Message-ID: In-Reply-To: @@ -0,0 +1,109 @@ +//===--- RedundantInlineSpecifierCheck.cpp - clang-tidy===// +/

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

2023-11-23 Thread Piotr Zegar via cfe-commits
=?utf-8?q?Félix-Antoine?= Constantin, =?utf-8?q?Félix-Antoine?= Constantin, =?utf-8?q?Félix-Antoine?= Constantin, =?utf-8?q?Félix-Antoine?= Constantin Message-ID: In-Reply-To: @@ -0,0 +1,109 @@ +//===--- RedundantInlineSpecifierCheck.cpp - clang-tidy===// +/

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

2023-11-24 Thread Piotr Zegar 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 Piotr Zegar via cfe-commits
https://github.com/PiotrZSL commented: Overall looks fine, but I didn't check test too deeply. Someone said not so long ago that we do not want to add matchers unless there is some usecase for them in some of the tools. Pull request doesn't say anything. Whats a purpose of those matchers (excep

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

2023-11-24 Thread Piotr Zegar via cfe-commits
https://github.com/PiotrZSL 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 Piotr Zegar via cfe-commits
@@ -319,6 +319,7 @@ RegistryMaps::RegistryMaps() { REGISTER_MATCHER(hasExplicitSpecifier); REGISTER_MATCHER(hasExternalFormalLinkage); REGISTER_MATCHER(hasFalseExpression); + REGISTER_MATCHER(hasFoldInit); PiotrZSL wrote: I think that you should also re

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

2023-11-24 Thread Piotr Zegar 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] [clang-tools-extra] [clang-tidy] Added new check to detect redundant inline keyword (PR #73069)

2023-11-25 Thread Piotr Zegar via cfe-commits
=?utf-8?q?Félix-Antoine?= Constantin, =?utf-8?q?Félix-Antoine?= Constantin, =?utf-8?q?Félix-Antoine?= Constantin, =?utf-8?q?Félix-Antoine?= Constantin Message-ID: In-Reply-To: @@ -0,0 +1,109 @@ +//===--- RedundantInlineSpecifierCheck.cpp - clang-tidy===// +/

[clang-tools-extra] fc19424 - [clang-tidy][NFC] Fix bugprone-suspicious-enum-usage tests

2023-11-29 Thread Piotr Zegar via cfe-commits
Author: Piotr Zegar Date: 2023-11-29T22:53:59Z New Revision: fc19424d1d6d0df20e1734610a8e80a8e5158009 URL: https://github.com/llvm/llvm-project/commit/fc19424d1d6d0df20e1734610a8e80a8e5158009 DIFF: https://github.com/llvm/llvm-project/commit/fc19424d1d6d0df20e1734610a8e80a8e5158009.diff LOG: [

[clang] [Clang] Implement P2864R2 Remove Deprecated Arithmetic Conversion on… (PR #73105)

2023-11-29 Thread Piotr Zegar via cfe-commits
PiotrZSL wrote: Actually that is more like a quick fix, we can live with it. More proper way would be simply to split those tests into pre-c++20 and universal. https://github.com/llvm/llvm-project/pull/73105 ___ cfe-commits mailing list cfe-commits@li

[clang-tools-extra] [clang-tidy] performance-unnecessary-copy-init: Add a hook... (PR #73921)

2023-11-30 Thread Piotr Zegar via cfe-commits
PiotrZSL wrote: First what's a purpose of this change. Is there any other check that will need it or not ? Second is that actually onWarningEmitted should be more a emitWarning, and those diag should be inside it, so that they could be changed if needed. Or condition required to emit a warning

[clang-tools-extra] [clang-tidy] performance-unnecessary-copy-init: Add a hook... (PR #73921)

2023-11-30 Thread Piotr Zegar via cfe-commits
PiotrZSL wrote: In theory changes that are required for "private" checks should be done by you on some own private fork instead of adding that "unused" code here. But only option I see is simply moving diagnostic to separate methods, and make those methods virtual. That could be +- acceptable.

[clang-tools-extra] [clang-tidy] performance-unnecessary-copy-init: Add a hook... (PR #73921)

2023-11-30 Thread Piotr Zegar via cfe-commits
@@ -302,6 +303,20 @@ void UnnecessaryCopyInitialization::check( } } +void UnnecessaryCopyInitialization::makeDiagnostic( +DiagnosticBuilder Diagnostic, const VarDecl &Var, const Stmt &BlockStmt, +const DeclStmt &Stmt, ASTContext &Context, bool IssueFix) { + const bo

[clang-tools-extra] [clang-tidy] performance-unnecessary-copy-init: Add a hook... (PR #73921)

2023-11-30 Thread Piotr Zegar via cfe-commits
@@ -302,6 +303,20 @@ void UnnecessaryCopyInitialization::check( } } +void UnnecessaryCopyInitialization::makeDiagnostic( +DiagnosticBuilder Diagnostic, const VarDecl &Var, const Stmt &BlockStmt, PiotrZSL wrote: Create Diagnostic fully in this method ins

[clang-tools-extra] [clang-tidy] performance-unnecessary-copy-init: Add a hook... (PR #73921)

2023-11-30 Thread Piotr Zegar via cfe-commits
@@ -302,6 +303,20 @@ void UnnecessaryCopyInitialization::check( } } +void UnnecessaryCopyInitialization::makeDiagnostic( +DiagnosticBuilder Diagnostic, const VarDecl &Var, const Stmt &BlockStmt, +const DeclStmt &Stmt, ASTContext &Context, bool IssueFix) { + const bo

[clang-tools-extra] [clang-tidy] performance-unnecessary-copy-init: Add a hook... (PR #73921)

2023-11-30 Thread Piotr Zegar via cfe-commits
@@ -32,6 +32,12 @@ class UnnecessaryCopyInitialization : public ClangTidyCheck { void check(const ast_matchers::MatchFinder::MatchResult &Result) override; void storeOptions(ClangTidyOptions::OptionMap &Opts) override; +protected: + // This is virtual so that derived clas

[clang-tools-extra] [clang-tidy] performance-unnecessary-copy-init: Add a hook... (PR #73921)

2023-12-01 Thread Piotr Zegar via cfe-commits
@@ -302,6 +303,20 @@ void UnnecessaryCopyInitialization::check( } } +void UnnecessaryCopyInitialization::makeDiagnostic( +DiagnosticBuilder Diagnostic, const VarDecl &Var, const Stmt &BlockStmt, PiotrZSL wrote: Then create 2 "makeDiagnostic", one for on

[clang-tools-extra] [clang-tidy] Add new modernize-use-starts-ends-with check (PR #72385)

2023-12-01 Thread Piotr Zegar via cfe-commits
@@ -0,0 +1,22 @@ +.. title:: clang-tidy - modernize-use-starts-ends-with + +modernize-use-starts-ends-with + PiotrZSL wrote: make it shorter to match name https://github.com/llvm/llvm-project/pull/72385 ___

[clang-tools-extra] [clang-tidy] Add new modernize-use-starts-ends-with check (PR #72385)

2023-12-01 Thread Piotr Zegar via cfe-commits
https://github.com/PiotrZSL approved this pull request. For a starts_with looks fine, consider now adding support for ends_with, maybe in separate push request once this will be merged. https://github.com/llvm/llvm-project/pull/72385 ___ cfe-commits m

[clang-tools-extra] [clang-tidy] Fix false-positives in readability-container-size-empty (PR #74140)

2023-12-01 Thread Piotr Zegar via cfe-commits
https://github.com/PiotrZSL created https://github.com/llvm/llvm-project/pull/74140 Added support for size-like method returning signed type, and corrected false positive caused by always-false check for size bellow zero. Closes #72619 >From 2770caf83fe210cbff94e776c52593920a4cbf8d Mon Sep 17

[clang-tools-extra] [clang-tidy] Add new modernize-use-starts-ends-with check (PR #72385)

2023-12-01 Thread Piotr Zegar via cfe-commits
PiotrZSL wrote: @nicovank I run check on llvm, reported 3 issues, no false-positives. There is warning reported for FindFun variable because is used only in assert, check if you could do something with it, maybe add if for checking agains null, to silent warning or removing this variable and a

[clang] [llvm] [clang-tools-extra] Fix #41439: Update the documentation with the correct information. (PR #69377)

2023-12-01 Thread Piotr Zegar via cfe-commits
https://github.com/PiotrZSL approved this pull request. LGTM. Unless you want it merged as "57949090+da-vi...@users.noreply.github.com", please update your github config. https://github.com/llvm/llvm-project/pull/69377 ___ cfe-commits mailing list cfe

[clang-tools-extra] [clang-tidy] readability-container-contains literal suffixes (PR #74215)

2023-12-04 Thread Piotr Zegar via cfe-commits
https://github.com/PiotrZSL approved this pull request. LGTM https://github.com/llvm/llvm-project/pull/74215 ___ 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 new modernize-use-starts-ends-with check (PR #72385)

2023-12-04 Thread Piotr Zegar via cfe-commits
PiotrZSL wrote: @nicovank "nvankem...@fb.com" is fine ? To enable "meta.com" you may need to add this email in github and confirm it. Then it will allow you to select it as "default". https://github.com/llvm/llvm-project/pull/72385 ___ cfe-commits ma

[clang-tools-extra] [clang-tidy] Add new modernize-use-starts-ends-with check (PR #72385)

2023-12-04 Thread Piotr Zegar via cfe-commits
PiotrZSL wrote: @nicovank Interesting, still shows fb as main email, most probably because commit were done from that one, you could try to change commit email and do force push, could help. Sad thing is that if you would have ability to click squash and merge, then it would show you option to

[clang-tools-extra] [clang-tidy] Add new modernize-use-starts-ends-with check (PR #72385)

2023-12-04 Thread Piotr Zegar via cfe-commits
https://github.com/PiotrZSL closed https://github.com/llvm/llvm-project/pull/72385 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang] [llvm] Fix #41439: Update the documentation with the correct information. (PR #69377)

2023-12-04 Thread Piotr Zegar via cfe-commits
https://github.com/PiotrZSL closed https://github.com/llvm/llvm-project/pull/69377 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

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

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

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

2023-12-04 Thread Piotr Zegar via cfe-commits
https://github.com/PiotrZSL requested changes to this pull request. Few fixes needed, but looks you are on good road. https://github.com/llvm/llvm-project/pull/67467 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin

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

2023-12-04 Thread Piotr Zegar via cfe-commits
@@ -118,6 +119,7 @@ Clang-Tidy Checks :doc:`bugprone-posix-return `, "Yes" :doc:`bugprone-redundant-branch-condition `, "Yes" :doc:`bugprone-reserved-identifier `, "Yes" + :doc:`bugprone-shared-pointer-contents-move `, "Yes" PiotrZSL wrote: reupli

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

2023-12-04 Thread Piotr Zegar via cfe-commits
@@ -0,0 +1,39 @@ +//===--- MoveSharedPointerContentsCheck.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

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

2023-12-04 Thread Piotr Zegar via cfe-commits
@@ -0,0 +1,51 @@ +//===--- MoveSharedPointerContentsCheck.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] [openmp] [llvm] [clang-tidy] Add bugprone-move-shared-pointer-contents check. (PR #67467)

2023-12-04 Thread Piotr Zegar via cfe-commits
@@ -107,6 +107,7 @@ Clang-Tidy Checks :doc:`bugprone-misplaced-pointer-arithmetic-in-alloc `, "Yes" :doc:`bugprone-misplaced-widening-cast `, :doc:`bugprone-move-forwarding-reference `, "Yes" + :doc:`bugprone-move-shared-pointer-contents `, "Yes"

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

2023-12-04 Thread Piotr Zegar via cfe-commits
@@ -0,0 +1,51 @@ +//===--- MoveSharedPointerContentsCheck.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

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

2023-12-04 Thread Piotr Zegar via cfe-commits
@@ -0,0 +1,51 @@ +//===--- MoveSharedPointerContentsCheck.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] [openmp] [llvm] [clang-tidy] Add bugprone-move-shared-pointer-contents check. (PR #67467)

2023-12-04 Thread Piotr Zegar via cfe-commits
@@ -0,0 +1,51 @@ +//===--- MoveSharedPointerContentsCheck.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] [llvm] [openmp] [clang-tidy] Add bugprone-move-shared-pointer-contents check. (PR #67467)

2023-12-04 Thread Piotr Zegar via cfe-commits
@@ -25,6 +25,7 @@ add_clang_library(clangTidyBugproneModule ImplicitWideningOfMultiplicationResultCheck.cpp InaccurateEraseCheck.cpp IncorrectEnableIfCheck.cpp + MoveSharedPointerContentsCheck.cpp PiotrZSL wrote: Duplicated file, remove this line https

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

2023-12-04 Thread Piotr Zegar via cfe-commits
@@ -0,0 +1,75 @@ +// RUN: %check_clang_tidy %s bugprone-move-shared-pointer-contents %t -- -config="{CheckOptions: {bugprone-move-shared-pointer-contents.SharedPointerClasses: 'std::shared_ptr;my::OtherSharedPtr;'}}" + +// Some dummy definitions we'll need. + +namespace std { +

[clang-tools-extra] [clang-tidy] readability-container-contains literal suffixes (PR #74215)

2023-12-04 Thread Piotr Zegar via cfe-commits
https://github.com/PiotrZSL closed https://github.com/llvm/llvm-project/pull/74215 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] Fix #75687: add std::span to the default types. (PR #76116)

2023-12-21 Thread Piotr Zegar via cfe-commits
https://github.com/PiotrZSL approved this pull request. Looks ok, please add entry in release notes. https://github.com/llvm/llvm-project/pull/76116 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo

[llvm] [clang] [clang-tools-extra] [clang-tidy] modernize-use-digit-separator issue #35414 (PR #76153)

2023-12-21 Thread Piotr Zegar via cfe-commits
@@ -0,0 +1,39 @@ +//===--- UseDigitSeparatorCheck.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] [clang-tools-extra] [llvm] [clang-tidy] modernize-use-digit-separator issue #35414 (PR #76153)

2023-12-21 Thread Piotr Zegar via cfe-commits
@@ -0,0 +1,235 @@ +//===--- UseDigitSeparatorCheck.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] [llvm] [clang-tools-extra] [clang-tidy] modernize-use-digit-separator issue #35414 (PR #76153)

2023-12-21 Thread Piotr Zegar via cfe-commits
@@ -0,0 +1,235 @@ +//===--- UseDigitSeparatorCheck.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] [llvm] [clang-tools-extra] [clang-tidy] modernize-use-digit-separator issue #35414 (PR #76153)

2023-12-21 Thread Piotr Zegar via cfe-commits
https://github.com/PiotrZSL edited https://github.com/llvm/llvm-project/pull/76153 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-tools-extra] [llvm] [clang-tidy] modernize-use-digit-separator issue #35414 (PR #76153)

2023-12-21 Thread Piotr Zegar via cfe-commits
@@ -0,0 +1,239 @@ +// RUN: %check_clang_tidy %s modernize-use-digit-separator %t + + +// Long not formatted literals + +int NotFormattedInteger = 1234567; +// CHECK-MESSAGES: :[[@LINE-1]]:27: warning: unformatted representation of integer literal '1234567' [modernize-use-digit-se

[llvm] [clang-tools-extra] [clang] [clang-tidy] modernize-use-digit-separator issue #35414 (PR #76153)

2023-12-21 Thread Piotr Zegar via cfe-commits
@@ -0,0 +1,235 @@ +//===--- UseDigitSeparatorCheck.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

[llvm] [clang] [clang-tools-extra] [clang-tidy] modernize-use-digit-separator issue #35414 (PR #76153)

2023-12-21 Thread Piotr Zegar via cfe-commits
@@ -0,0 +1,235 @@ +//===--- UseDigitSeparatorCheck.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] [clang-tools-extra] [llvm] [clang-tidy] modernize-use-digit-separator issue #35414 (PR #76153)

2023-12-21 Thread Piotr Zegar via cfe-commits
@@ -0,0 +1,235 @@ +//===--- UseDigitSeparatorCheck.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] [llvm] [clang] [clang-tidy] modernize-use-digit-separator issue #35414 (PR #76153)

2023-12-21 Thread Piotr Zegar via cfe-commits
@@ -0,0 +1,235 @@ +//===--- UseDigitSeparatorCheck.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] [clang-tools-extra] [llvm] [clang-tidy] modernize-use-digit-separator issue #35414 (PR #76153)

2023-12-21 Thread Piotr Zegar via cfe-commits
@@ -0,0 +1,235 @@ +//===--- UseDigitSeparatorCheck.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

[llvm] [clang] [clang-tools-extra] [clang-tidy] modernize-use-digit-separator issue #35414 (PR #76153)

2023-12-21 Thread Piotr Zegar via cfe-commits
@@ -0,0 +1,235 @@ +//===--- UseDigitSeparatorCheck.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] [llvm] [clang] [clang-tidy] modernize-use-digit-separator issue #35414 (PR #76153)

2023-12-21 Thread Piotr Zegar via cfe-commits
@@ -0,0 +1,235 @@ +//===--- UseDigitSeparatorCheck.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

<    1   2   3   4   5   6   7   8   9   10   >