https://github.com/fmayer updated https://github.com/llvm/llvm-project/pull/179786
>From e8fba335c43059ca49cffd227cbe4f01c7f106f2 Mon Sep 17 00:00:00 2001 From: Florian Mayer <[email protected]> Date: Wed, 4 Feb 2026 13:34:31 -0800 Subject: [PATCH 1/2] =?UTF-8?q?[=F0=9D=98=80=F0=9D=97=BD=F0=9D=97=BF]=20in?= =?UTF-8?q?itial=20version?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Created using spr 1.3.6 --- .../UncheckedStatusOrAccessModelTestFixture.cpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/clang/unittests/Analysis/FlowSensitive/UncheckedStatusOrAccessModelTestFixture.cpp b/clang/unittests/Analysis/FlowSensitive/UncheckedStatusOrAccessModelTestFixture.cpp index 5be4e38133744..afb2bbae358d5 100644 --- a/clang/unittests/Analysis/FlowSensitive/UncheckedStatusOrAccessModelTestFixture.cpp +++ b/clang/unittests/Analysis/FlowSensitive/UncheckedStatusOrAccessModelTestFixture.cpp @@ -3960,6 +3960,23 @@ TEST_P(UncheckedStatusOrAccessModelTest, StatusPtrReference) { )cc"); } +TEST_P(UncheckedStatusOrAccessModelTest, PairIterator) { + ExpectDiagnosticsFor(R"cc( +#include "unchecked_statusor_access_test_defs.h" + + class iterator { + public: + const std::pair<int, absl::StatusOr<int>>* operator->() const; + }; + void target() { + if (auto it = Make<iterator>(); it->second.ok()) { + // This is a false positive. Fix and remove the [[unsafe]]. + it->second.value(); // [[unsafe]] + } + } +)cc"); +} + } // namespace std::string >From f8fb6c35f349b729a463bd10434af04d675ce9fe Mon Sep 17 00:00:00 2001 From: Florian Mayer <[email protected]> Date: Wed, 4 Feb 2026 13:54:02 -0800 Subject: [PATCH 2/2] fix Created using spr 1.3.6 --- .../FlowSensitive/UncheckedStatusOrAccessModelTestFixture.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/clang/unittests/Analysis/FlowSensitive/UncheckedStatusOrAccessModelTestFixture.cpp b/clang/unittests/Analysis/FlowSensitive/UncheckedStatusOrAccessModelTestFixture.cpp index afb2bbae358d5..575c8ccc1b723 100644 --- a/clang/unittests/Analysis/FlowSensitive/UncheckedStatusOrAccessModelTestFixture.cpp +++ b/clang/unittests/Analysis/FlowSensitive/UncheckedStatusOrAccessModelTestFixture.cpp @@ -3970,7 +3970,7 @@ TEST_P(UncheckedStatusOrAccessModelTest, PairIterator) { }; void target() { if (auto it = Make<iterator>(); it->second.ok()) { - // This is a false positive. Fix and remove the [[unsafe]]. + // This is a false positive. Fix and remove the unsafe. it->second.value(); // [[unsafe]] } } _______________________________________________ cfe-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
