[Issue 9332] New: [REG][2.061 -> 02.061a] struct constructor taking itself creates "Warning: statement is not reachable"
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Thu Jan 17 08:04:49 PST 2013
http://d.puremagic.com/issues/show_bug.cgi?id=9332
Summary: [REG][2.061 -> 02.061a] struct constructor taking
itself creates "Warning: statement is not reachable"
Product: D
Version: unspecified
Platform: All
OS/Version: All
Status: NEW
Severity: regression
Priority: P2
Component: DMD
AssignedTo: nobody at puremagic.com
ReportedBy: monarchdodra at gmail.com
--- Comment #0 from monarchdodra at gmail.com 2013-01-17 08:04:46 PST ---
Most probably *just* introduced: the packaged 2.061 doesn't create this, but
the latest githead produces the bug.
Produced with dmd with both debug and release. win32 on a win7_64.
//----
Program:
//----
struct S
{
this(S) // <- Line 3 here
{
assert(0, "unreachable?");
}
}
void main()
{
S a;
S b = S(a);
}
//----
//----
Compiler switch:
//----
rdmd -wi -O main.d
//----
//----
Compiler output
//----
main.d(3): Warning: statement is not reachable
//----
The irony here is that running the program gives:
//----
core.exception.AssertError at main.d(5): unreachable?
//----
--
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
More information about the Digitalmars-d-bugs
mailing list