[clang] [clang] Fix direct-initialization with new expressions for arrays (PR #78201)

2024-01-16 Thread Mital Ashok via cfe-commits
https://github.com/MitalAshok closed https://github.com/llvm/llvm-project/pull/78201 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Fix direct-initialization with new expressions for arrays (PR #78201)

2024-01-16 Thread Mital Ashok via cfe-commits
MitalAshok wrote: Yeah #76976 supersedes this. I would still recommend removing `diag::err_new_array_init_args` if only so: ```c++ int x[2](1, 2); int* y = new int[2](1, 2); ``` have similar error messages. https://github.com/llvm/llvm-project/pull/78201

[clang] [clang] Fix direct-initialization with new expressions for arrays (PR #78201)

2024-01-16 Thread Mital Ashok via cfe-commits
https://github.com/MitalAshok converted_to_draft https://github.com/llvm/llvm-project/pull/78201 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Fix direct-initialization with new expressions for arrays (PR #78201)

2024-01-15 Thread Alan Zhao via cfe-commits
alanzhao1 wrote: > I believe the approach here is not sufficient and we have a current PR in > progress: #76976 > > we also need codegen work to implement this. Correct - here are some examples that will cause this to fail: ```cpp void foo(int n) { new int[n](1, 2); } ``` ```cpp void

[clang] [clang] Fix direct-initialization with new expressions for arrays (PR #78201)

2024-01-15 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik commented: I believe the approach here is not sufficient and we have a current PR in progress: https://github.com/llvm/llvm-project/pull/76976 we also need codegen work to implement this. https://github.com/llvm/llvm-project/pull/78201

[clang] [clang] Fix direct-initialization with new expressions for arrays (PR #78201)

2024-01-15 Thread Mital Ashok via cfe-commits
https://github.com/MitalAshok updated https://github.com/llvm/llvm-project/pull/78201 >From 730f7159c04cbb83fa18f50e8db32f6c5295ef6f Mon Sep 17 00:00:00 2001 From: Mital Ashok Date: Mon, 15 Jan 2024 18:31:06 + Subject: [PATCH 1/2] [clang] Fix direct-initialization with new expressions for

[clang] [clang] Fix direct-initialization with new expressions for arrays (PR #78201)

2024-01-15 Thread via cfe-commits
@@ -937,6 +937,9 @@ Bug Fixes to AST Handling - Fixed a bug where Template Instantiation failed to handle Lambda Expressions with certain types of Attributes. (`#76521 `_) +- Fixed a bug where the parenthesized

[clang] [clang] Fix direct-initialization with new expressions for arrays (PR #78201)

2024-01-15 Thread via cfe-commits
https://github.com/cor3ntin approved this pull request. Nice simplification, thanks. I validated that this does not impact c++98, which just fails in parsing https://github.com/llvm/llvm-project/pull/78201 ___ cfe-commits mailing list

[clang] [clang] Fix direct-initialization with new expressions for arrays (PR #78201)

2024-01-15 Thread via cfe-commits
https://github.com/cor3ntin edited https://github.com/llvm/llvm-project/pull/78201 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Fix direct-initialization with new expressions for arrays (PR #78201)

2024-01-15 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Mital Ashok (MitalAshok) Changes Fixes #78183 Just removed the check entirely. The diagnostic issued for trying to initialize an array (`array initializer must be an initializer list`) is much clearer (than `array 'new' cannot have

[clang] [clang] Fix direct-initialization with new expressions for arrays (PR #78201)

2024-01-15 Thread Mital Ashok via cfe-commits
https://github.com/MitalAshok created https://github.com/llvm/llvm-project/pull/78201 Fixes #78183 Just removed the check entirely. The diagnostic issued for trying to initialize an array (`array initializer must be an initializer list`) is much clearer (than `array 'new' cannot have