Bug 5160 – Overzealous recursive template expansion protection.

Status
RESOLVED
Resolution
WORKSFORME
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
x86
OS
Linux
Creation time
2010-11-03T14:54:00Z
Last change time
2014-03-19T04:09:21Z
Assigned to
nobody
Creator
gareth.tpc

Comments

Comment #0 by gareth.tpc — 2010-11-03T14:54:17Z
The following will not compile even though templateFunc is not automatically instantiated with A (there is no actual danger of a stack overflow). struct A(T1) { void templateFunc(T2)(T2 a) { alias A!(typeof(this)) error; } } void main() { A!int a; a.templateFunc!int(0); } Error: recursive template expansion for template argument A!(int)
Comment #1 by lt.infiltrator — 2014-03-19T04:09:21Z
This compiles without errors with v2.065.