[Issue 18607] New: using labelled continue in tuple foreach can break pure
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Tue Mar 13 16:14:41 UTC 2018
https://issues.dlang.org/show_bug.cgi?id=18607
Issue ID: 18607
Summary: using labelled continue in tuple foreach can break
pure
Product: D
Version: D2
Hardware: x86
OS: Windows
Status: NEW
Severity: normal
Priority: P1
Component: dmd
Assignee: nobody at puremagic.com
Reporter: elpenguino+D at gmail.com
int test(T...)() pure {
L:foreach(_; T) {
continue L;
return 1;
}
}
The only return statement in this function is unreachable, so this returns an
uninitialized int as long as >= 1 template parameter is specified. This should
not have been able to be marked pure.
The pure attribute is automatically inferred but I've explicitly added it here.
--
More information about the Digitalmars-d-bugs
mailing list