[all-commits] [llvm/llvm-project] 199c79: [clang][bytecode] Support partial initializers for...

Timm Baeder via All-commits all-commits at lists.llvm.org
Mon Feb 10 05:29:06 PST 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 199c791a1dbf417fdb08fbbb054d51ed398f285a
      https://github.com/llvm/llvm-project/commit/199c791a1dbf417fdb08fbbb054d51ed398f285a
  Author: Timm Baeder <tbaeder at redhat.com>
  Date:   2025-02-10 (Mon, 10 Feb 2025)

  Changed paths:
    M clang/lib/AST/ByteCode/Compiler.cpp
    M clang/lib/AST/ByteCode/Interp.h
    M clang/test/AST/ByteCode/new-delete.cpp

  Log Message:
  -----------
  [clang][bytecode] Support partial initializers for CXXNewExprs (#126494)

For `new A[N]{1,2,3}`, we need to allocate N elements of type A, and
initialize the first three with the given InitListExpr elements.
However, if N is larger than 3, we need to initialize the remaining
elements with the InitListExpr array filler.

Similarly, for `new A[N];`, we need to initilize all fields with the
constructor of A. The initializer type is a CXXConstructExpr of
IncompleteArrayType in this case, which we can't generally handle.



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