[all-commits] [llvm/llvm-project] 8ce6c5: [clang-tidy] Fix false positive in bugprone-use-af...

Yuta Nakamura via All-commits all-commits at lists.llvm.org
Mon Jun 1 18:59:17 PDT 2026


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 8ce6c5ff2c134414d8e1815bdc122699abd89954
      https://github.com/llvm/llvm-project/commit/8ce6c5ff2c134414d8e1815bdc122699abd89954
  Author: Yuta Nakamura <44285097+nakasan617 at users.noreply.github.com>
  Date:   2026-06-02 (Tue, 02 Jun 2026)

  Changed paths:
    M clang-tools-extra/clang-tidy/bugprone/UseAfterMoveCheck.cpp
    M clang-tools-extra/docs/ReleaseNotes.rst
    M clang-tools-extra/docs/clang-tidy/checks/bugprone/use-after-move.rst
    M clang-tools-extra/test/clang-tidy/checkers/bugprone/use-after-move.cpp

  Log Message:
  -----------
  [clang-tidy] Fix false positive in bugprone-use-after-move for std::tie (#192895)

std::tie(a, b) = expr reinitializes all variables passed to std::tie
because the tuple assignment operator writes back through the stored
references. The check was not recognizing this pattern, causing a false
positive on the second std::tie assignment in loops like:

  std::tie(a, b) = foo(std::move(a), std::move(b));
  std::tie(a, b) = foo(std::move(a), std::move(b)); // false positive

Add std::tie assignment as a reinitialization case in
makeReinitMatcher().

Fixes #136105.

---

**AI Disclosure:** Claude (Anthropic) was used to assist in diagnosing
the CI test failure and identifying the off-by-one line number in the
CHECK-NOTES.

---------

Co-authored-by: Claude Sonnet 4.6 <noreply at anthropic.com>
Co-authored-by: Zeyi Xu <mitchell.xu2 at gmail.com>



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list