Bug 20522 – Spurious statement unreachable warning caused by undefined variable

Status
RESOLVED
Resolution
FIXED
Severity
enhancement
Priority
P4
Component
dmd
Product
D
Version
D2
Platform
x86_64
OS
Linux
Creation time
2020-01-21T17:12:29Z
Last change time
2023-10-01T16:36:37Z
Keywords
pull
Assigned to
No Owner
Creator
Yuxuan Shui

Comments

Comment #0 by yshuiv7 — 2020-01-21T17:12:29Z
Test case: void main(){ import std.stdio : File; { auto test = File("a"); // <- Essential non_existent; } // Warning: statement is not reachable string[] is_this_unreachable_question_mark; }
Comment #1 by dlang-bot — 2023-09-21T12:48:47Z
@adamdruppe updated dlang/dmd pull request #15568 "make D great again" fixing this issue: - Fix 10532, 14835, 20522 by adding test cases https://github.com/dlang/dmd/pull/15568
Comment #2 by dlang-bot — 2023-10-01T16:36:37Z
dlang/dmd pull request #15568 "make D great again" was merged into master: - cfd7cfd4382803e0252ebe1cf13d4c39a60209e5 by Dennis Korpel: Fix 10532, 14835, 20522 by adding test cases https://github.com/dlang/dmd/pull/15568