www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 5473] New: Members of const-qualified classes are not const themselves.

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

           Summary: Members of const-qualified classes are not const
                    themselves.
           Product: D
           Version: D2
          Platform: Other
        OS/Version: Windows
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: eatingstaples gmail.com



Created an attachment (id=875)
Code demonstrating the issue

An object typed as const will have const members, and a class declared as const
will have const members, but a class typed as const does not have const
members.

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


SomeDude <lovelydear mailmetrash.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |lovelydear mailmetrash.com



PDT ---
The example code in attachment is:

import std.stdio;

class A
{
    int b;
}

void main()
{
    const A a = new A;
    writeln(typeof(a).stringof); // const(A)
    writeln(typeof(a.b).stringof); // const(int)

    writeln((const A).stringof); // const(A)
    writeln(typeof((const A).b).stringof); // int, should be const(int)
}

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Apr 22 2012
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=5473


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

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |pull



https://github.com/D-Programming-Language/dmd/pull/903

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Apr 23 2012
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=5473




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

https://github.com/D-Programming-Language/dmd/commit/94c3a15d6b267ca7ad314482813dfa74e4b55b3f
fix Issue 5473 - Members of const-qualified classes are not const themselves

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


Issue 5473 - Members of const-qualified classes are not const themselves

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Apr 23 2012