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

2024-03-08 Thread Piotr Zegar via cfe-commits
@@ -0,0 +1,167 @@ +//===--- MathMissingParenthesesCheck.cpp - clang-tidy -===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Ap

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

2024-03-08 Thread Piotr Zegar via cfe-commits
@@ -0,0 +1,167 @@ +//===--- MathMissingParenthesesCheck.cpp - clang-tidy -===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Ap

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

2024-03-08 Thread Piotr Zegar via cfe-commits
@@ -0,0 +1,167 @@ +//===--- MathMissingParenthesesCheck.cpp - clang-tidy -===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Ap

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

2024-03-08 Thread Piotr Zegar via cfe-commits
@@ -0,0 +1,167 @@ +//===--- MathMissingParenthesesCheck.cpp - clang-tidy -===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Ap

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

2024-03-08 Thread Piotr Zegar via cfe-commits
https://github.com/PiotrZSL edited https://github.com/llvm/llvm-project/pull/84481 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

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

2024-03-08 Thread Piotr Zegar via cfe-commits
https://github.com/PiotrZSL requested changes to this pull request. In short, manual code parsing is not allowed, for that e got AST already. Sad thing is that you already wrote all those parsing functions, because this check can be implemented in 60 lines of code. https://github.com/llvm/llvm-

