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

Very deep template instantiation stacks #1276

Open
AndreyG opened this issue Mar 8, 2024 · 3 comments
Open

Very deep template instantiation stacks #1276

AndreyG opened this issue Mar 8, 2024 · 3 comments
Labels
enhancement New feature or request P2

Comments

@AndreyG
Copy link

AndreyG commented Mar 8, 2024

Just "hello world" example requires template depth limit be 229 for Clang 17.0.1 and 157 for GCC 13.2: https://gcc.godbolt.org/z/K45fxG75T. I think this is too much and cannot work in real world production code.
Do you have ideas what could be improved in this sense and why there are so deep template instantiation stacks?
Maybe something could be optimized in __meta.hpp?

@ericniebler
Copy link
Collaborator

i haven't optimized for instantiation depth. yeah, there is probably some fat to cut in __meta.hpp.

@ericniebler
Copy link
Collaborator

things are modestly better now. see your original link: https://gcc.godbolt.org/z/K45fxG75T. more needs to be done.

@ericniebler ericniebler added enhancement New feature or request P2 labels Mar 11, 2024
@AndreyG
Copy link
Author

AndreyG commented Mar 12, 2024

Yes, it's a little bit better now, depth limit for Clang is 205 and for GCC is 141 (https://gcc.godbolt.org/z/9bG7PTnYs).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request P2
Projects
None yet
Development

No branches or pull requests

2 participants