Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[clang] Parenthesized initialization of arrays does not work in new expression #78183

Closed
tomasz-kaminski-sonarsource opened this issue Jan 15, 2024 · 3 comments
Labels
clang:frontend Language frontend issues, e.g. anything involving "Sema" confirmed Verified by a second party

Comments

@tomasz-kaminski-sonarsource
Copy link
Contributor

The parenthesized initialization of arrays (aggregates) is not supported in the new expression:

int main() {
  int x[10](1, 2);  // OK
  auto p = new int[10](1, 2); // ERROR, accepted by GCC and MSVC
}

Live example: Godbolt

@tomasz-kaminski-sonarsource tomasz-kaminski-sonarsource added the clang:frontend Language frontend issues, e.g. anything involving "Sema" label Jan 15, 2024
@llvmbot
Copy link
Collaborator

llvmbot commented Jan 15, 2024

@llvm/issue-subscribers-clang-frontend

Author: None (tomasz-kaminski-sonarsource)

The parenthesized initialization of arrays (aggregates) is not supported in the new expression: ```C++ int main() { int x[10](1, 2); // OK auto p = new int[10](1, 2); // ERROR, accepted by GCC and MSVC } ``` Live example: [Godbolt](https://godbolt.org/z/64K39oEhKl)

@shafik
Copy link
Collaborator

shafik commented Jan 15, 2024

@MitalAshok I believe this is a duplicate of: #68198

When triaging new issue please be mindful of finding duplicates because often key analysis can be found in those issues.

@shafik shafik added the confirmed Verified by a second party label Jan 15, 2024
@alanzhao1
Copy link
Contributor

Fixed by #76976

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
clang:frontend Language frontend issues, e.g. anything involving "Sema" confirmed Verified by a second party
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants