[clang] [-Wunsafe-buffer-usage] Add a new warning for uses of std::span two-parameter constructors (PR #77148)

2024-01-26 Thread Ziqing Luo via cfe-commits
https://github.com/ziqingluo-90 closed https://github.com/llvm/llvm-project/pull/77148 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [-Wunsafe-buffer-usage] Add a new warning for uses of std::span two-parameter constructors (PR #77148)

2024-01-23 Thread Ziqing Luo via cfe-commits
https://github.com/ziqingluo-90 updated https://github.com/llvm/llvm-project/pull/77148 >From 1b169f49a129a5a69a82386b486c8a46ecfc815a Mon Sep 17 00:00:00 2001 From: ziqingluo-90 Date: Fri, 5 Jan 2024 13:39:39 -0800 Subject: [PATCH 1/3] [-Wunsafe-buffer-usage] Add a new warning for use of

[clang] [-Wunsafe-buffer-usage] Add a new warning for uses of std::span two-parameter constructors (PR #77148)

2024-01-23 Thread via cfe-commits
https://github.com/jkorous-apple edited https://github.com/llvm/llvm-project/pull/77148 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [-Wunsafe-buffer-usage] Add a new warning for uses of std::span two-parameter constructors (PR #77148)

2024-01-23 Thread via cfe-commits
@@ -594,6 +667,44 @@ class PointerArithmeticGadget : public WarningGadget { // FIXME: this gadge will need a fix-it }; +class SpanTwoParamConstructorGadget : public WarningGadget { + static constexpr const char *const SpanTwoParamConstructorTag = +

[clang] [-Wunsafe-buffer-usage] Add a new warning for uses of std::span two-parameter constructors (PR #77148)

2024-01-23 Thread via cfe-commits
https://github.com/jkorous-apple approved this pull request. I will just say that I didn't imagine this warning to be made part of the analysis machine we use to produce fixits and it seems like at couple places the patch struggles with the abstractions the machine uses but overall I don't

[clang] [-Wunsafe-buffer-usage] Add a new warning for uses of std::span two-parameter constructors (PR #77148)

2024-01-22 Thread Ziqing Luo via cfe-commits
https://github.com/ziqingluo-90 updated https://github.com/llvm/llvm-project/pull/77148 >From 6ba957670ca593094b4545c35801585da2ee02a8 Mon Sep 17 00:00:00 2001 From: ziqingluo-90 Date: Fri, 5 Jan 2024 13:39:39 -0800 Subject: [PATCH 1/2] [-Wunsafe-buffer-usage] Add a new warning for use of

[clang] [-Wunsafe-buffer-usage] Add a new warning for uses of std::span two-parameter constructors (PR #77148)

2024-01-17 Thread via cfe-commits
@@ -2256,6 +2256,10 @@ class UnsafeBufferUsageReporter : public UnsafeBufferUsageHandler { Range = UO->getSubExpr()->getSourceRange(); MsgParam = 1; } +} else if (const auto *CtorExpr = dyn_cast(Operation)) { + S.Diag(CtorExpr->getLocation(), +

[clang] [-Wunsafe-buffer-usage] Add a new warning for uses of std::span two-parameter constructors (PR #77148)

2024-01-17 Thread via cfe-commits
@@ -12075,6 +12075,9 @@ def note_unsafe_buffer_variable_fixit_together : Note< "%select{|, and change %2 to safe types to make function %4 bounds-safe}3">; def note_safe_buffer_usage_suggestions_disabled : Note< "pass -fsafe-buffer-usage-suggestions to receive code

[clang] [-Wunsafe-buffer-usage] Add a new warning for uses of std::span two-parameter constructors (PR #77148)

2024-01-08 Thread Ziqing Luo via cfe-commits
https://github.com/ziqingluo-90 updated https://github.com/llvm/llvm-project/pull/77148 >From 6ba957670ca593094b4545c35801585da2ee02a8 Mon Sep 17 00:00:00 2001 From: ziqingluo-90 Date: Fri, 5 Jan 2024 13:39:39 -0800 Subject: [PATCH 1/2] [-Wunsafe-buffer-usage] Add a new warning for use of

[clang] [-Wunsafe-buffer-usage] Add a new warning for uses of std::span two-parameter constructors (PR #77148)

2024-01-05 Thread Ziqing Luo via cfe-commits
https://github.com/ziqingluo-90 updated https://github.com/llvm/llvm-project/pull/77148 >From 4714b0c03897ab61322e3a16288994ccb01dbfac Mon Sep 17 00:00:00 2001 From: ziqingluo-90 Date: Fri, 5 Jan 2024 13:39:39 -0800 Subject: [PATCH 1/2] [-Wunsafe-buffer-usage] Add a new warning for use of

[clang] [-Wunsafe-buffer-usage] Add a new warning for uses of std::span two-parameter constructors (PR #77148)

2024-01-05 Thread Ziqing Luo via cfe-commits
https://github.com/ziqingluo-90 updated https://github.com/llvm/llvm-project/pull/77148 >From fb93d83d65ef1c52857b4471ccda2e82447d45dc Mon Sep 17 00:00:00 2001 From: ziqingluo-90 Date: Fri, 5 Jan 2024 13:39:39 -0800 Subject: [PATCH 1/2] [-Wunsafe-buffer-usage] Add a new warning for use of

[clang] [-Wunsafe-buffer-usage] Add a new warning for uses of std::span two-parameter constructors (PR #77148)

2024-01-05 Thread via cfe-commits
github-actions[bot] wrote: :warning: C/C++ code formatter, clang-format found issues in your code. :warning: You can test this locally with the following command: ``bash git-clang-format --diff d7b4debf98fd740f821bda717de7b807e26ae95a 54d75df6c413a5b273a059426b00def7437ab525 --

[clang] [-Wunsafe-buffer-usage] Add a new warning for uses of std::span two-parameter constructors (PR #77148)

2024-01-05 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang-analysis @llvm/pr-subscribers-clang Author: Ziqing Luo (ziqingluo-90) Changes The PR contains two commits: 1. adding a new waring under a sub-group of `-Wunsafe-buffer-usage` 2. teach the analyzer to be quiet on some benign cases --- Patch is

[clang] [-Wunsafe-buffer-usage] Add a new warning for uses of std::span two-parameter constructors (PR #77148)

2024-01-05 Thread Ziqing Luo via cfe-commits
https://github.com/ziqingluo-90 created https://github.com/llvm/llvm-project/pull/77148 The PR contains two commits: 1. adding a new waring under a sub-group of `-Wunsafe-buffer-usage` 2. teach the analyzer to be quiet on some benign cases >From 475d918fb0b5991be7ce559ef6ef7f20c6b231e5 Mon Sep