[all-commits] [llvm/llvm-project] 6e720d: [clang] Improve the lifetime_capture_by diagnostic...

Haojian Wu via All-commits all-commits at lists.llvm.org
Thu Nov 28 03:35:38 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 6e720df1ae23c715aefc36476ab46284a96e9371
      https://github.com/llvm/llvm-project/commit/6e720df1ae23c715aefc36476ab46284a96e9371
  Author: Haojian Wu <hokein.wu at gmail.com>
  Date:   2024-11-28 (Thu, 28 Nov 2024)

  Changed paths:
    M clang/include/clang/Basic/AttrDocs.td
    M clang/lib/Sema/CheckExprLifetime.cpp
    M clang/lib/Sema/SemaChecking.cpp
    M clang/test/Sema/warn-lifetime-analysis-capture-by.cpp

  Log Message:
  -----------
  [clang] Improve the lifetime_capture_by diagnostic on the constructor. (#117792)

With this change, the lifetime_capture_by code path will not handle the
constructor decl to avoid bogus diagnostics (see the testcase).

Instead, we reuse the lifetimebound code as the
lifetime_capture_by(this) has the same semantic as lifetimebound in
constructor. The downside is that the lifetimebound diagnostic is reused
for the capture case (I think it is not a big issue).


Fixes #117680



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