www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 1946] New: Compiler crashes on attempt to implicit cast const typedef to non-const.

reply d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=1946

           Summary: Compiler crashes on attempt to implicit cast const
                    typedef to non-const.
           Product: D
           Version: 2.012
          Platform: PC
        OS/Version: Windows
            Status: NEW
          Severity: critical
          Priority: P2
         Component: DMD
        AssignedTo: bugzilla digitalmars.com
        ReportedBy: sardonicpresence gmail.com


If an attempt is made to implicitly cast a const instance of a typedef of a
class to a non-const instance, DMD 2.012 crashes.

The following code causes the compiler to crash:

  class Foo {}
  typedef Foo Test;

  void f(Test test) {}

  void main()
  {
    const Test test;
    f(test);
  }

If "typedef" is replaced with "alias" this does not occur. If "f(Test test)" is
declared as "f(in Test test)" this does not occur. If Test is typedef'd to a
value-type this does not occur (including structs).


-- 
Mar 26 2008
parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=1946


Don <clugdbug yahoo.com.au> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |clugdbug yahoo.com.au
         Resolution|                            |FIXED





Fixed DMD2.030

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
May 14 2009