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

2024-08-18 Thread Carlos Galvez 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 + ` check carlosgalvezp wrote: Improved... by adding the option `UseUpperCaseLiteralSuffix`

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

2024-08-18 Thread Carlos Galvez 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 + ` check + Added option `UseUpperCaseLiteralSuffix` to to select the carlosgalvezp wrote:

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

2024-08-18 Thread Carlos Galvez via cfe-commits
@@ -133,3 +133,17 @@ Options When `true`, the check will allow conditional pointer conversions. Default is `false`. + +.. option:: UseUpperCaseLiteralSuffix + + When `true`, the replacements will use an uppercase literal suffix in the + provided fixes. Default a low

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

2024-08-18 Thread Carlos Galvez via cfe-commits
@@ -133,3 +133,17 @@ Options When `true`, the check will allow conditional pointer conversions. Default is `false`. + +.. option:: UseUpperCaseLiteralSuffix + + When `true`, the replacements will use an uppercase literal suffix in the + provided fixes. Default a low

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

2024-08-18 Thread Carlos Galvez via cfe-commits
https://github.com/carlosgalvezp edited https://github.com/llvm/llvm-project/pull/102831 ___ 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 #102831)

2024-08-18 Thread Carlos Galvez via cfe-commits
https://github.com/carlosgalvezp commented: LGTM, very minor nits! https://github.com/llvm/llvm-project/pull/102831 ___ 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-20 Thread Carlos Galvez via cfe-commits
https://github.com/carlosgalvezp approved this pull request. LGTM, maybe give a couple more days for other reviewers in case they have more comments. https://github.com/llvm/llvm-project/pull/104882 ___ cfe-commits mailing list cfe-commits@lists.llvm.

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

2024-08-25 Thread Carlos Galvez via cfe-commits
https://github.com/carlosgalvezp approved this pull request. LGTM 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] Enforce SL.con.3: Add check to replace operator[] with at() [Cont.] (PR #95220)

