[all-commits] [llvm/llvm-project] 25d968: [Clang] Extend lifetime of temporaries in mem-defa...

yronglin via All-commits all-commits at lists.llvm.org
Thu Oct 10 09:04:24 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 25d9688c43d37c0c918e9b8ab2f67be35b0fb75f
      https://github.com/llvm/llvm-project/commit/25d9688c43d37c0c918e9b8ab2f67be35b0fb75f
  Author: yronglin <yronglin777 at gmail.com>
  Date:   2024-10-11 (Fri, 11 Oct 2024)

  Changed paths:
    M clang/docs/ReleaseNotes.rst
    M clang/lib/Sema/SemaExpr.cpp
    M clang/lib/Sema/SemaInit.cpp
    M clang/test/AST/ast-dump-for-range-lifetime.cpp
    M clang/test/CXX/special/class.temporary/p6.cpp
    M clang/www/cxx_status.html

  Log Message:
  -----------
  [Clang] Extend lifetime of temporaries in mem-default-init for P2718R0 (#86960)

Depends on [CWG1815](https://github.com/llvm/llvm-project/pull/108039).
Fixes https://github.com/llvm/llvm-project/issues/85613.

In [[Clang] Implement P2718R0 "Lifetime extension in range-based for
loops"](https://github.com/llvm/llvm-project/pull/76361), we've not
implement the lifetime extensions for the temporaries which in
`CXXDefaultInitExpr`. As the confirmation in
https://github.com/llvm/llvm-project/issues/85613, we should extend
lifetime for that.

To avoid modifying current CodeGen rules, in a lifetime extension
context, the cleanup of `CXXDefaultInitExpr` was ignored.

---------

Signed-off-by: yronglin <yronglin777 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