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

Alan Zhao via All-commits all-commits at lists.llvm.org
Mon May 1 21:26:06 PDT 2023

  Branch: refs/heads/release/16.x
  Home:   https://github.com/llvm/llvm-project
  Commit: ff9dc9c4fb113de9619fad6a77f4888277579718
  Author: Alan Zhao <ayzhao at google.com>
  Date:   2023-05-01 (Mon, 01 May 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

(cherry picked from commit 7df3c71b508b65284483225685f1ba19777f2bbb)

More information about the All-commits mailing list