Bug 21640 – @live not working with templates

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
x86_64
OS
Linux
Creation time
2021-02-15T22:53:17Z
Last change time
2021-02-16T03:01:29Z
Keywords
pull
Assigned to
No Owner
Creator
João Lourenço

Comments

Comment #0 by jlourenco5691 — 2021-02-15T22:53:17Z
@live void alloc(T)() { auto p = malloc(4); } // should not compile with the error: variable `alloc(T).p` is left dangling at return void main() {}
Comment #1 by dlang-bot — 2021-02-16T02:11:42Z
@ljmf00 created dlang/dmd pull request #12197 "Fix issue #21640: @live not working with templates" fixing this issue: - Fix issue #21640: @live not working with templates Signed-off-by: Luís Ferreira <[email protected]> https://github.com/dlang/dmd/pull/12197
Comment #2 by pro.mathias.lang — 2021-02-16T02:28:51Z
Side note: That example is broken (aka not http://sscce.org/ ), aside from the lack of import leading to undefined identifier `malloc`, the template isn't instantiated. But the PR has correct examples.
Comment #3 by dlang-bot — 2021-02-16T03:01:29Z
dlang/dmd pull request #12197 "Fix issue #21640: @live not working with templates" was merged into master: - f0da66d55a73d7271000b7f04fe1ad6d83ca1ef3 by Luís Ferreira: Fix issue #21640: @live not working with templates Signed-off-by: Luís Ferreira <[email protected]> https://github.com/dlang/dmd/pull/12197