www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 9332] New: [REG][2.061 -> 02.061a] struct constructor taking itself creates "Warning: statement is not reachable"

reply d-bugmail puremagic.com writes:
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 puremagic.com
        ReportedBy: monarchdodra gmail.com



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 main.d(5): unreachable?
//----

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jan 17 2013
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=9332


monarchdodra gmail.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|[REG][2.061 -> 02.061a]     |[REG][2.060 -> 02.061]
                   |struct constructor taking   |struct constructor taking
                   |itself creates "Warning:    |itself creates "Warning:
                   |statement is not reachable" |statement is not reachable"




 Most probably *just* introduced: the packaged 2.061 doesn't create this, but
 the latest githead produces the bug.
Sorry, my bad, the problem *does* appear in 2.061, but not in 2.060. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Jan 17 2013
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=9332




13:09:36 PST ---
https://github.com/D-Programming-Language/dmd/pull/1528

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jan 21 2013
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=9332




Commits pushed to master at https://github.com/D-Programming-Language/dmd

https://github.com/D-Programming-Language/dmd/commit/ea5ee9b2c1173b0f824ab19dcdeb2c409e7d613c
fix Issue 9332 statement is not reachable

https://github.com/D-Programming-Language/dmd/commit/f512ab6539a0b94bb342c993a8c50ae888b1f904


fix Issue 9332 statement is not reachable

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jan 21 2013
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=9332


Kenji Hara <k.hara.pg gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |pull, rejects-valid
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED


-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jan 21 2013