[clang] [Clang][Sema] placement new initializes typedef array with correct size (PR #83124)

David Blaikie via cfe-commits cfe-commits at lists.llvm.org
Wed Apr 17 15:13:18 PDT 2024


dwblaikie wrote:

Simplified a bit more:
```
template <typename T>
void f1() {
  int (*x)[1] = new int[1][1]; // fails
}
template void f1<char>();
void f2() {
  int (*x)[1] = new int[1][1]; // passes
}
```
https://godbolt.org/z/MhaYbvefG - yeah seems pretty clear this is a regression. Compiles with GCC, fails with clang, and the non-dependent context passes with either.

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


More information about the cfe-commits mailing list