Bug 21468 – Inscrutable template error when core.stdcpp.vector of a struct with a core.stdcpp.vector field is referenced before the struct's definition

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P1
Component
druntime
Product
D
Version
D2
Platform
x86_64
OS
Windows
Creation time
2020-12-10T21:46:15Z
Last change time
2020-12-21T01:01:40Z
Keywords
pull
Assigned to
No Owner
Creator
Nathan S.

Comments

Comment #0 by n8sh.secondary — 2020-12-10T21:46:15Z
Related discussion at https://forum.dlang.org/thread/[email protected] Fails with "dmd -m64" on Microsoft Windows: --- import core.stdcpp.vector: stdcpp_vector = vector; void foo(stdcpp_vector!(S)* s) {} struct S { stdcpp_vector!int a; } void main(){} --- main.d(7): Error: struct core.stdcpp.vector.vector(T, Alloc = allocator!T) recursive template expansion main.d(7): while looking for match for stdcpp_vector!(int, allocator!int) ......\src\druntime\import\core\stdcpp\vector.d(33): Error: template instance core.stdcpp.allocator.allocator!(S) error instantiating main.d(3): instantiated from here: stdcpp_vector!(S) Succeeds with "dmd -m64" on Microsoft Windows: --- import core.stdcpp.allocator: allocator; import core.stdcpp.vector: stdcpp_vector = vector; void foo(stdcpp_vector!(S, allocator!S)* s) {} struct S { stdcpp_vector!int a; } void main(){} ---
Comment #1 by dlang-bot — 2020-12-10T21:54:54Z
@n8sh created dlang/druntime pull request #3309 "Fix inscrutable template error when core.stdcpp.vector of a struct with a core.stdcpp.vector field is referenced before the struct's definition" fixing this issue: - Fix Issue 21468 - Inscrutable template error when core.stdcpp.vector of a struct with a core.stdcpp.vector field is referenced before the struct's definition Related discussion at https://forum.dlang.org/thread/[email protected] https://github.com/dlang/druntime/pull/3309
Comment #2 by dlang-bot — 2020-12-12T00:05:35Z
dlang/druntime pull request #3309 "Fix inscrutable template error when core.stdcpp.vector of a struct with a core.stdcpp.vector field is referenced before the struct's definition" was merged into stable: - 12a56aa5fc19552637634f2cf1e56a250589d1fc by Nathan Sashihara: Fix Issue 21468 - Inscrutable template error when core.stdcpp.vector of a struct with a core.stdcpp.vector field is referenced before the struct's definition Related discussion at https://forum.dlang.org/thread/[email protected] https://github.com/dlang/druntime/pull/3309
Comment #3 by dlang-bot — 2020-12-21T01:01:40Z
dlang/druntime pull request #3315 "merge stable" was merged into master: - 1e64c52ef762049e2f12e55fc1d00dff4bd76d92 by Nathan Sashihara: Fix Issue 21468 - Inscrutable template error when core.stdcpp.vector of a struct with a core.stdcpp.vector field is referenced before the struct's definition Related discussion at https://forum.dlang.org/thread/[email protected] https://github.com/dlang/druntime/pull/3315