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

Decipher compiler anomaly for polymorphic copy constructor #74

Open
jbcoe opened this issue Oct 7, 2023 · 1 comment
Open

Decipher compiler anomaly for polymorphic copy constructor #74

jbcoe opened this issue Oct 7, 2023 · 1 comment

Comments

@jbcoe
Copy link
Owner

jbcoe commented Oct 7, 2023

See https://godbolt.org/z/75v65MeWY

Behaviour is unexpected, we'd envisaged generated code to be the same (vtable lookup and a method call) - why do we need more indirection?

@jbcoe
Copy link
Owner Author

jbcoe commented Oct 8, 2023

A further pared down example from Compiler explorer https://godbolt.org/z/q7jodY5vP seems to suggest that accessing the control block from a (minimal) polymorphic object is not zero-cost.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant