[clang] [clang] Fix parenthesized list initialization of arrays not working with `new` (PR #76976)

Eli Friedman via cfe-commits cfe-commits at lists.llvm.org
Tue Jan 9 14:47:38 PST 2024


================
@@ -5495,14 +5495,12 @@ static void TryOrBuildParenListInitialization(
         return;
     }
     //   ...and value-initialized for each k < i <= n;
-    if (ArrayLength > Args.size()) {
----------------
efriedma-quic wrote:

What is this change supposed to do?

The existing code is intentionally trying to avoid creating an array filler if it won't be used (so, for example, the code will compile if the default constructor is deleted).

https://github.com/llvm/llvm-project/pull/76976


More information about the cfe-commits mailing list