[PATCH] D112659: Add a limit to __make_integer_seq builtin.

Richard Smith - zygoloid via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Oct 27 14:10:34 PDT 2021


rsmith added a comment.

I wonder if more generally we should have a limit on either the size of a pack or the number of template arguments in a template specialization, rather than limiting only `__make_integer_seq`? I think a hand-rolled `make_integer_sequence` implementation should also be limited in the same way.

I'd also be inclined to pick a smaller default limit. Maybe 64K? I think we should be aiming to pick a limit that causes template argument list explosions to be caught before the compiler runs out of memory and dies and before the user gets bored and interrupts the compilation, and 16M seems a bit high for both.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D112659/new/

https://reviews.llvm.org/D112659



More information about the cfe-commits mailing list