https://issues.dlang.org/show_bug.cgi?id=18605
Issue ID: 18605
Summary: False unreachable warning generated when labeled
continue is used
Product: D
Version: D2
Hardware: x86_64
OS: Linux
Status: NEW
Severity: enhancement
Priority: P1
Component: dmd
Assignee: [email protected]
Reporter: [email protected]
Code example:
auto test(T...)(int t) {
L:foreach(_; T) {
if (t)
continue L;
return 1;
}
new int; // <-- reported as unreachable
}
int _() {
return test!(1,2,3)(1);
}
While in reality the reachability of 'new int' is dependent on parameter 't'.
--