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