[clang] [nfc][clang] Fix test in new-array-init.cpp (PR #79225)

Alan Zhao via cfe-commits cfe-commits at lists.llvm.org
Tue Jan 23 15:27:19 PST 2024


https://github.com/alanzhao1 created https://github.com/llvm/llvm-project/pull/79225

This test was originally introduced in
https://github.com/llvm/llvm-project/pull/76976, but it incorrectly tests braced-list initialization instead of parenthesized initialization.

>From e68891368098b2ea4883594cfa720ca4ac6ac435 Mon Sep 17 00:00:00 2001
From: Alan Zhao <ayzhao at google.com>
Date: Tue, 23 Jan 2024 15:24:35 -0800
Subject: [PATCH] [nfc][clang] Fix test in new-array-init.cpp

This test was originally introduced in
https://github.com/llvm/llvm-project/pull/76976, but it incorrectly
tests braced-list initialization instead of parenthesized
initialization.
---
 clang/test/CodeGenCXX/new-array-init.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/clang/test/CodeGenCXX/new-array-init.cpp b/clang/test/CodeGenCXX/new-array-init.cpp
index fe1bdf425ab142..781c4728df4509 100644
--- a/clang/test/CodeGenCXX/new-array-init.cpp
+++ b/clang/test/CodeGenCXX/new-array-init.cpp
@@ -164,7 +164,7 @@ void string_sufficient_paren() {
   // FIXME: For very large arrays, it would be preferable to emit a small copy and a memset.
   // CHECKCXX20: call void @llvm.memcpy{{.*}}(ptr align {{[0-9]+}} %[[PTR]], ptr align {{[0-9]+}} @[[ABC15]], i32 15,
   // CHECKCXX20-NOT: memset
-  new char[15] { "abc" };
+  new char[15]("abc");
 }
 #endif
 



More information about the cfe-commits mailing list