2024-06-27 Thread Carlos Galvez 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]suggest use `std::span` as replacement of c array in C++20 for modernize-avoid-c-arrays (PR #108555)

2024-09-13 Thread Carlos Galvez via cfe-commits
carlosgalvezp wrote: I'm not sure I understand this change. `std::span` is not a replacement for a C array, since it does not own memory. I don't understand also the change from suggesting to use `std::vector` instead of `std::array` https://github.com/llvm/llvm-project/pull/108555 ___

[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 Carlos Galvez 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] Create bugprone-bit-cast-pointers check (PR #108083)

2024-09-15 Thread Carlos Galvez via cfe-commits
https://github.com/carlosgalvezp updated https://github.com/llvm/llvm-project/pull/108083 >From cb4ea5f12c72dd547d6ae3e742e99d717289344e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20G=C3=A1lvez?= Date: Tue, 10 Sep 2024 13:46:51 + Subject: [PATCH] [clang-tidy] Create bugprone-bit-cast-p

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

2024-09-15 Thread Carlos Galvez 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 Carlos Galvez 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 Carlos Galvez 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 Carlos Galvez 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

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

2024-09-15 Thread Carlos Galvez via cfe-commits
https://github.com/carlosgalvezp edited https://github.com/llvm/llvm-project/pull/108083 ___ 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-16 Thread Carlos Galvez via cfe-commits
carlosgalvezp wrote: Thanks for the clarifications, will address asap! It now comes to mind that we probably also want to check `memcpy(ptr, ptr)`, which is equivalent to `bit_cast`. In that case I wonder if the check name still holds or it should be named something else? https://github.com/

[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-16 Thread Carlos Galvez via cfe-commits
@@ -10,29 +10,32 @@ modernize-avoid-c-arrays Finds C-style array types and recommend to use ``std::array<>`` / ``std::vector<>``. All types of C arrays are diagnosed. +For parameters of incomplete C-style array type, it would be better to +use ``std::span`` / ``gsl::span`` as

[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-16 Thread Carlos Galvez 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-16 Thread Carlos Galvez 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] Fix a typo (PR #112283)

2024-10-14 Thread Carlos Galvez via cfe-commits
https://github.com/carlosgalvezp closed https://github.com/llvm/llvm-project/pull/112283 ___ 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 a typo (PR #112283)

2024-10-14 Thread Carlos Galvez via cfe-commits
carlosgalvezp wrote: Thank you for the contribution! I've added [NFC] (non functional change) to the commit message title. https://github.com/llvm/llvm-project/pull/112283 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org

[clang] [compiler-rt] [libcxx] [llvm] [clang] Warn about memset/memcpy to NonTriviallyCopyable types (PR #111434)

2024-10-09 Thread Carlos Galvez via cfe-commits
carlosgalvezp wrote: Please note: GCC is more strict; for std::memset, it requires the type to be trivial, not just trivially copyable: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107361 I haven't looked at the patch in detail but for consistency with GCC it should also support suppressing t

[clang] [compiler-rt] [libcxx] [llvm] [clang] Warn about memset/memcpy to NonTriviallyCopyable types (PR #111434)

2024-10-09 Thread Carlos Galvez via cfe-commits
carlosgalvezp wrote: > ACK. Not a standard requirement though, is it? Correct, it's only UB on non-trivially-copyable. My point was more about if we want to be consistent with GCC or not. I don't have any strong opinion on that. https://github.com/llvm/llvm-project/pull/111434

[clang] [compiler-rt] [libcxx] [llvm] [clang] Warn about memset/memcpy to NonTriviallyCopyable types (PR #111434)

2024-10-09 Thread Carlos Galvez via cfe-commits
@@ -102,7 +102,7 @@ struct __aliasing_iterator_wrapper { _LIBCPP_HIDE_FROM_ABI _Alias operator*() const _NOEXCEPT { _Alias __val; - __builtin_memcpy(&__val, std::__to_address(__base_), sizeof(value_type)); + __builtin_memcpy(&__val, reinterpret_cast(std::_

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

2024-10-06 Thread Carlos Galvez via cfe-commits
Carlos =?utf-8?q?Gálvez?= Message-ID: In-Reply-To: https://github.com/carlosgalvezp closed https://github.com/llvm/llvm-project/pull/108083 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-co

[clang] [clang-format] Handle template closer followed by braces (PR #110971)

2024-10-03 Thread Carlos Galvez via cfe-commits
@@ -3538,6 +3538,11 @@ TEST_F(TokenAnnotatorTest, TemplateInstantiation) { ASSERT_EQ(Tokens.size(), 11u) << Tokens; EXPECT_TOKEN(Tokens[2], tok::less, TT_TemplateOpener); EXPECT_TOKEN(Tokens[6], tok::greater, TT_TemplateCloser); + + Tokens = annotate("return std::conditi

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

2024-10-03 Thread Carlos Galvez via cfe-commits
Carlos =?utf-8?q?Gálvez?= Message-ID: In-Reply-To: https://github.com/carlosgalvezp updated https://github.com/llvm/llvm-project/pull/108083 >From 1b1d54e0ce0d0bc4250ff045840b0a0a7bac59a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20G=C3=A1lvez?= Date: Tue, 10 Sep 2024 13:46:51 + Su

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

2024-10-03 Thread Carlos Galvez via cfe-commits
Carlos =?utf-8?q?Gálvez?= Message-ID: In-Reply-To: https://github.com/carlosgalvezp updated https://github.com/llvm/llvm-project/pull/108083 >From 1b1d54e0ce0d0bc4250ff045840b0a0a7bac59a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20G=C3=A1lvez?= Date: Tue, 10 Sep 2024 13:46:51 + Su

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

2024-09-29 Thread Carlos Galvez via cfe-commits
carlosgalvezp wrote: What about `bugprone-bitwise-pointer-copy`? https://github.com/llvm/llvm-project/pull/108083 ___ 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 incorrect command-line option in docs (PR #111405)

2024-10-07 Thread Carlos Galvez via cfe-commits
https://github.com/carlosgalvezp approved this pull request. Thanks for the fix! https://github.com/llvm/llvm-project/pull/111405 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [compiler-rt] [libcxx] [llvm] [clang] Warn about memset/memcpy to NonTriviallyCopyable types (PR #111434)

2024-10-18 Thread Carlos Galvez via cfe-commits
@@ -102,7 +102,7 @@ struct __aliasing_iterator_wrapper { _LIBCPP_HIDE_FROM_ABI _Alias operator*() const _NOEXCEPT { _Alias __val; - __builtin_memcpy(&__val, std::__to_address(__base_), sizeof(value_type)); + __builtin_memcpy(&__val, static_cast(std::__to_ad

[clang] [compiler-rt] [libcxx] [llvm] [clang] Warn about memset/memcpy to NonTriviallyCopyable types (PR #111434)

2024-10-19 Thread Carlos Galvez via cfe-commits
https://github.com/carlosgalvezp edited https://github.com/llvm/llvm-project/pull/111434 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [compiler-rt] [libcxx] [llvm] [clang] Warn about memset/memcpy to NonTriviallyCopyable types (PR #111434)

2024-10-19 Thread Carlos Galvez via cfe-commits
@@ -102,7 +102,7 @@ struct __aliasing_iterator_wrapper { _LIBCPP_HIDE_FROM_ABI _Alias operator*() const _NOEXCEPT { _Alias __val; - __builtin_memcpy(&__val, std::__to_address(__base_), sizeof(value_type)); + __builtin_memcpy(&__val, static_cast(std::__to_ad

[clang] [compiler-rt] [libcxx] [llvm] [clang] Warn about memset/memcpy to NonTriviallyCopyable types (PR #111434)

2024-10-18 Thread Carlos Galvez via cfe-commits
@@ -102,7 +102,7 @@ struct __aliasing_iterator_wrapper { _LIBCPP_HIDE_FROM_ABI _Alias operator*() const _NOEXCEPT { _Alias __val; - __builtin_memcpy(&__val, std::__to_address(__base_), sizeof(value_type)); + __builtin_memcpy(&__val, static_cast(std::__to_ad

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

2024-10-02 Thread Carlos Galvez via cfe-commits
https://github.com/carlosgalvezp updated https://github.com/llvm/llvm-project/pull/108083 >From 1b1d54e0ce0d0bc4250ff045840b0a0a7bac59a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20G=C3=A1lvez?= Date: Tue, 10 Sep 2024 13:46:51 + Subject: [PATCH] [clang-tidy] Create bugprone-bitwise-po

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

2024-10-02 Thread Carlos Galvez via cfe-commits
https://github.com/carlosgalvezp updated https://github.com/llvm/llvm-project/pull/108083 >From 7c50e702c087047adfe43137d52e56cb98ff9918 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20G=C3=A1lvez?= Date: Tue, 10 Sep 2024 13:46:51 + Subject: [PATCH] [clang-tidy] Create bugprone-bitwise-po

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

2024-10-02 Thread Carlos Galvez via cfe-commits
https://github.com/carlosgalvezp edited https://github.com/llvm/llvm-project/pull/108083 ___ 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-bitwise-pointer-cast check (PR #108083)

2024-10-02 Thread Carlos Galvez via cfe-commits
https://github.com/carlosgalvezp edited https://github.com/llvm/llvm-project/pull/108083 ___ 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-bitwise-pointer-cast check (PR #108083)

2024-10-02 Thread Carlos Galvez via cfe-commits
carlosgalvezp wrote: > Both sound good to me. Great, updated! Let me know there's anything else to fix or if we can merge. https://github.com/llvm/llvm-project/pull/108083 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.o

[clang] [compiler-rt] [libcxx] [llvm] [clang] Warn about memset/memcpy to NonTriviallyCopyable types (PR #111434)

2024-10-22 Thread Carlos Galvez via cfe-commits
@@ -102,7 +102,7 @@ struct __aliasing_iterator_wrapper { _LIBCPP_HIDE_FROM_ABI _Alias operator*() const _NOEXCEPT { _Alias __val; - __builtin_memcpy(&__val, std::__to_address(__base_), sizeof(value_type)); + __builtin_memcpy(&__val, static_cast(std::__to_ad

[clang-tools-extra] [clang-tidy] [docs] Replace _not_ in reserved-identifier.rst with *not* (PR #112162)

2024-10-13 Thread Carlos Galvez via cfe-commits
https://github.com/carlosgalvezp approved this pull request. https://github.com/llvm/llvm-project/pull/112162 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy] [docs] Replace _not_ in reserved-identifier.rst with *not* (PR #112162)

2024-10-13 Thread Carlos Galvez via cfe-commits
carlosgalvezp wrote: @njriasan Thanks for the contribution! I see the commit message would include this: ``` Co-authored-by: Nicholas Riasanovsky ``` Do you want to keep that? https://github.com/llvm/llvm-project/pull/112162 ___ cfe-commits mailin

[clang-tools-extra] [clang-tidy] [docs] Replace _not_ in reserved-identifier.rst with *not* (PR #112162)

2024-10-14 Thread Carlos Galvez via cfe-commits
carlosgalvezp wrote: > @carlosgalvezp That message is because I got a new computer and it wasn't > properly setup yet. I would like to remove it if possible. What is the > process for updating a commit message in this repo? Should I just force push > a modified message to this branch? I'm not

[clang] [compiler-rt] [libcxx] [llvm] [clang] Warn about memset/memcpy to NonTriviallyCopyable types (PR #111434)

2024-10-22 Thread Carlos Galvez via cfe-commits
@@ -102,7 +102,7 @@ struct __aliasing_iterator_wrapper { _LIBCPP_HIDE_FROM_ABI _Alias operator*() const _NOEXCEPT { _Alias __val; - __builtin_memcpy(&__val, std::__to_address(__base_), sizeof(value_type)); + __builtin_memcpy(&__val, static_cast(std::__to_ad

[clang] [compiler-rt] [libcxx] [llvm] [clang] Warn about memset/memcpy to NonTriviallyCopyable types (PR #111434)

2024-10-22 Thread Carlos Galvez via cfe-commits
@@ -102,7 +102,7 @@ struct __aliasing_iterator_wrapper { _LIBCPP_HIDE_FROM_ABI _Alias operator*() const _NOEXCEPT { _Alias __val; - __builtin_memcpy(&__val, std::__to_address(__base_), sizeof(value_type)); + __builtin_memcpy(&__val, static_cast(std::__to_ad

[clang] [libcxx] [clang] Warn about memset/memcpy to NonTriviallyCopyable types (PR #111434)

2024-10-24 Thread Carlos Galvez via cfe-commits
@@ -670,6 +670,8 @@ namespace MemcpyEtc { constexpr bool test_address_of_incomplete_struct_type() { // expected-error {{never produces a constant}} struct Incomplete; extern Incomplete x, y; +// expected-warning@+2 {{destination for call to '__builtin_memcpy' is

[clang] [clang-tools-extra] [analyzer] Remove alpha.core.IdenticalExpr Checker (PR #114715)

2024-11-04 Thread Carlos Galvez via cfe-commits
carlosgalvezp wrote: > (@ tidy developers: what would you prefer?) I agree! https://github.com/llvm/llvm-project/pull/114715 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy] Filter out googletest TUs in bugprone-unchecked-optional-access (PR #115051)

2024-11-05 Thread Carlos Galvez via cfe-commits
https://github.com/carlosgalvezp requested changes to this pull request. Relying on Google-test internal implementation details that are outside of our control and may change at any point in time does not feel good. The patch should instead fix the root cause of the problem. https://github.co

[clang-tools-extra] [clang-tidy] Filter out googletest TUs in bugprone-unchecked-optional-access (PR #115051)

2024-11-05 Thread Carlos Galvez via cfe-commits
carlosgalvezp wrote: A quick middle-point solution is to add an option to allow ignoring code that is executed from within macros, or even allow the user to specify which macros to ignore. https://github.com/llvm/llvm-project/pull/115051 ___ cfe-comm

[clang-tools-extra] [clang-tidy] Create a check for signed and unsigned integers comparison (PR #113144)

2024-11-11 Thread Carlos Galvez via cfe-commits
carlosgalvezp wrote: Perhaps this has been discussed before, but I think the part about "add qt module" should be added on a separate patch, since adding a brand-new tidy module is a rather big thing. So this patch could be only about adding the `modernize` check, and a follow-up patch could

[clang-tools-extra] [clang-tidy] Add modernize-substr-to-starts-with check (PR #116033)

2024-11-13 Thread Carlos Galvez via cfe-commits
carlosgalvezp wrote: > I think `modernize-use-starts-ends-with` should be extended instead. Agreed! https://github.com/llvm/llvm-project/pull/116033 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinf

[clang-tools-extra] [clang-tidy] Fix false positive in cppcoreguidelines-avoid-const-or-ref-data-members when detecting templated classes with inheritance (PR #115180)

2024-11-13 Thread Carlos Galvez via cfe-commits
@@ -19,75 +19,87 @@ AST_MATCHER(FieldDecl, isMemberOfLambda) { return Node.getParent()->isLambda(); } -struct MemberFunctionInfo { - bool Declared{}; - bool Deleted{}; -}; - -struct MemberFunctionPairInfo { - MemberFunctionInfo Copy{}; - MemberFunctionInfo Move{}; -}; -

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

2024-09-23 Thread Carlos Galvez via cfe-commits
carlosgalvezp wrote: Friendly ping, let me know if there's anything else that should be addressed! https://github.com/llvm/llvm-project/pull/108083 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/

[clang] [clang][NFC] Fix example code for memberPointerType() AST matcher (PR #109404)

2024-09-23 Thread Carlos Galvez via cfe-commits
https://github.com/carlosgalvezp updated https://github.com/llvm/llvm-project/pull/109404 >From 96ee182c19926a40331430a661bd959066e56bf9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20G=C3=A1lvez?= Date: Fri, 20 Sep 2024 11:32:07 + Subject: [PATCH] [clang][NFC] Fix example code for membe

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

2024-09-27 Thread Carlos Galvez via cfe-commits
@@ -0,0 +1,45 @@ +//===--- 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] [clang][NFC] Fix example code for memberPointerType() AST matcher (PR #109404)

2024-09-27 Thread Carlos Galvez via cfe-commits
carlosgalvezp wrote: Great! https://github.com/llvm/llvm-project/pull/109404 ___ 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-27 Thread Carlos Galvez via cfe-commits
https://github.com/carlosgalvezp updated https://github.com/llvm/llvm-project/pull/108083 >From 467b454a07e22437958832d306ae2c4b67c372ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20G=C3=A1lvez?= Date: Tue, 10 Sep 2024 13:46:51 + Subject: [PATCH] [clang-tidy] Create bugprone-bit-cast-p

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

2024-09-27 Thread Carlos Galvez via cfe-commits
https://github.com/carlosgalvezp updated https://github.com/llvm/llvm-project/pull/108083 >From c107a956e8fc27fd35f9a840e59ea748aac03586 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20G=C3=A1lvez?= Date: Tue, 10 Sep 2024 13:46:51 + Subject: [PATCH] [clang-tidy] Create bugprone-bit-cast-p

[clang] [clang][NFC] Fix example code for memberPointerType() AST matcher (PR #109404)

2024-09-27 Thread Carlos Galvez via cfe-commits
https://github.com/carlosgalvezp closed https://github.com/llvm/llvm-project/pull/109404 ___ 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-27 Thread Carlos Galvez via cfe-commits
carlosgalvezp wrote: > > It now comes to mind that we probably also want to check `memcpy(ptr, > > ptr)`, which is equivalent to `bit_cast`. In that case I wonder if the > > check name still holds or it should be named something else? > > Yeah, with the addition of `memcpy`, the `bit` part of

[clang-tools-extra] [clang-tidy][NFC] add qutation mark for C++ classes in warning message (PR #109068)

2024-09-18 Thread Carlos Galvez via cfe-commits
carlosgalvezp wrote: > But the template mark is really hard to understand I agree. Did you intend to remove that in this commit as well? I see it's still present. https://github.com/llvm/llvm-project/pull/109068 ___ cfe-commits mailing list cfe-commi

[clang] [clang-tools-extra] [clang][NFC] Fix example code for memberPointerType() AST matcher (PR #109403)

2024-09-20 Thread Carlos Galvez via cfe-commits
Carlos =?utf-8?q?Gálvez?= Message-ID: In-Reply-To: https://github.com/carlosgalvezp created https://github.com/llvm/llvm-project/pull/109403 The example code doesn't compile otherwise. >From 6916d5ecdc327b2771fbbca226095bd99d394dab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20G=C3=A1lv

[clang] [clang][NFC] Fix example code for memberPointerType() AST matcher (PR #109404)

2024-09-20 Thread Carlos Galvez via cfe-commits
https://github.com/carlosgalvezp created https://github.com/llvm/llvm-project/pull/109404 The example code doesn't compile otherwise. >From f598e98d4deb66a313b7f944cb96df04bc4b91a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20G=C3=A1lvez?= Date: Fri, 20 Sep 2024 11:32:07 + Subject: [P

[clang] [clang-tools-extra] [clang][NFC] Fix example code for memberPointerType() AST matcher (PR #109403)

2024-09-20 Thread Carlos Galvez via cfe-commits
Carlos =?utf-8?q?Gálvez?= Message-ID: In-Reply-To: https://github.com/carlosgalvezp closed https://github.com/llvm/llvm-project/pull/109403 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-co

[clang] [clang-tools-extra] RFC: [clang-tidy] [analyzer] Nondeterministic pointer usage improvements (PR #110471)

2024-09-30 Thread Carlos Galvez via cfe-commits
carlosgalvezp wrote: > > Why isn't `misc` suitable for this use case? > > `bugprone` was just an initial thought. If the group think leads us to `misc` > I'm ok with moving in that direction. Other thoughts? Maybe i misunderstood, I thought you meant creating a new clang-tidy module called `a

[clang] [clang-tools-extra] RFC: [clang-tidy] [analyzer] Nondeterministic pointer usage improvements (PR #110471)

2024-09-30 Thread Carlos Galvez via cfe-commits
carlosgalvezp wrote: > creation of an advisory group. Why isn't `misc` suitable for this use case? It would be confusing to have both groups I think, and may lead to bike-shedding discussions in the future about where a check belongs in misc or advisory. https://github.com/llvm/llvm-project/p

[clang] [clang-format] Handle template closer followed by braces (PR #110971)

2024-10-03 Thread Carlos Galvez via cfe-commits
@@ -3538,6 +3538,11 @@ TEST_F(TokenAnnotatorTest, TemplateInstantiation) { ASSERT_EQ(Tokens.size(), 11u) << Tokens; EXPECT_TOKEN(Tokens[2], tok::less, TT_TemplateOpener); EXPECT_TOKEN(Tokens[6], tok::greater, TT_TemplateCloser); + + Tokens = annotate("return std::conditi

[clang-tools-extra] [clang-tidy][NFC] add qutation mark for C++ classes in warning message (PR #109068)

2024-09-18 Thread Carlos Galvez via cfe-commits
https://github.com/carlosgalvezp approved this pull request. LGTM, thanks for splitting the patch! Personally I don't quite see the added value of having the quotes, I actually find them a bit noisy. It would have been good to write the motivation for this change in the commit message. But th

[clang-tools-extra] [clang-tidy] Filter out googletest TUs in bugprone-unchecked-optional-access (PR #115051)

2024-11-06 Thread Carlos Galvez via cfe-commits
carlosgalvezp wrote: > we're not (fully) understanding the content My thinking was that we don't even need to understand the content, we simply exclude code that is contained within any of the problematic public macros. This sounds like it should be possible to do? Unfortunately I don't know t

[clang-tools-extra] Fix false positive in bugprone-throw-keyword-missing (PR #115302)

2024-11-07 Thread Carlos Galvez via cfe-commits
https://github.com/carlosgalvezp created https://github.com/llvm/llvm-project/pull/115302 Fixes #115055 >From c6ad9d042612c63cb9862782f17082e07277fc2a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20G=C3=A1lvez?= Date: Wed, 6 Nov 2024 08:52:06 + Subject: [PATCH] Fix false positive in bug

[clang-tools-extra] Fix false positive in bugprone-throw-keyword-missing (PR #115138)

2024-11-07 Thread Carlos Galvez via cfe-commits
https://github.com/carlosgalvezp closed https://github.com/llvm/llvm-project/pull/115138 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] Fix false positive in bugprone-throw-keyword-missing (PR #115138)

2024-11-06 Thread Carlos Galvez via cfe-commits
https://github.com/carlosgalvezp created https://github.com/llvm/llvm-project/pull/115138 Fixes #115055 >From 0f94715df89ef0860ed3f6b74bbbd3cd71c0b102 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20G=C3=A1lvez?= Date: Wed, 6 Nov 2024 08:52:06 + Subject: [PATCH] Fix false positive in bug

[clang-tools-extra] Fix false positive in bugprone-throw-keyword-missing (PR #115138)

2024-11-07 Thread Carlos Galvez via cfe-commits
carlosgalvezp wrote: Not sure how to re-run the failed jobs, maybe the force-push broke them. Will open a new PR, sorry for the trouble! https://github.com/llvm/llvm-project/pull/115138 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://l

[clang-tools-extra] Fix false positive in bugprone-throw-keyword-missing (PR #115138)

2024-11-07 Thread Carlos Galvez via cfe-commits
https://github.com/carlosgalvezp closed https://github.com/llvm/llvm-project/pull/115138 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] Fix false positive in bugprone-throw-keyword-missing (PR #115138)

2024-11-07 Thread Carlos Galvez via cfe-commits
https://github.com/carlosgalvezp reopened https://github.com/llvm/llvm-project/pull/115138 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] Fix false positive in bugprone-throw-keyword-missing (PR #115138)

2024-11-06 Thread Carlos Galvez via cfe-commits
https://github.com/carlosgalvezp updated https://github.com/llvm/llvm-project/pull/115138 >From c6ad9d042612c63cb9862782f17082e07277fc2a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20G=C3=A1lvez?= Date: Wed, 6 Nov 2024 08:52:06 + Subject: [PATCH] Fix false positive in bugprone-throw-key

[clang-tools-extra] [clang-tidy] Filter out googletest TUs in bugprone-unchecked-optional-access (PR #115051)

2024-11-06 Thread Carlos Galvez via cfe-commits
carlosgalvezp wrote: > but these are not internal implementation details - these are key elements of > the public API In the unit test, you have copied internal code from here: https://github.com/google/googletest/blob/d144031940543e15423a25ae5a8a74141044862f/googletest/include/gtest/internal/

[clang-tools-extra] [clang-tidy] Add modernize-use-span-first-last check (PR #118074)

2024-11-29 Thread Carlos Galvez via cfe-commits
carlosgalvezp wrote: ```cpp auto sub2 = s.subspan(n);// transforms to: auto sub2 = s.last(s.size() - n); ``` IMHO the transformed code is less readable. It would be more useful to do the opposite transformation, maybe that's what you intended? ```cpp auto sub2 = s.subspan(s.size() - n

[clang-tools-extra] [clang-tidy] Add modernize-use-span-first-last check (PR #118074)

2024-11-29 Thread Carlos Galvez via cfe-commits
@@ -0,0 +1,40 @@ +//===--- UseSpanFirstLastCheck.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: Apach

[clang-tools-extra] [clang-tidy] Add modernize-use-span-first-last check (PR #118074)

2024-11-29 Thread Carlos Galvez via cfe-commits
carlosgalvezp wrote: > not sure if this is a readability or a modernize check `readability`. `modernize` is for using new features from newer standards. https://github.com/llvm/llvm-project/pull/118074 ___ cfe-commits mailing list cfe-commits@lists.l

[clang-tools-extra] [clang-tidy] Add modernize-cleanup-static-cast check (PR #118033)

2024-11-28 Thread Carlos Galvez via cfe-commits
carlosgalvezp wrote: For future reference, `modernize` is typically related to new features of new C++ standards, so this check wouldn't quite fit there. Great that you found an existing check that suits your needs! https://github.com/llvm/llvm-project/pull/118033 _

[clang-tools-extra] [clang-tidy] fix cppcoreguidelines-narrowing-conversions false positives when narrowing integer to signed integer in C++20 (PR #116591)

2024-11-18 Thread Carlos Galvez via cfe-commits
carlosgalvezp wrote: My understanding of the guidelines is that the purpose of this rule is to avoid data loss (truncation) due to narrowing. In that sense, isn't this still a problem in C++20? Whether it well-defined behavior in C++20 or implementation-defined behavior pre-C++20 does not se

[clang-tools-extra] Fix false positive in bugprone-throw-keyword-missing (PR #115302)

2024-11-09 Thread Carlos Galvez via cfe-commits
Carlos =?utf-8?q?Gálvez?= Message-ID: In-Reply-To: https://github.com/carlosgalvezp updated https://github.com/llvm/llvm-project/pull/115302 >From c6ad9d042612c63cb9862782f17082e07277fc2a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20G=C3=A1lvez?= Date: Wed, 6 Nov 2024 08:52:06 + Sub

[clang-tools-extra] Fix false positive in bugprone-throw-keyword-missing (PR #115302)

2024-11-09 Thread Carlos Galvez via cfe-commits
Carlos =?utf-8?q?Gálvez?= Message-ID: In-Reply-To: https://github.com/carlosgalvezp closed https://github.com/llvm/llvm-project/pull/115302 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-co

[clang-tools-extra] [clang-tidy] Filter out googletest TUs in bugprone-unchecked-optional-access (PR #115051)

2024-11-13 Thread Carlos Galvez via cfe-commits
carlosgalvezp wrote: Apologies for the late response, I don't have much time to perform in-depth reviews. Tagging additional reviewers @5chmidti @HerrCai0907 https://github.com/llvm/llvm-project/pull/115051 ___ cfe-commits mailing list cfe-commits@l

[clang-tools-extra] [clang-tidy] Fix false positive in cppcoreguidelines-avoid-const-or-ref-data-members when detecting templated classes with inheritance (PR #115180)

2024-11-24 Thread Carlos Galvez via cfe-commits
https://github.com/carlosgalvezp approved this pull request. LGTM! https://github.com/llvm/llvm-project/pull/115180 ___ 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-narrowing-conversions false positives when narrowing integer to signed integer in C++20 (PR #116591)

2024-11-26 Thread Carlos Galvez via cfe-commits
carlosgalvezp wrote: > since we have already allow the to unsigned cast later I'm not sure I follow, could you point me to an example of this? When implementing guidelines, we must make sure we implement exactly what the guidelines say, and not make them less restrictive (at least not by de

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

2024-09-17 Thread Carlos Galvez via cfe-commits
https://github.com/carlosgalvezp updated https://github.com/llvm/llvm-project/pull/108083 >From d7eacb7d6614b374a959c33a7394f2652df32982 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20G=C3=A1lvez?= Date: Tue, 10 Sep 2024 13:46:51 + Subject: [PATCH] [clang-tidy] Create bugprone-bit-cast-p

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

2024-09-17 Thread Carlos Galvez via cfe-commits
https://github.com/carlosgalvezp updated https://github.com/llvm/llvm-project/pull/108083 >From c9e69b58e6c3e27fc6dd529783c02fec8fafbd9a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20G=C3=A1lvez?= Date: Tue, 10 Sep 2024 13:46:51 + Subject: [PATCH] [clang-tidy] Create bugprone-bit-cast-p

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

2024-09-17 Thread Carlos Galvez 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-09-17 Thread Carlos Galvez 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-09-17 Thread Carlos Galvez 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-09-17 Thread Carlos Galvez 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-09-17 Thread Carlos Galvez 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-09-17 Thread Carlos Galvez 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-09-17 Thread Carlos Galvez 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-09-17 Thread Carlos Galvez 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] Create a check for signed and unsigned integers comparison (PR #113144)

2024-12-02 Thread Carlos Galvez via cfe-commits
carlosgalvezp wrote: Nit tip: the additional `fixup!` in the commit message for each additional commit is rather distracting, it would be best if each commit were be named after the changes it introduces w.r.t. the previous commit. https://github.com/llvm/llvm-project/pull/113144

<    1   2   3   4   5   >