-
Notifications
You must be signed in to change notification settings - Fork 14
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
define_aggregate
: provide empty user-defined constructor or destructor for unions with non-trivial members
#119
base: p2996
Are you sure you want to change the base?
Conversation
Signed-off-by: Valentyn Yukhymenko <valentin.yukhymenko@gmail.com>
Signed-off-by: Valentyn Yukhymenko <valentin.yukhymenko@gmail.com>
Signed-off-by: Valentyn Yukhymenko <valentin.yukhymenko@gmail.com>
Signed-off-by: Valentyn Yukhymenko <valentin.yukhymenko@gmail.com>
Signed-off-by: Valentyn Yukhymenko <valentin.yukhymenko@gmail.com>
Signed-off-by: Valentyn Yukhymenko <valentin.yukhymenko@gmail.com>
Signed-off-by: Valentyn Yukhymenko <valentin.yukhymenko@gmail.com>
Signed-off-by: Valentyn Yukhymenko <valentin.yukhymenko@gmail.com>
Signed-off-by: Valentyn Yukhymenko <valentin.yukhymenko@gmail.com>
NewDecl->needsImplicitDefaultConstructor(); | ||
|
||
if (NeedToGenerateDefaultConstr) { | ||
S.DeclareImplicitDefaultConstructor(NewDecl); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
potentially hacky approach but I tried to reuse existing code as much as possible to not copy generation of constructors
@@ -4532,6 +4532,47 @@ bool define_aggregate(APValue &Result, ASTContext &C, MetaActions &Meta, | |||
if (!Definition) | |||
return true; | |||
|
|||
if (Definition->isUnion()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
decided to put this logic here instead of SemaReflect
because this code is specific to function and doesn't require access to Sema
Issue number of the reported bug or feature request: #115
Describe your changes
Tried to implement next behaviour from paper:
Testing performed
type_traits
Additional context
N/A