Skip to content

C++: fix IR generation for constructor base inits when no constructor is present.#7839

Merged
MathiasVP merged 2 commits into
github:mainfrom
rdmarsh2:rdmarsh2/ir-initializer-inheritance-fix
Feb 4, 2022
Merged

C++: fix IR generation for constructor base inits when no constructor is present.#7839
MathiasVP merged 2 commits into
github:mainfrom
rdmarsh2:rdmarsh2/ir-initializer-inheritance-fix

Conversation

@rdmarsh2

@rdmarsh2 rdmarsh2 commented Feb 3, 2022

Copy link
Copy Markdown
Contributor

When a class has no virtual members and no constructor, but an explicitly written destructor, constructors for classes that inherit from it will have a generated call to the nonexistent constructor, leading to any later entries in the initializer list being dropped in the IR. This PR works around the issue by adding a minimal translation for the broken call, allowing later entries in the list to be included in the IR.

@rdmarsh2 rdmarsh2 requested a review from a team as a code owner February 3, 2022 18:51
@github-actions github-actions Bot added the C++ label Feb 3, 2022

@MathiasVP MathiasVP left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! We should probably create an extractor issue for this.

@MathiasVP MathiasVP merged commit 2e2913b into github:main Feb 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants