[Issue 23667] New: [REG2.101] Incorrect escape deprecation on scope lazy pointer parameter
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Thu Feb 2 22:20:02 UTC 2023
https://issues.dlang.org/show_bug.cgi?id=23667
Issue ID: 23667
Summary: [REG2.101] Incorrect escape deprecation on scope lazy
pointer parameter
Product: D
Version: D2
Hardware: All
OS: All
Status: NEW
Severity: regression
Priority: P1
Component: dmd
Assignee: nobody at puremagic.com
Reporter: johanengelen at weka.io
Testcase:
```
struct S {
this(ref int i) {
DBG(&i);
}
}
void DBG(lazy scope int* args) {}
```
Compilation with dlang2.101 gives the error:
<source>(3): Deprecation: escaping reference to outer local variable `i`
Removing `lazy` makes the code compile.
Note that this is very similar but distinct from
https://issues.dlang.org/show_bug.cgi?id=21290 , because that regression
already appeared from 2.073.
--
More information about the Digitalmars-d-bugs
mailing list