[cfe-dev] recursive template instantiation exceeded maximum depth of 1024

Joerg Sonnenberger via cfe-dev cfe-dev at lists.llvm.org
Mon Jul 16 05:07:27 PDT 2018


On Mon, Jul 16, 2018 at 12:08:21PM +0300, degski via cfe-dev wrote:
>  I understand, that it is at compile-time (otherwise it wouldn't be a
> problem). My point is, why is there in the case of recursive templates (as
> like in the example) a depth-limit at all. I mean at each recursive
> instantiation, there should be no need to increase the depth on each
> instantiation, as one can "forget" about the ones already instantiated,
> "they did not match".

The depth limit exists to ensure that template instantiation terminates.

Joerg



More information about the cfe-dev mailing list