[all-commits] [llvm/llvm-project] 31b0be: [Clang] Add lifetimebound attribute to std::move/s...

Alexander Shaposhnikov via All-commits all-commits at lists.llvm.org
Thu Jan 19 13:08:06 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 31b0be4eba9e8e9244799f0ebcb18175faff69ab
      https://github.com/llvm/llvm-project/commit/31b0be4eba9e8e9244799f0ebcb18175faff69ab
  Author: Alexander Shaposhnikov <ashaposhnikov at google.com>
  Date:   2023-01-19 (Thu, 19 Jan 2023)

  Changed paths:
    M clang/docs/LanguageExtensions.rst
    M clang/docs/ReleaseNotes.rst
    M clang/lib/Sema/SemaDecl.cpp
    M clang/test/SemaCXX/attr-lifetimebound.cpp
    M clang/test/SemaCXX/builtin-std-move.cpp
    M clang/test/SemaCXX/builtins.cpp

  Log Message:
  -----------
  [Clang] Add lifetimebound attribute to std::move/std::forward

Clang now automatically adds [[clang::lifetimebound]] to the parameters of
std::move, std::forward et al, this enables Clang to diagnose more cases
where the returned reference outlives the object.
Associated GitHub issue: https://github.com/llvm/llvm-project/issues/60020

Test plan: ninja check-clang check-all

Differential revision: https://reviews.llvm.org/D141744




More information about the All-commits mailing list