-
Notifications
You must be signed in to change notification settings - Fork 12.6k
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 incorrectly rejects default construction of union with nontrivial member #48416
Labels
bugzilla
Issues migrated from bugzilla
c++20
clang:frontend
Language frontend issues, e.g. anything involving "Sema"
Comments
Notes are non-normative, so you want to refer to class.default.ctor to back up this assertion. |
@llvm/issue-subscribers-clang-frontend |
CarlosAlbertoEnciso
pushed a commit
to SNSystems/llvm-debuginfo-analyzer
that referenced
this issue
Mar 17, 2023
… unions If a union has explicit initializers for some members, we shouldn't delete its default constructor. Fixes llvm/llvm-project#48416. Reviewed By: erichkeane Differential Revision: https://reviews.llvm.org/D145851
agozillon
pushed a commit
to ROCm-Developer-Tools/llvm-project
that referenced
this issue
Mar 17, 2023
… unions If a union has explicit initializers for some members, we shouldn't delete its default constructor. Fixes llvm/llvm-project#48416. Reviewed By: erichkeane Differential Revision: https://reviews.llvm.org/D145851
This was referenced Feb 14, 2024
a2flo
pushed a commit
to a2flo/floor_llvm
that referenced
this issue
Feb 2, 2025
[Clang][Sema] Fix incorrect deletion of default constructors for some unions If a union has explicit initializers for some members, we shouldn't delete its default constructor. Fixes llvm#48416. Reviewed By: erichkeane Differential Revision: https://reviews.llvm.org/D145851
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
bugzilla
Issues migrated from bugzilla
c++20
clang:frontend
Language frontend issues, e.g. anything involving "Sema"
Extended Description
Consider the following valid TU:
Currently clang rejects this with:
However, according to the standard (https://eel.is/c++draft/class.union#general-4) the member initializer of
first
makes this a valid construct.The text was updated successfully, but these errors were encountered: