[all-commits] [llvm/llvm-project] 7df3c7: [clang] Fix 2 bugs with parenthesized aggregate in...

Alan Zhao via All-commits all-commits at lists.llvm.org
Thu Mar 30 15:06:52 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 7df3c71b508b65284483225685f1ba19777f2bbb
      https://github.com/llvm/llvm-project/commit/7df3c71b508b65284483225685f1ba19777f2bbb
  Author: Alan Zhao <ayzhao at google.com>
  Date:   2023-03-30 (Thu, 30 Mar 2023)

  Changed paths:
    M clang/lib/AST/Expr.cpp
    M clang/lib/Sema/SemaInit.cpp
    M clang/lib/Sema/TreeTransform.h
    M clang/test/CodeGen/paren-list-agg-init.cpp
    M clang/test/SemaCXX/paren-list-agg-init.cpp

  Log Message:
  -----------
  [clang] Fix 2 bugs with parenthesized aggregate initialization

* Fix an issue where temporaries initialized via parenthesized aggregate
  initialization don't get destroyed.
* Fix an issue where aggregate initialization omits calls to class
  members' move constructors after a TreeTransform. This occurs because
  the CXXConstructExpr wrapping the call to the move constructor gets
  unboxed during a TreeTransform of the wrapping FunctionalCastExpr (as with a
  InitListExpr), but unlike InitListExpr, we dont reperform the
  InitializationSequence for the list's expressions to regenerate the
  CXXConstructExpr. This patch fixes this bug by treating
  CXXParenListInitExpr identically to InitListExpr in this regard.

Fixes #61145

Reviewed By: rsmith

Differential Revision: https://reviews.llvm.org/D146465




More information about the All-commits mailing list