[clang] [clang][ASTMatcher] Add matchers for isExplicitObjectMemberFunction() (PR #84446)

2024-03-08 Thread Piotr Zegar via cfe-commits
https://github.com/PiotrZSL approved this pull request. LGTM. https://github.com/llvm/llvm-project/pull/84446 ___ 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 Hungarian Prefix in readability-identifier-naming (PR #84236)

2024-03-08 Thread Piotr Zegar via cfe-commits
@@ -229,7 +229,8 @@ Changes in existing checks - Improved :doc:`readability-identifier-naming ` check in `GetConfigPerFile` - mode by resolving symbolic links to header files. + mode by resolving symbolic links to header files. Fixed handling of Hungarian

[clang-tools-extra] [clang-tidy] Fix Hungarian Prefix in readability-identifier-naming (PR #84236)

2024-03-07 Thread Piotr Zegar via cfe-commits
@@ -229,7 +229,8 @@ Changes in existing checks - Improved :doc:`readability-identifier-naming ` check in `GetConfigPerFile` - mode by resolving symbolic links to header files. + mode by resolving symbolic links to header files. Fixed handling of Hungarian

[clang-tools-extra] [clang-tidy] Add bugprone-suspicious-stringview-data-usage check (PR #83716)

2024-03-07 Thread Piotr Zegar via cfe-commits
https://github.com/PiotrZSL updated https://github.com/llvm/llvm-project/pull/83716 >From d56e3336a8b4b3434c5f2d69b4ec50cafc01cd8f Mon Sep 17 00:00:00 2001 From: Piotr Zegar Date: Tue, 20 Feb 2024 18:15:56 + Subject: [PATCH 1/3] [clang-tidy] Add bugprone-suspicious-stringview-data-usage ch

[clang-tools-extra] [clang-tidy] `isOnlyUsedAsConst`: Handle static method calls. (PR #84005)

2024-03-07 Thread Piotr Zegar via cfe-commits
PiotrZSL wrote: Ok, lets merge it then. https://github.com/llvm/llvm-project/pull/84005 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy] `isOnlyUsedAsConst`: Handle static method calls. (PR #84005)

2024-03-07 Thread Piotr Zegar via cfe-commits
https://github.com/PiotrZSL closed https://github.com/llvm/llvm-project/pull/84005 ___ 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 bugprone-suspicious-stringview-data-usage check (PR #83716)

2024-03-07 Thread Piotr Zegar via cfe-commits
https://github.com/PiotrZSL updated https://github.com/llvm/llvm-project/pull/83716 >From d56e3336a8b4b3434c5f2d69b4ec50cafc01cd8f Mon Sep 17 00:00:00 2001 From: Piotr Zegar Date: Tue, 20 Feb 2024 18:15:56 + Subject: [PATCH 1/2] [clang-tidy] Add bugprone-suspicious-stringview-data-usage ch

[clang] [clang-tools-extra] [clang-tidy][dataflow] Add `bugprone-null-check-after-dereference` check (PR #84166)

2024-03-07 Thread Piotr Zegar via cfe-commits
PiotrZSL wrote: > I think those issues are stale. Last time I tested it it were on Clang-tidy 17. I'm doing migration to Clang-tidy 18 now. I will check this and bugprone-unchecked-optional-access check on my code-base, on which it were unstable previously. If nothing will hang/crash, then I w

[clang] [clang-tools-extra] [clang-tidy][dataflow] Add `bugprone-null-check-after-dereference` check (PR #84166)

2024-03-07 Thread Piotr Zegar via cfe-commits
https://github.com/PiotrZSL edited https://github.com/llvm/llvm-project/pull/84166 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-tools-extra] [clang-tidy][dataflow] Add `bugprone-null-check-after-dereference` check (PR #84166)

2024-03-07 Thread Piotr Zegar via cfe-commits
https://github.com/PiotrZSL edited https://github.com/llvm/llvm-project/pull/84166 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-tools-extra] [clang-tidy][dataflow] Add `bugprone-null-check-after-dereference` check (PR #84166)

2024-03-07 Thread Piotr Zegar via cfe-commits
https://github.com/PiotrZSL edited https://github.com/llvm/llvm-project/pull/84166 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-tools-extra] [clang-tidy][dataflow] Add `bugprone-null-check-after-dereference` check (PR #84166)

2024-03-07 Thread Piotr Zegar via cfe-commits
https://github.com/PiotrZSL commented: I like idea behind this check, and I think that there should be version of this check not only for raw pointers but also for optionals, smart pointers and iterators. My main problem is that dataflow framework is slow and unstable, there are 20 issues ope

[clang-tools-extra] [clang-tidy]avoid bugprone-unused-return-value false positive for function with the same prefix as the default argument (PR #84333)

2024-03-07 Thread Piotr Zegar via cfe-commits
https://github.com/PiotrZSL approved this pull request. LGTM, but I agree that documentation should be changed to put there configuration in format that it is in .cpp file. https://github.com/llvm/llvm-project/pull/84333 ___ cfe-commits mailing list c

[clang-tools-extra] [clang-tidy] Add bugprone-suspicious-stringview-data-usage check (PR #83716)

2024-03-06 Thread Piotr Zegar via cfe-commits
@@ -0,0 +1,100 @@ +//===--- SuspiciousStringviewDataUsageCheck.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] Fix Hungarian Prefix in readability-identifier-naming (PR #84236)

2024-03-06 Thread Piotr Zegar via cfe-commits
https://github.com/PiotrZSL created https://github.com/llvm/llvm-project/pull/84236 Fix handling of Hungarian Prefix when configured to LowerCase. Warnings no longer will be emited for names that already match this style. Fixes: #80268 >From b94c868070548ebc942479f90614225bd27b447a Mon S

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

2024-03-06 Thread Piotr Zegar via cfe-commits
PiotrZSL wrote: @pizzud don't worry much about this one, this can be easily solved by using hasType instead of ofClass. Next branch out is in ~5 months, so there is some time. https://github.com/llvm/llvm-project/pull/67467 ___ cfe-commits mailing lis

[clang-tools-extra] [clang-tidy] Add support for lambdas in cppcoreguidelines-owning-memory (PR #77246)

2024-03-05 Thread Piotr Zegar via cfe-commits
https://github.com/PiotrZSL updated https://github.com/llvm/llvm-project/pull/77246 >From f7534c0d9ce6d2c8ce8a075a36a801549287edb9 Mon Sep 17 00:00:00 2001 From: Piotr Zegar Date: Sun, 7 Jan 2024 18:52:05 + Subject: [PATCH 1/5] [clang-tidy] Add support for lambdas in cppcoreguidelines-owni

[clang-tools-extra] [clang-tidy] Add support for lambdas in cppcoreguidelines-owning-memory (PR #77246)

2024-03-05 Thread Piotr Zegar via cfe-commits
@@ -147,10 +161,51 @@ void OwningMemoryCheck::registerMatchers(MatchFinder *Finder) { // Matching on functions, that return an owner/resource, but don't declare // their return type as owner. Finder->addMatcher( - functionDecl(hasDescendant(returnStmt(hasReturnValue

[clang-tools-extra] [clang-tidy] fix false negative in cppcoreguidelines-missing-std-forward (PR #83987)

2024-03-05 Thread Piotr Zegar via cfe-commits
https://github.com/PiotrZSL approved this pull request. LGTM https://github.com/llvm/llvm-project/pull/83987 ___ 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 `bugprone-use-after-move` also handle calls to `std::forward` (PR #82673)

2024-03-04 Thread Piotr Zegar via cfe-commits
https://github.com/PiotrZSL closed https://github.com/llvm/llvm-project/pull/82673 ___ 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 `bugprone-use-after-move` also handle calls to `std::forward` (PR #82673)

2024-03-04 Thread Piotr Zegar via cfe-commits
https://github.com/PiotrZSL updated https://github.com/llvm/llvm-project/pull/82673 >From 7dcbbae9656700bde30caf28f8105648e8dfc623 Mon Sep 17 00:00:00 2001 From: AMS21 Date: Thu, 22 Feb 2024 19:24:43 +0100 Subject: [PATCH] [clang-tidy] Let `bugprone-use-after-move` also handle calls to `std::f

[clang-tools-extra] [clang-tidy] bugprone-unused-return-value config now supports regexes (PR #82952)

2024-03-04 Thread Piotr Zegar via cfe-commits
=?utf-8?q?Félix-Antoine?= Constantin Message-ID: In-Reply-To: https://github.com/PiotrZSL closed https://github.com/llvm/llvm-project/pull/82952 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cf

[clang-tools-extra] [clang-tidy] CRTP Constructor Accessibility Check (PR #82403)

2024-03-04 Thread Piotr Zegar via cfe-commits
@@ -0,0 +1,182 @@ +//===--- CrtpConstructorAccessibilityCheck.cpp - clang-tidy +//-===// PiotrZSL wrote: renamer... https://github.com/llvm/llvm-project/pull/82403 ___ cfe-commits mailin

[clang-tools-extra] [clang-tidy] CRTP Constructor Accessibility Check (PR #82403)

2024-03-04 Thread Piotr Zegar via cfe-commits
@@ -0,0 +1,182 @@ +//===--- CrtpConstructorAccessibilityCheck.cpp - clang-tidy +//-===// PiotrZSL wrote: This should be in single line https://github.com/llvm/llvm-project/pull/82403 ___

[clang-tools-extra] [clang-tidy] CRTP Constructor Accessibility Check (PR #82403)

2024-03-04 Thread Piotr Zegar via cfe-commits
https://github.com/PiotrZSL approved this pull request. Overall looks fine, at least fine to be merged. I will try to take a deeper look into particular cases, but even if some changes could be needed, probably better would be to merge this, and push fixes in separate PR. So lest merge this, a

[clang-tools-extra] [clang-tidy] CRTP Constructor Accessibility Check (PR #82403)

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

[clang-tools-extra] [clang-tidy] bugprone-unused-return-value config now supports regexes (PR #82952)

2024-03-04 Thread Piotr Zegar via cfe-commits
=?utf-8?q?F=C3=A9lix-Antoine?= Constantin Message-ID: In-Reply-To: PiotrZSL wrote: Rebase, and could be merged. https://github.com/llvm/llvm-project/pull/82952 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mai

[clang-tools-extra] [clang-tidy] Let `bugprone-use-after-move` also handle calls to `std::forward` (PR #82673)

2024-03-03 Thread Piotr Zegar via cfe-commits
https://github.com/PiotrZSL approved this pull request. Overall, LGTM https://github.com/llvm/llvm-project/pull/82673 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy] Improve `google-explicit-constructor` checks handling of `explicit(bool)` (PR #82689)

2024-03-03 Thread Piotr Zegar via cfe-commits
https://github.com/PiotrZSL closed https://github.com/llvm/llvm-project/pull/82689 ___ 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 bugprone-suspicious-stringview-data-usage check (PR #83716)

2024-03-03 Thread Piotr Zegar via cfe-commits
https://github.com/PiotrZSL created https://github.com/llvm/llvm-project/pull/83716 This check identifies suspicious usages of std::string_view::data() that could lead to reading out-of-bounds data due to inadequate or incorrect string null termination. Closes #80854 >From ce8017e7db56a43f2e

[clang-tools-extra] 21be2fb - [clang-tidy][NFC] Fix buffer overflow in modernize-use-designated-initializers

2024-02-29 Thread Piotr Zegar via cfe-commits
Author: Piotr Zegar Date: 2024-02-29T20:53:30Z New Revision: 21be2fbd17f9ff6f3f04e0ababc91c9cdd5aed85 URL: https://github.com/llvm/llvm-project/commit/21be2fbd17f9ff6f3f04e0ababc91c9cdd5aed85 DIFF: https://github.com/llvm/llvm-project/commit/21be2fbd17f9ff6f3f04e0ababc91c9cdd5aed85.diff LOG: [

[clang] [clang-tools-extra] [clang-tidy] Add new check `modernize-use-designated-initializers` (PR #80541)

2024-02-29 Thread Piotr Zegar via cfe-commits
Danny =?utf-8?q?Mösch?= , Danny =?utf-8?q?Mösch?= , Danny =?utf-8?q?Mösch?= , Danny =?utf-8?q?Mösch?= , Danny =?utf-8?q?Mösch?= , Danny =?utf-8?q?Mösch?= , Danny =?utf-8?q?Mösch?= , Danny =?utf-8?q?Mösch?= , Danny =?utf-8?q?Mösch?= , Danny =?utf-8?q?Mösch?= , Danny =?utf-8?q?Mösch?= , Danny =?utf-8

[clang-tools-extra] [clang-tidy] Improve `google-explicit-constructor` checks handling of `explicit(bool)` (PR #82689)

2024-02-27 Thread Piotr Zegar via cfe-commits
@@ -79,8 +79,10 @@ static bool isStdInitializerList(QualType Type) { } void ExplicitConstructorCheck::check(const MatchFinder::MatchResult &Result) { - constexpr char WarningMessage[] = + constexpr char NoExpressionWarningMessage[] = "%0 must be marked explicit to avo

[clang-tools-extra] [clang-tidy] Improve `google-explicit-constructor` checks handling of `explicit(bool)` (PR #82689)

2024-02-27 Thread Piotr Zegar via cfe-commits
https://github.com/PiotrZSL approved this pull request. LGTM https://github.com/llvm/llvm-project/pull/82689 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy] Improve `google-explicit-constructor` checks handling of `explicit(bool)` (PR #82689)

2024-02-27 Thread Piotr Zegar via cfe-commits
https://github.com/PiotrZSL edited https://github.com/llvm/llvm-project/pull/82689 ___ 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 `cppcoreguidelines-missing-std-forward` false positive for deleted functions (PR #83055)

2024-02-27 Thread Piotr Zegar via cfe-commits
https://github.com/PiotrZSL closed https://github.com/llvm/llvm-project/pull/83055 ___ 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 `cppcoreguidelines-missing-std-forward` false positive for deleted functions (PR #83055)

2024-02-27 Thread Piotr Zegar via cfe-commits
https://github.com/PiotrZSL approved this pull request. https://github.com/llvm/llvm-project/pull/83055 ___ 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 `cppcoreguidelines-missing-std-forward` false positive for deleted functions (PR #83055)

2024-02-27 Thread Piotr Zegar via cfe-commits
https://github.com/PiotrZSL commented: LGTM https://github.com/llvm/llvm-project/pull/83055 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy] bugprone-unused-return-value config now supports regexes (PR #82952)

2024-02-26 Thread Piotr Zegar via cfe-commits
https://github.com/PiotrZSL edited https://github.com/llvm/llvm-project/pull/82952 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy] bugprone-unused-return-value config now supports regexes (PR #82952)

2024-02-26 Thread Piotr Zegar via cfe-commits
https://github.com/PiotrZSL approved this pull request. LGTM, but update also check documentation, simply put there default config so user could easily copy it change, and add new functions. And mention that this support regexp. https://github.com/llvm/llvm-project/pull/82952 _

[clang-tools-extra] [run-clang-tidy.py] Add option to ignore source files from compilation database (PR #82416)

2024-02-25 Thread Piotr Zegar via cfe-commits
https://github.com/PiotrZSL closed https://github.com/llvm/llvm-project/pull/82416 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy] Unsafe CRTP check (PR #82403)

2024-02-25 Thread Piotr Zegar via cfe-commits
@@ -0,0 +1,167 @@ +//===--- UnsafeCrtpCheck.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] Unsafe CRTP check (PR #82403)

2024-02-25 Thread Piotr Zegar via cfe-commits
@@ -0,0 +1,232 @@ +// RUN: %check_clang_tidy %s bugprone-unsafe-crtp %t + +namespace class_implicit_ctor { +template +class CRTP {}; +// CHECK-MESSAGES: :[[@LINE-1]]:7: warning: the implicit default constructor of the CRTP is publicly accessible [bugprone-unsafe-crtp] +// CHECK-

[clang-tools-extra] [clang-tidy] Unsafe CRTP check (PR #82403)

2024-02-25 Thread Piotr Zegar via cfe-commits
@@ -0,0 +1,177 @@ +//===--- CrtpConstructorAccessibilityCheck.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-Li

[clang-tools-extra] [clang-tidy] Unsafe CRTP check (PR #82403)

2024-02-25 Thread Piotr Zegar via cfe-commits
https://github.com/PiotrZSL edited https://github.com/llvm/llvm-project/pull/82403 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy] Unsafe CRTP check (PR #82403)

2024-02-23 Thread Piotr Zegar via cfe-commits
@@ -0,0 +1,82 @@ +.. title:: clang-tidy - bugprone-crtp-constructor-accessibility + +bugprone-crtp-constructor-accessibility +=== + +Finds Curiously Recurring Template Pattern used in an error-prone way. PiotrZSL wrote: "Detect

[clang-tools-extra] [clang-tidy] Unsafe CRTP check (PR #82403)

2024-02-23 Thread Piotr Zegar via cfe-commits
@@ -0,0 +1,177 @@ +//===--- CrtpConstructorAccessibilityCheck.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-Li

[clang-tools-extra] [clang-tidy] Unsafe CRTP check (PR #82403)

2024-02-23 Thread Piotr Zegar via cfe-commits
@@ -100,6 +100,11 @@ Improvements to clang-tidy New checks ^^ +- New :doc:`bugprone-crtp-constructor-accessibility + ` check. + + Detects error-prone CRTP usage, when the CRTP can be constructed outside itself and the derived class. PiotrZSL wrote:

[clang-tools-extra] [clang-tidy] Unsafe CRTP check (PR #82403)

2024-02-23 Thread Piotr Zegar via cfe-commits
@@ -0,0 +1,82 @@ +.. title:: clang-tidy - bugprone-crtp-constructor-accessibility + +bugprone-crtp-constructor-accessibility +=== + +Finds Curiously Recurring Template Pattern used in an error-prone way. + +The CRTP is an idiom, in which a class

[clang-tools-extra] [clang-tidy] Unsafe CRTP check (PR #82403)

2024-02-23 Thread Piotr Zegar via cfe-commits
https://github.com/PiotrZSL commented: Overall doesn't look to bad, probably could be merged in +- this state, it need to be run on some exist code-base like llvm. I will look again in next 1-2 days. Now just had quick glance. https://github.com/llvm/llvm-project/pull/82403 ___

[clang-tools-extra] [clang-tidy] Unsafe CRTP check (PR #82403)

2024-02-23 Thread Piotr Zegar via cfe-commits
@@ -0,0 +1,177 @@ +//===--- CrtpConstructorAccessibilityCheck.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-Li

[clang-tools-extra] [clang-tidy] Unsafe CRTP check (PR #82403)

2024-02-23 Thread Piotr Zegar via cfe-commits
@@ -0,0 +1,177 @@ +//===--- CrtpConstructorAccessibilityCheck.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-Li

[clang-tools-extra] [clang-tidy] Unsafe CRTP check (PR #82403)

2024-02-23 Thread Piotr Zegar via cfe-commits
@@ -0,0 +1,177 @@ +//===--- CrtpConstructorAccessibilityCheck.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-Li

[clang-tools-extra] [clang-tidy] Unsafe CRTP check (PR #82403)

2024-02-23 Thread Piotr Zegar via cfe-commits
https://github.com/PiotrZSL edited https://github.com/llvm/llvm-project/pull/82403 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy] Unsafe CRTP check (PR #82403)

2024-02-23 Thread Piotr Zegar via cfe-commits
https://github.com/PiotrZSL edited https://github.com/llvm/llvm-project/pull/82403 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy] Unsafe CRTP check (PR #82403)

2024-02-23 Thread Piotr Zegar via cfe-commits
@@ -0,0 +1,232 @@ +// RUN: %check_clang_tidy %s bugprone-unsafe-crtp %t + +namespace class_implicit_ctor { +template +class CRTP {}; +// CHECK-MESSAGES: :[[@LINE-1]]:7: warning: the implicit default constructor of the CRTP is publicly accessible [bugprone-unsafe-crtp] +// CHECK-

[clang-tools-extra] [clang-tidy] Add support for determining constness of more expressions. (PR #82617)

2024-02-23 Thread Piotr Zegar via cfe-commits
https://github.com/PiotrZSL approved this pull request. I didn't check entire change, in some places `{}` in if's aren't needed. Overall looking fine, but this check need to be run on bigger code-base to verify if there are no false positives or crashes. https://github.com/llvm/llvm-project/pul

[clang] [clang-tools-extra] [clang-tidy] Add new check `modernize-use-designated-initializers` (PR #80541)

2024-02-23 Thread Piotr Zegar via cfe-commits
Danny =?utf-8?q?M=C3=B6sch?= , Danny =?utf-8?q?M=C3=B6sch?= , Danny =?utf-8?q?M=C3=B6sch?= , Danny =?utf-8?q?M=C3=B6sch?= , Danny =?utf-8?q?M=C3=B6sch?= , Danny =?utf-8?q?M=C3=B6sch?= , Danny =?utf-8?q?M=C3=B6sch?= , Danny =?utf-8?q?M=C3=B6sch?= , Danny =?utf-8?q?M=C3=B6sch?= , Danny =?utf-8?q?M=C3

[clang-tools-extra] [clang-tidy] Fix handling --driver-mode= (PR #66553)

2024-02-23 Thread Piotr Zegar via cfe-commits
PiotrZSL wrote: @rsniezek No thats diffrent issue, you need to use xmmintrin.h from clang, usually it should work by default, but maybe clang-tidy and clang are installed in different folders. In such case you may need to add explicitly -isystem to location of xmmintrin.h https://github.com/l

[clang-tools-extra] [clang-tidy] Fix handling --driver-mode= (PR #66553)

2024-02-22 Thread Piotr Zegar via cfe-commits
PiotrZSL wrote: @rsniezek If someone will review & approve it, then it will land. https://github.com/llvm/llvm-project/pull/66553 ___ 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] Add option to ignore source files from compilation database (PR #82416)

2024-02-21 Thread Piotr Zegar via cfe-commits
https://github.com/PiotrZSL approved this pull request. https://github.com/llvm/llvm-project/pull/82416 ___ 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] Add option to ignore source files from compilation database (PR #82416)

2024-02-21 Thread Piotr Zegar via cfe-commits
@@ -462,6 +469,19 @@ def main(): [make_absolute(entry["file"], entry["directory"]) for entry in database] ) +# Filter source files from compilation database. +if args.source_filter: +try: +source_filter_re = re.compile(args.source_filte

[clang-tools-extra] [run-clang-tidy.py] Add option to ignore source files from compilation database (PR #82416)

2024-02-21 Thread Piotr Zegar via cfe-commits
https://github.com/PiotrZSL edited https://github.com/llvm/llvm-project/pull/82416 ___ 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] Add option to ignore source files from compilation database (PR #82416)

2024-02-21 Thread Piotr Zegar via cfe-commits
@@ -462,6 +469,19 @@ def main(): [make_absolute(entry["file"], entry["directory"]) for entry in database] ) +# Filter source files from compilation database. +if args.source_filter: +try: +source_filter_re = re.compile(args.source_filte

[clang-tools-extra] [run-clang-tidy.py] Add option to ignore source files from compilation database (PR #82416)

2024-02-21 Thread Piotr Zegar via cfe-commits
@@ -462,6 +469,18 @@ def main(): [make_absolute(entry["file"], entry["directory"]) for entry in database] ) +# Filter source files from compilation database. +if args.source_filter: +try: +source_filter_re = re.compile(args.source_filte

[clang-tools-extra] [run-clang-tidy.py] Add option to ignore source files from compilation database (PR #82416)

2024-02-21 Thread Piotr Zegar via cfe-commits
@@ -300,6 +300,13 @@ def main(): "the main file of each translation unit are always " "displayed.", ) +parser.add_argument( +"-source-filter", PiotrZSL wrote: Add release notes entry about this change https://github.com/llvm/ll

[clang] [clang-tools-extra] [clang-tidy] Add new check `modernize-use-designated-initializers` (PR #80541)

2024-02-20 Thread Piotr Zegar via cfe-commits
Danny =?utf-8?q?Mösch?= , Danny =?utf-8?q?Mösch?= , Danny =?utf-8?q?Mösch?= , Danny =?utf-8?q?Mösch?= , Danny =?utf-8?q?Mösch?= , Danny =?utf-8?q?Mösch?= , Danny =?utf-8?q?Mösch?= , Danny =?utf-8?q?Mösch?= , Danny =?utf-8?q?Mösch?= , Danny =?utf-8?q?Mösch?= , Danny =?utf-8?q?Mösch?= , Danny =?utf-8

[clang] [clang-tools-extra] [clang-tidy] Add new check `modernize-use-designated-initializers` (PR #80541)

2024-02-20 Thread Piotr Zegar via cfe-commits
Danny =?utf-8?q?Mösch?= , Danny =?utf-8?q?Mösch?= , Danny =?utf-8?q?Mösch?= , Danny =?utf-8?q?Mösch?= , Danny =?utf-8?q?Mösch?= , Danny =?utf-8?q?Mösch?= , Danny =?utf-8?q?Mösch?= , Danny =?utf-8?q?Mösch?= , Danny =?utf-8?q?Mösch?= , Danny =?utf-8?q?Mösch?= , Danny =?utf-8?q?Mösch?= , Danny =?utf-8

[clang] [clang-tools-extra] [clang-tidy] Add new check `modernize-use-designated-initializers` (PR #80541)

2024-02-20 Thread Piotr Zegar via cfe-commits
Danny =?utf-8?q?Mösch?= , Danny =?utf-8?q?Mösch?= , Danny =?utf-8?q?Mösch?= , Danny =?utf-8?q?Mösch?= , Danny =?utf-8?q?Mösch?= , Danny =?utf-8?q?Mösch?= , Danny =?utf-8?q?Mösch?= , Danny =?utf-8?q?Mösch?= , Danny =?utf-8?q?Mösch?= , Danny =?utf-8?q?Mösch?= , Danny =?utf-8?q?Mösch?= , Danny =?utf-8

[clang] [clang-tools-extra] [clang-tidy] Add new check `modernize-use-designated-initializers` (PR #80541)

2024-02-20 Thread Piotr Zegar via cfe-commits
Danny =?utf-8?q?Mösch?= , Danny =?utf-8?q?Mösch?= , Danny =?utf-8?q?Mösch?= , Danny =?utf-8?q?Mösch?= , Danny =?utf-8?q?Mösch?= , Danny =?utf-8?q?Mösch?= , Danny =?utf-8?q?Mösch?= , Danny =?utf-8?q?Mösch?= , Danny =?utf-8?q?Mösch?= , Danny =?utf-8?q?Mösch?= , Danny =?utf-8?q?Mösch?= , Danny =?utf-8

[clang] [clang-tools-extra] [clang-tidy] Add new check `modernize-use-designated-initializers` (PR #80541)

2024-02-20 Thread Piotr Zegar via cfe-commits
Danny =?utf-8?q?Mösch?= , Danny =?utf-8?q?Mösch?= , Danny =?utf-8?q?Mösch?= , Danny =?utf-8?q?Mösch?= , Danny =?utf-8?q?Mösch?= , Danny =?utf-8?q?Mösch?= , Danny =?utf-8?q?Mösch?= , Danny =?utf-8?q?Mösch?= , Danny =?utf-8?q?Mösch?= , Danny =?utf-8?q?Mösch?= , Danny =?utf-8?q?Mösch?= , Danny =?utf-8

[clang-tools-extra] [clang-tidy] Unsafe CRTP check (PR #82403)

2024-02-20 Thread Piotr Zegar via cfe-commits
@@ -0,0 +1,167 @@ +//===--- UnsafeCrtpCheck.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] Unsafe CRTP check (PR #82403)

2024-02-20 Thread Piotr Zegar via cfe-commits
@@ -0,0 +1,232 @@ +// RUN: %check_clang_tidy %s bugprone-unsafe-crtp %t + +namespace class_implicit_ctor { +template +class CRTP {}; +// CHECK-MESSAGES: :[[@LINE-1]]:7: warning: the implicit default constructor of the CRTP is publicly accessible [bugprone-unsafe-crtp] +// CHECK-

[clang-tools-extra] [clang-tidy] Unsafe CRTP check (PR #82403)

2024-02-20 Thread Piotr Zegar via cfe-commits
@@ -0,0 +1,62 @@ +.. title:: clang-tidy - bugprone-unsafe-crtp + +bugprone-unsafe-crtp + + +Finds CRTP used in an error-prone way. + +If the constructor of a class intended to be used in a CRTP is public, then +it allows users to construct that class on its own

[clang-tools-extra] [clang-tidy] Unsafe CRTP check (PR #82403)

2024-02-20 Thread Piotr Zegar via cfe-commits
@@ -0,0 +1,232 @@ +// RUN: %check_clang_tidy %s bugprone-unsafe-crtp %t + +namespace class_implicit_ctor { +template +class CRTP {}; +// CHECK-MESSAGES: :[[@LINE-1]]:7: warning: the implicit default constructor of the CRTP is publicly accessible [bugprone-unsafe-crtp] +// CHECK-

[clang-tools-extra] [clang-tidy] Unsafe CRTP check (PR #82403)

2024-02-20 Thread Piotr Zegar via cfe-commits
@@ -106,6 +106,11 @@ New checks Replaces certain conditional statements with equivalent calls to ``std::min`` or ``std::max``. +- New :doc:`bugprone-unsafe-crtp PiotrZSL wrote: sounds fine. https://github.com/llvm/llvm-project/pull/82403

[clang-tools-extra] [clang-tidy] Unsafe CRTP check (PR #82403)

2024-02-20 Thread Piotr Zegar via cfe-commits
@@ -0,0 +1,62 @@ +.. title:: clang-tidy - bugprone-unsafe-crtp + +bugprone-unsafe-crtp + + +Finds CRTP used in an error-prone way. + +If the constructor of a class intended to be used in a CRTP is public, then +it allows users to construct that class on its own

[clang-tools-extra] [clang-tidy] Unsafe CRTP check (PR #82403)

2024-02-20 Thread Piotr Zegar via cfe-commits
@@ -0,0 +1,167 @@ +//===--- UnsafeCrtpCheck.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] Unsafe CRTP check (PR #82403)

2024-02-20 Thread Piotr Zegar via cfe-commits
@@ -0,0 +1,232 @@ +// RUN: %check_clang_tidy %s bugprone-unsafe-crtp %t + +namespace class_implicit_ctor { +template +class CRTP {}; +// CHECK-MESSAGES: :[[@LINE-1]]:7: warning: the implicit default constructor of the CRTP is publicly accessible [bugprone-unsafe-crtp] +// CHECK-

[clang-tools-extra] [clang-tidy] Unsafe CRTP check (PR #82403)

2024-02-20 Thread Piotr Zegar via cfe-commits
@@ -0,0 +1,232 @@ +// RUN: %check_clang_tidy %s bugprone-unsafe-crtp %t + +namespace class_implicit_ctor { +template +class CRTP {}; +// CHECK-MESSAGES: :[[@LINE-1]]:7: warning: the implicit default constructor of the CRTP is publicly accessible [bugprone-unsafe-crtp] +// CHECK-

[clang-tools-extra] [clang-tidy] Unsafe CRTP check (PR #82403)

2024-02-20 Thread Piotr Zegar via cfe-commits
@@ -0,0 +1,62 @@ +.. title:: clang-tidy - bugprone-unsafe-crtp + +bugprone-unsafe-crtp + + +Finds CRTP used in an error-prone way. + +If the constructor of a class intended to be used in a CRTP is public, then +it allows users to construct that class on its own

[clang-tools-extra] [clang-tidy] Unsafe CRTP check (PR #82403)

2024-02-20 Thread Piotr Zegar via cfe-commits
https://github.com/PiotrZSL edited https://github.com/llvm/llvm-project/pull/82403 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy] Unsafe CRTP check (PR #82403)

2024-02-20 Thread Piotr Zegar via cfe-commits
@@ -0,0 +1,62 @@ +.. title:: clang-tidy - bugprone-unsafe-crtp + +bugprone-unsafe-crtp + + +Finds CRTP used in an error-prone way. + +If the constructor of a class intended to be used in a CRTP is public, then +it allows users to construct that class on its own

[clang-tools-extra] [clang-tidy] Unsafe CRTP check (PR #82403)

2024-02-20 Thread Piotr Zegar via cfe-commits
@@ -0,0 +1,232 @@ +// RUN: %check_clang_tidy %s bugprone-unsafe-crtp %t + +namespace class_implicit_ctor { +template +class CRTP {}; +// CHECK-MESSAGES: :[[@LINE-1]]:7: warning: the implicit default constructor of the CRTP is publicly accessible [bugprone-unsafe-crtp] +// CHECK-

[clang-tools-extra] [clang-tidy] Unsafe CRTP check (PR #82403)

2024-02-20 Thread Piotr Zegar via cfe-commits
@@ -106,6 +106,11 @@ New checks Replaces certain conditional statements with equivalent calls to ``std::min`` or ``std::max``. +- New :doc:`bugprone-unsafe-crtp PiotrZSL wrote: would be nice if name of check would be more narrowed to crtp+constructor, ma

[clang-tools-extra] [clang-tidy] Unsafe CRTP check (PR #82403)

2024-02-20 Thread Piotr Zegar via cfe-commits
@@ -0,0 +1,232 @@ +// RUN: %check_clang_tidy %s bugprone-unsafe-crtp %t + +namespace class_implicit_ctor { +template +class CRTP {}; +// CHECK-MESSAGES: :[[@LINE-1]]:7: warning: the implicit default constructor of the CRTP is publicly accessible [bugprone-unsafe-crtp] +// CHECK-

[clang-tools-extra] [clang-tidy] Unsafe CRTP check (PR #82403)

2024-02-20 Thread Piotr Zegar via cfe-commits
@@ -0,0 +1,167 @@ +//===--- UnsafeCrtpCheck.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] Unsafe CRTP check (PR #82403)

2024-02-20 Thread Piotr Zegar via cfe-commits
@@ -0,0 +1,232 @@ +// RUN: %check_clang_tidy %s bugprone-unsafe-crtp %t + +namespace class_implicit_ctor { +template +class CRTP {}; +// CHECK-MESSAGES: :[[@LINE-1]]:7: warning: the implicit default constructor of the CRTP is publicly accessible [bugprone-unsafe-crtp] +// CHECK-

[clang-tools-extra] [clang-tidy] Unsafe CRTP check (PR #82403)

2024-02-20 Thread Piotr Zegar via cfe-commits
@@ -0,0 +1,232 @@ +// RUN: %check_clang_tidy %s bugprone-unsafe-crtp %t + +namespace class_implicit_ctor { +template +class CRTP {}; +// CHECK-MESSAGES: :[[@LINE-1]]:7: warning: the implicit default constructor of the CRTP is publicly accessible [bugprone-unsafe-crtp] +// CHECK-

[clang-tools-extra] [clang-tidy] Unsafe CRTP check (PR #82403)

2024-02-20 Thread Piotr Zegar via cfe-commits
@@ -0,0 +1,167 @@ +//===--- UnsafeCrtpCheck.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] Unsafe CRTP check (PR #82403)

2024-02-20 Thread Piotr Zegar via cfe-commits
@@ -0,0 +1,232 @@ +// RUN: %check_clang_tidy %s bugprone-unsafe-crtp %t PiotrZSL wrote: add `-- -- -fno-delayed-template-parsing` https://github.com/llvm/llvm-project/pull/82403 ___ cfe-commits mailing list cfe-commits

[clang-tools-extra] [clang-tidy] Unsafe CRTP check (PR #82403)

2024-02-20 Thread Piotr Zegar via cfe-commits
https://github.com/PiotrZSL requested changes to this pull request. I'm not fan of using "friends", currently they consider more a code-smell, and i'm not fan of exposing other private implementation to derived class, this could cause some issues, like give access to class that isn't a derived

[clang] [clang-tools-extra] [clang-tidy] Add new check `modernize-use-designated-initializers` (PR #80541)

2024-02-20 Thread Piotr Zegar via cfe-commits
Danny =?utf-8?q?Mösch?= , Danny =?utf-8?q?Mösch?= , Danny =?utf-8?q?Mösch?= , Danny =?utf-8?q?Mösch?= , Danny =?utf-8?q?Mösch?= , Danny =?utf-8?q?Mösch?= , Danny =?utf-8?q?Mösch?= , Danny =?utf-8?q?Mösch?= , Danny =?utf-8?q?Mösch?= , Danny =?utf-8?q?Mösch?= , Danny =?utf-8?q?Mösch?= , Danny =?utf-8

[clang] [clang-tools-extra] [clang-tidy] Add new check `modernize-use-designated-initializers` (PR #80541)

2024-02-20 Thread Piotr Zegar via cfe-commits
Danny =?utf-8?q?Mösch?= , Danny =?utf-8?q?Mösch?= , Danny =?utf-8?q?Mösch?= , Danny =?utf-8?q?Mösch?= , Danny =?utf-8?q?Mösch?= , Danny =?utf-8?q?Mösch?= , Danny =?utf-8?q?Mösch?= , Danny =?utf-8?q?Mösch?= , Danny =?utf-8?q?Mösch?= , Danny =?utf-8?q?Mösch?= , Danny =?utf-8?q?Mösch?= , Danny =?utf-8

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