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 assertion failure in paren init in new expression #63008

Closed
usx95 opened this issue May 30, 2023 · 7 comments · Fixed by llvm/llvm-project-release-prs#463
Closed

Clang assertion failure in paren init in new expression #63008

usx95 opened this issue May 30, 2023 · 7 comments · Fixed by llvm/llvm-project-release-prs#463
Assignees
Labels
c++20 clang:frontend Language frontend issues, e.g. anything involving "Sema" confirmed Verified by a second party crash Prefer [crash-on-valid] or [crash-on-invalid] release:backport release:merged

Comments

@usx95
Copy link
Contributor

usx95 commented May 30, 2023

GCC: g++.dg/cpp2a/paren-init20.C

struct A {
    int a;
    int b;
};

void foo() {
    auto z = new A(0, {0});
}

https://godbolt.org/z/W6aMaE8fo

@usx95 usx95 added c++20 clang:frontend Language frontend issues, e.g. anything involving "Sema" labels May 30, 2023
@llvmbot
Copy link
Collaborator

llvmbot commented May 30, 2023

@llvm/issue-subscribers-c-20

@llvmbot
Copy link
Collaborator

llvmbot commented May 30, 2023

@llvm/issue-subscribers-clang-frontend

@usx95 usx95 changed the title Clang assertion failure in braced initialisation Clang assertion failure in paren init in new expression May 30, 2023
@EugeneZelenko EugeneZelenko added the crash Prefer [crash-on-valid] or [crash-on-invalid] label May 30, 2023
@shafik
Copy link
Collaborator

shafik commented May 30, 2023

This looks like a relatively recent regression I wonder if @alanzhao1 recent changes might be involved.

@shafik shafik added the confirmed Verified by a second party label May 30, 2023
@alanzhao1 alanzhao1 self-assigned this May 30, 2023
@alanzhao1
Copy link
Contributor

Candidate patch: https://reviews.llvm.org/D151763

@alanzhao1
Copy link
Contributor

Reopening so this can be backported to 16.x

@alanzhao1 alanzhao1 reopened this May 31, 2023
@alanzhao1 alanzhao1 added this to the LLVM 16.0.X Release milestone May 31, 2023
alanzhao1 added a commit to alanzhao1/llvm-project that referenced this issue May 31, 2023
…aggregate init expression

The previous code incorrectly assumed that we would never call
warnBracedScalarInit(...) with a EK_ParenAggInitMember. This patch fixes
the bug by warning when a scalar member is initialized via a braced-init
list when performing a parentehsized aggregate initialization. This
behavior is consistent with parentehsized list aggregate initialization.

Fixes llvm#63008

Reviewed By: shafik

Differential Revision: https://reviews.llvm.org/D151763
@alanzhao1
Copy link
Contributor

/branch alanzhao1/llvm-project/backport-63008

@llvmbot
Copy link
Collaborator

llvmbot commented May 31, 2023

/pull-request llvm/llvm-project-release-prs#463

tstellar pushed a commit that referenced this issue Jun 2, 2023
…aggregate init expression

The previous code incorrectly assumed that we would never call
warnBracedScalarInit(...) with a EK_ParenAggInitMember. This patch fixes
the bug by warning when a scalar member is initialized via a braced-init
list when performing a parentehsized aggregate initialization. This
behavior is consistent with parentehsized list aggregate initialization.

Fixes #63008

Reviewed By: shafik

Differential Revision: https://reviews.llvm.org/D151763
karouzakisp pushed a commit to karouzakisp/llvm-project that referenced this issue Jul 20, 2024
…aggregate init expression

The previous code incorrectly assumed that we would never call
warnBracedScalarInit(...) with a EK_ParenAggInitMember. This patch fixes
the bug by warning when a scalar member is initialized via a braced-init
list when performing a parentehsized aggregate initialization. This
behavior is consistent with parentehsized list aggregate initialization.

Fixes llvm#63008

Reviewed By: shafik

Differential Revision: https://reviews.llvm.org/D151763
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c++20 clang:frontend Language frontend issues, e.g. anything involving "Sema" confirmed Verified by a second party crash Prefer [crash-on-valid] or [crash-on-invalid] release:backport release:merged
Projects
Status: Done
Archived in project
Development

Successfully merging a pull request may close this issue.

5 participants